Skip to content
Docs Try Aspire

aspire init command

aspire init - Initialize Aspire support in an existing solution or create a single-file AppHost.

Aspire CLI
aspire init [options]

The aspire init command initializes Aspire support in your existing .NET solution or creates a single-file AppHost project. This is useful when you want to add Aspire orchestration capabilities to an existing application without creating an entirely new solution structure.

This command defaults to interactive mode. When executed without any options, the command prompts you for the necessary information. When the --version and --source options are provided, the command runs non-interactive mode.

The command performs the following actions:

  • Analyzes your existing solution structure
  • Adds the necessary Aspire AppHost project or creates a single-file AppHost
  • Installs required Aspire packages
  • Sets up the initial configuration for orchestration

The following options are available:

  • -s, --source

    The NuGet source to use for the project templates.

  • -v, --version

    The version of the project templates to use.

  • --channel

    Channel to use for templates (stable, staging, daily).

  • -?, -h, --help

    Prints 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-interactive

    Run the command in non-interactive mode, disabling all interactive prompts and spinners.

  • --nologo

    Suppress the startup banner and telemetry notice.

  • --banner

    Display the animated Aspire CLI welcome banner.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • Initialize Aspire support in the current solution interactively:

    Aspire CLI
    aspire init
  • Initialize Aspire support using a specific template version:

    Aspire CLI
    aspire init --version 13.2.0
  • Initialize Aspire support from a custom NuGet source:

    Aspire CLI
    aspire init --source https://api.nuget.org/v3/index.json --version 13.2.0