इसे छोड़कर कंटेंट पर जाएं
Docs Try Aspire
Docs Try

aspire init command

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

aspire init - Initialize Aspire support in an existing codebase with a C# or TypeScript AppHost.

Aspire CLI
aspire init [options]

The aspire init command initializes Aspire support in an existing repo or workspace. It scaffolds a minimal AppHost skeleton together with an aspire.config.json, then optionally installs the aspireify agent skill so your AI coding agent can complete the wiring.

This command defaults to interactive mode. When executed without any options, the command prompts you for the AppHost language when more than one path is available.

The command adapts to the repo it finds:

  • C# file-based AppHost (when selected interactively) — creates apphost.cs with #:sdk and #:package directives for a lightweight single-file orchestrator.
  • TypeScript AppHost (when selected interactively) — creates apphost.ts with the generated .modules/ folder.

In all cases, the AppHost language does not limit what you can orchestrate — C#, JavaScript, Python, Go, Rust, Java, containers, and more can all be modeled in the same application model.

After the skeleton is dropped, aspire init has an option to install the aspireify skill into your AI agent’s skill directory (the same directory used by aspire agent init). The skill is a Markdown file with instructions that guide your AI coding agent through completing the Aspire wiring for your specific codebase.

The skill instructs the agent to:

  • Scan the repo and discovering existing projects, services, and containers
  • Ask you clarifying questions before making decisions — for example, which services to orchestrate, whether a hardcoded port is significant, or whether to map an existing env var or switch to Aspire’s service discovery
  • Wire resources into the AppHost with WithReference, WaitFor, endpoints, and volumes
  • Optionally configure OpenTelemetry
  • Validate the wiring with a smoke-test aspire start

The following options are available:

  • --channel

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

  • --language

    The AppHost language to scaffold (csharp, typescript).

  • -?, -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 repo interactively:

    Aspire CLI
    aspire init
  • Initialize Aspire support with a TypeScript AppHost:

    Aspire CLI
    aspire init --language typescript
  • Initialize Aspire support using the daily channel templates:

    Aspire CLI
    aspire init --channel daily