Aspire CLI Overview
The Aspire CLI (aspire) is a command-line tool for creating, running, and managing .NET Aspire applications. It provides a streamlined developer experience for building distributed cloud-native applications.
Installation
The Aspire CLI is included with the .NET Aspire workload. Install it using:Available Commands
The Aspire CLI organizes commands into functional groups:Project Management
- aspire new - Create a new app from an Aspire starter template
- aspire init - Initialize Aspire in an existing codebase
- aspire add - Add a hosting integration to the AppHost
Development
- aspire run - Run an Aspire AppHost interactively for development
- aspire stop - Stop a running AppHost instance
- aspire ps - List running AppHost processes
- aspire logs - View logs from a running AppHost
Deployment
- aspire deploy - Deploy an AppHost to its deployment targets
- aspire publish - Generate deployment manifests
Configuration
- aspire config - Manage CLI configuration settings
- aspire doctor - Diagnose common issues with your Aspire installation
- aspire update - Check for and install CLI updates
Common Workflows
Creating a New Application
Create a new Aspire application from a starter template:Adding Aspire to an Existing Solution
Initialize Aspire in an existing .NET solution:aspire init command will:
- Detect your existing solution file
- Create an AppHost project
- Create a ServiceDefaults project
- Prompt you to add existing projects to the AppHost
Adding Integrations
Add hosting integrations (databases, message queues, etc.) to your AppHost:- Search for available integration packages
- Prompt you to select a version
- Add the NuGet package to your AppHost project
Running Your Application
Start your AppHost in development mode:- Monitor resource health and state
- View structured logs and traces
- Inspect environment variables and endpoints
- Test service-to-service communication
Deploying to Production
Deploy your application to Azure or Kubernetes:- Generates deployment manifests
- Provisions cloud resources
- Deploys your services to the target environment
Global Options
The following options are available for all commands:Set the logging verbosity level:
Trace, Debug, Information, Warning, Error, or CriticalRun in non-interactive mode (no prompts)
Suppress the Aspire banner on startup
Wait for a debugger to attach before starting the AppHost (useful for debugging AppHost startup)
Getting Help
View help for any command:Next Steps
- Learn how to create new projects
- Explore how to run your AppHost
- Discover available integrations