aspire new command
aspire new - Create a new Aspire project or solution.
Synopsis
Section titled “Synopsis”aspire new [command] [options]Description
Section titled “Description”The aspire new command is the driver for creating Aspire projects, apps, or solutions, based on the Aspire templates. Each command specifies the template to use, and the options for the driver specify the options for the template.
This command defaults to interactive mode. When executed without any options, the command prompts you for the project template and version, name, and output folder. When the --name, --output, and --version options are provided, the command runs non-interactive and generates files based on the command template.
Default output directory
Section titled “Default output directory”When you don’t provide --output, the default output directory is derived from the template name. For example, running aspire new aspire-starter without --output creates a directory named ./aspire-starter in the current working directory.
If that directory already exists and is non-empty, the command automatically appends a numeric suffix to find a unique name (for example, ./aspire-starter-2, ./aspire-starter-3, and so on).
Output path validation
Section titled “Output path validation”The --output option validates the provided path before creating the project:
- Paths that contain invalid characters (such as null bytes) are rejected with an error.
- Paths that point to an existing non-empty directory are rejected with a clear error message. Use a different output path or an empty directory.
Interactive prompts
Section titled “Interactive prompts”When running aspire new in interactive mode, the command asks one or more questions before generating the project. The available prompts depend on the template and options you provide.
Select a template
Section titled “Select a template”When you run aspire new in an interactive terminal, the initial template picker lists the built-in templates together with templates from configured template sources. When at least one template source is configured, the picker groups its entries under nonselectable headings. Built-in templates appear under Built-in templates, and each configured source appears under its own heading. There’s no separate submenu or search action for each source.
Each terminal entry is shown in the form Template Name (Template Description). If a template has no description, only the name is shown. In the grouped terminal picker, long entries and headings are truncated with an ellipsis to fit the terminal width. When you type to search for a template, the selection moves to a matching entry rather than filtering the list. In the grouped terminal picker, search matches only the visible text of an entry.
If no template sources are configured, or if you pass --source, --version, --channel, or --language, the picker shows a flat list of the built-in templates, without headings or truncation. Those options skip the discovery of configured template sources, so templates from configured sources can’t be combined with them.
Configure template sources
Section titled “Configure template sources”A template source is a named Git repository or local directory that contains templates. Sources added with aspire template source add are stored in global Aspire configuration and apply to every project on the machine. An accepted configuration source can also provide template sources for the current invocation without saving them globally. Use the aspire template source commands to manage global sources rather than editing the configuration file directly:
aspire template source add company --repository https://github.com/example/templatesUse *.dev.localhost URLs?
Section titled “Use *.dev.localhost URLs?”During project creation, you may be prompted:
Use *.dev.localhost URLs?
This prompt determines whether the generated launch profile configures your Aspire services to be accessible via *.dev.localhost wildcard subdomain URLs (for example, https://myservice.dev.localhost) instead of standard http://localhost with port numbers.
What are *.dev.localhost URLs?
Section titled “What are *.dev.localhost URLs?”*.dev.localhost is a wildcard subdomain pattern that resolves to your local machine (127.0.0.1 or ::1) in most modern browsers without additional DNS configuration. This resolution is a browser feature — non-browser HTTP clients (for example, curl, HttpClient, or other command-line tools) don’t automatically resolve *.dev.localhost subdomains and may require hosts file entries to reach them.
The Aspire developer certificate trusts *.dev.localhost subdomains, so browsers accept HTTPS connections to any subdomain when the certificate is trusted.
Yes — use *.dev.localhost URLs
Section titled “Yes — use *.dev.localhost URLs”Choosing Yes configures the generated project so that each service gets a unique subdomain URL such as https://myservice.dev.localhost. This option:
- Enables HTTPS for all services from the start, leveraging the Aspire developer certificate.
- Gives each service its own origin, which prevents cookie and authentication token collisions between services running on the same machine.
- More closely mirrors a production setup where services are hosted on separate domains or subdomains.
Prerequisite: The Aspire developer certificate must be trusted on your machine. If you haven’t already done so, run:
aspire certs trustNo — use standard localhost URLs (default)
Section titled “No — use standard localhost URLs (default)”Choosing No (the default) configures services with standard http://localhost:<port> addresses. This option requires no certificate setup and works in all browsers and tools without additional configuration.
Options
Section titled “Options”The following options are available:
-
-n, --nameThe name of the project to create.
-
-o, --outputThe output path for the project.
-
-s, --sourceThe NuGet source to use for the project templates.
-
-v, --versionThe version of the project templates to use.
-
--channelChannel to use for templates (
stable,staging,daily). If you don’t specify--version,aspire newselects a template package from the channel and prefers the version that matches the currently installed CLI/SDK. For explicit pre-release channels, such asstaginganddaily, it pins templates to the installed CLI/SDK version when the feed would otherwise select a newer pre-release package. For example, a13.4CLI using--channel dailywon’t pull13.5preview templates even if the daily feed contains them. If you specify--version, that template version is used with the selected channel.When
--channelis not specified,aspire newautomatically uses the running CLI’s identity channel — the channel that matches the CLI build you have installed (for example,dailyfor a nightly build,stagingfor a release-candidate build, or apr-<N>channel for a pull-request build). This ensures that the correct package feed is used to resolveAspire.ProjectTemplateswithout requiring an explicit flag.If the CLI’s identity does not match any registered explicit channel (for example, on a stable release or a locally-built CLI),
aspire newfalls back to ambient NuGet configuration (the implicit nuget.org channel).Requesting
--channel stagingexplicitly only resolves onstableorstagingAspire CLI builds. Daily, local, and per-PR builds don’t have a deterministic staging feed, so they refuse the request with an error naming the running CLI’s identity and pointing at the recovery options: install a staging or stable Aspire CLI, or setoverrideStagingFeedto point at the staging feed you want to use. -
--languageThe programming language for the AppHost, such as
csharp,typescript, orgo. When you don’t pass a template,aspire newoffers only the templates that support the language. -
--template-path <path>Path to an unpacked .NET template package directory. When you also specify
--template-repository, the path is relative to the repository root, and it defaults to the root. You can’t combine this option with a template command,--source,--version,--channel, or--language. -
--template-repository <repository>Clone a Git repository that contains templates, and choose a template from it without registering a template source. Requires Git on your
PATH. The same restrictions as--template-pathapply. -
--template-repository-ref <ref>The branch, tag, or full commit SHA of the template repository to use. Requires
--template-repository. Defaults to the repository’s default branch. -
--use-config-source [true|false]Choose whether to use the offered configuration source during project creation. Pass
--use-config-sourceor--use-config-source trueto accept, or--use-config-source falseto decline and save an app-local opt-out.If a source is available and this option is omitted, the CLI asks for consent interactively. Non-interactive creation requires an explicit choice. Requesting acceptance when no source is available is an error.
-
--suppress-agent-initSkip AI agent setup after project creation. To configure MCP, use a standalone
aspire agent initcommand. -
--agents <agents>Comma-separated agent IDs:
copilot,claude, oropencode. Useallto configure all supported agents ornoneto skip agent configuration. For selection defaults, see theaspire agent initcommand reference. -
--scope <project|global>Write agent configuration and companion skill files at the project or the user scope. Non-interactive setup defaults to
project. -
--skills <skills>Comma-separated choices:
aspire,playwright-cli, ordotnet-inspect. Useallfor every applicable choice ornoneto skip them. Defaults toaspire, which applies all enabled skill sources. For details, see theaspire agent initcommand reference. -
-?, -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”Each command represents a template. Pass the --help parameter to the template command to print the options available to the template.
| Command | Template |
|---|---|
aspire-starter | Starter App (ASP.NET Core/Blazor) |
aspire-ts-cs-starter | Starter App (ASP.NET Core/React) |
aspire-py-starter | Starter App (FastAPI/React) |
aspire-ts-starter | Starter App (Express/React) |
aspire-go-starter | Starter App (Go API/React, Go AppHost) |
aspire-empty | Empty (C# AppHost) |
aspire-ts-empty | Empty (TypeScript AppHost) |
aspire-go-empty | Empty (Go AppHost) |
aspire-py-starter options
Section titled “aspire-py-starter options”The aspire-py-starter template accepts the following additional options:
-
--use-redis-cacheScaffold the template with an optional Redis cache resource in the TypeScript AppHost. Accepts
trueorfalse. Defaults to prompting interactively.Aspire CLI aspire new aspire-py-starter --use-redis-cache true
aspire-go-starter options
Section titled “aspire-go-starter options”The aspire-go-starter template scaffolds a Go API (api/), a Vite and React frontend (frontend/), and a Go AppHost (apphost.go). It accepts the following additional options:
-
--use-redis-cacheScaffold the template with an optional Redis cache. Accepts
trueorfalse. Interactive scaffolding prompts for Redis and defaults to yes. Non-interactive scaffolding doesn’t include Redis unless you specify--use-redis-cache true.Aspire CLI aspire new aspire-go-starter --non-interactive --use-redis-cache true
Configuration sources and template discovery
Section titled “Configuration sources and template discovery”When ASPIRE_INIT_SOURCE_URL is explicitly configured and you accept the source, the interactive aspire new template picker can include its templates alongside templates from global sources. Declining the source excludes its template sources from discovery.
If a global template source has the same name as an inherited source, the global source’s entire definition takes precedence. Source names are compared case-insensitively. Template discovery ignores templateSources defined in an app’s local configuration.
Use aspire template source list to list named template sources without discovering templates. It combines global template sources with sources from an accepted configuration source for that invocation. It doesn’t save the inherited sources globally or in an app.
For JSON output, the command lists global sources without consulting a configuration source by default. Pass --use-config-source to accept the offered source and include its template sources:
aspire template source list --format json --use-config-sourceIn table output, the command offers an available source interactively. Pass --use-config-source false to decline it. The CLI displays a trust warning even when --use-config-source supplies the choice.
Examples
Section titled “Examples”-
Create an Aspire solution from the template. Because the template was selected (
aspire-starter), you’re prompted for the name, output folder, and template version.Aspire CLI aspire new aspire-starter -
Create an AppHost project named
aspireappfrom the 17.0.0 templates and place the output in a folder nameddev.Aspire CLI aspire new aspire-empty --version 17.0.0 --name aspireapp --output ./dev -
Create an Aspire starter app using templates from the
dailychannel to get the latest pre-release templates.Aspire CLI aspire new aspire-starter --channel daily -
Create a new project non-interactively without configuring agents:
Aspire CLI aspire new aspire-starter --name myapp --agents none --non-interactive -
Create a new project non-interactively and accept an available configuration source:
Aspire CLI aspire new aspire-starter --name myapp --agents none --use-config-source --non-interactive -
Create a new project non-interactively and configure all supported agents at the project scope:
Aspire CLI aspire new aspire-starter --name myapp --agents all --skills aspire --scope project --non-interactive -
Create a project from templates in a local, unpacked template package directory:
Aspire CLI aspire new --template-path ./my-templates -
Create a project from templates in a Git repository:
Aspire CLI aspire new --template-repository https://github.com/Azure/aspire-templates -
Create a project from a template in a subdirectory of a specific branch of a Git repository:
Aspire CLI aspire new --template-repository https://github.com/example-org/aspire-templates --template-repository-ref custom-starter --template-path templates
Troubleshooting
Section titled “Troubleshooting”Language support not found
Section titled “Language support not found”When aspire new runs a template that requires code generation (for example, a TypeScript or Python AppHost template), it uses language support and code generator assemblies loaded by the apphost server. If those assemblies cannot load their types, the command may fail with an error such as:
No language support found for: typescript/nodejs. Available languages: go, java, python, rust.Or, when no language support implementations are discovered at all:
No language support found for: typescript/nodejs. No language support implementations were discovered in any loaded assembly.This usually indicates a binary mismatch between the bundled apphost server and the integration assemblies on disk;check the apphost server log for 'LoaderExceptions' Warnings.These errors mean the integration assemblies on disk are not compatible with the bundled apphost server. This typically happens after a partial NuGet cache update, a version skew between the CLI and the integration packages, or an interrupted restore.
To resolve:
-
Clear the Aspire CLI cache to remove stale cached assemblies:
Aspire CLI aspire cache clear -
Re-run
aspire newto trigger a fresh restore of the integration packages.
If the error persists, check the apphost server log for Warning entries that include LoaderExceptions or mention a shared assembly version mismatch (for example, Aspire.TypeSystem bundled version vs. the version on disk). These log entries name the offending assembly and describe the mismatch, making it easier to identify which package version is out of sync.
Git-backed configuration source or template failures
Section titled “Git-backed configuration source or template failures”When aspire new acquires a Git-backed configuration source or template, the CLI records Git stdout and stderr output as Git stdout: and Git stderr: entries in the CLI log file. These entries are written to the log file without --debug. With --debug or --log-level Debug, they also appear on the console.
Git operations time out after five minutes, which allows time for browser sign-in, multifactor authentication, and credential-helper prompts. If acquiring a configuration source fails and a README URL is available, the error message includes a second line that links to that source’s setup instructions.
To capture the Git output for troubleshooting, specify a log file:
aspire new --log-file ./aspire-new.log