aspire template source command
Это содержимое пока не доступно на вашем языке.
aspire template source - Manage global template sources.
Synopsis
Section titled “Synopsis”aspire template source [command] [options]Description
Section titled “Description”The aspire template source command manages global template sources. A template source is a named location that contains templates: either a Git repository or an absolute local directory. Sources are stored in the global Aspire configuration, so they apply to every project on the machine.
When at least one source is configured, the interactive aspire new template picker lists templates from each source alongside the built-in templates. If a configured source can’t be read when aspire new discovers templates, the command warns about that source and continues with the others.
Template sources require the aspire.config.json configuration format. If your global configuration still uses the legacy format, these commands fail and direct you to run aspire config info to migrate it.
Source display names
Section titled “Source display names”In the aspire new picker, each source’s templates are grouped under a heading that defaults to the source name. To show a friendlier heading, set the optional displayName key for the source:
aspire config set templateSources.company.displayName "Company templates" --globalThe source name remains the source’s identity, so sources with identical display names aren’t merged. An empty or whitespace-only displayName falls back to the source name.
Project-derived prompt defaults
Section titled “Project-derived prompt defaults”Template authors can show a project-derived value as the default in an aspire new prompt. In the template’s .template.config/aspirecli.host.json file (or dotnetcli.host.json if the Aspire-specific file doesn’t exist), set defaultValueSource on an optional string parameter to the name of the coalesce symbol that consumes it:
{ "symbolInfo": { "displayName": { "defaultValueSource": "displayNameValue" } }}{ "displayName": { "type": "parameter", "datatype": "string", "defaultValue": "" }, "displayNameValue": { "type": "generated", "generator": "coalesce", "parameters": { "sourceVariableName": "displayName", "fallbackVariableName": "name" }, "replaces": "DISPLAY_NAME" }}With this configuration, the displayName prompt shows the project name as its default. The parameter must have an empty default, and its fallback can depend only on the project name through regex and coalesce symbols. Otherwise, aspire new reports an invalid prompt default.
Options
Section titled “Options”The following options are available:
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Commands
Section titled “Commands”The following commands are available:
| Command | Function |
|---|---|
aspire template source add <name> | Add a named template source after confirming you trust it. |
aspire template source list | List the configured template sources. |
aspire template source remove <name> | Remove a named template source. |
Examples
Section titled “Examples”-
Add a template source from a Git repository:
Aspire CLI aspire template source add company --repository https://github.com/example/templates -
List the configured template sources:
Aspire CLI aspire template source list -
Remove a template source:
Aspire CLI aspire template source remove company