Skip to content

aspire new command

This article applies to: ✔️ Aspire CLI 9.4.0 and later versions.

aspire new - Create a new Aspire project or solution.

Aspire CLI
aspire new [command] [options]

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.

The following options are available:

  • -n, --name

    The name of the project to create.

  • -o, --output

    The output path for the project.

  • -s, --source

    The NuGet source to use for the project templates.

  • -v, --version

    The version of the project templates to use.

  • -?, -h, --help

    Prints help and usage documentation for the available commands and options.

  • -d, --debug

    Enable debug logging to the console, which prints detailed information about what .NET Aspire CLI is doing when a command is run.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

Each command represents a template. Pass the --help parameter to the template command to print the options available to the template.

CommandTemplate
aspireAspire Empty App
aspire-apphostAspire AppHost
aspire-mstestAspire Test Project (MSTest)
aspire-nunitAspire Test Project (NUnit)
aspire-servicedefaultsAspire Service Defaults
aspire-starterAspire Starter App
aspire-xunitAspire Test Project (xUnit)
  • 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 aspireapp from the 9.4.1 templates and place the output in a folder named dev.

    Aspire CLI
    aspire new aspire-apphost --version 9.4.1 --name aspireapp --output ./dev
Ask & Answer Collaborate Community Discuss Watch