aspire new
Create a new app from an Aspire starter template.Usage
Description
Theaspire new command creates a new Aspire application from a starter template. Templates include pre-configured AppHost projects, service projects, and integration examples.
Templates
The following templates are available:- aspire-starter - A starter template with a web frontend and API backend
- aspire-apphost - An empty AppHost project
- aspire-servicedefaults - A ServiceDefaults project for shared configuration
- aspire-apphost-singlefile - A single-file AppHost (no project file)
Options
The name of the project to createExample:
--name MyAspireAppIf not specified, you’ll be prompted to enter a name.The output path for the projectExample:
--output ./projects/MyAppIf not specified, defaults to a new directory in the current location.The NuGet source to use for project templatesExample:
--source https://api.nuget.org/v3/index.jsonThe version of the project templates to useExample:
--version 10.0.0If not specified, uses the latest version from the selected channel.Channel to use for templates:
stable, daily, or staging (when enabled)Example: --channel dailyIf not specified, uses the configured channel or defaults to stable.The programming language for the AppHost:
csharp or typescriptExample: --language typescriptIf not specified, you’ll be prompted to choose when multiple languages are available.Examples
Create a new starter app
- An AppHost project for orchestration
- A web frontend project
- An API service project
- A ServiceDefaults project for shared configuration
Create with interactive prompts
- Select a template
- Choose a language (if applicable)
- Enter a project name
- Specify an output directory
- Select a template version
Create an empty AppHost
Use a specific version
Use the daily channel
Create a TypeScript AppHost
Interactive Prompts
Template Selection
If you don’t specify a template, you’ll see:Language Selection
For templates that support multiple languages:Project Name
If--name is not provided:
- Not contain path separators (
/or\) - Be between 1-254 characters
- Not be empty or whitespace only
Output Path
If--output is not provided:
Template Version
When multiple versions are available:Template Structure
aspire-starter
Creates a solution with:aspire-apphost
Creates a minimal AppHost project:Configuration
Set a default channel to avoid specifying it each time:Template Installation
Templates are automatically installed when you runaspire new. The CLI:
- Resolves the template version based on
--version,--channel, or configured defaults - Downloads the
Aspire.ProjectTemplatespackage from NuGet - Installs the templates to your local template cache
- Creates the project from the template
See Also
- aspire init - Initialize Aspire in an existing solution
- aspire run - Run your new AppHost
- aspire add - Add integrations to your AppHost