-
Notifications
You must be signed in to change notification settings - Fork 153
Initial drafts of .NET Aspire CLI docs #3905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
adegeo
wants to merge
6
commits into
main
Choose a base branch
from
adegeo/3707/cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5cf3a77
Initial drafts
adegeo fb274b1
Apply suggestions from code review
adegeo ae367c3
Add first aspire cli ref doc
adegeo 641c62f
Feedback for install
adegeo 01e828a
Update create and run sections
adegeo 508cc7a
Apply suggestions from code review
adegeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
title: aspire command | ||
description: Learn about the aspire command (the generic driver for the Aspire CLI) and its usage. | ||
ms.date: 06/26/2025 | ||
--- | ||
# dotnet command | ||
|
||
**This article applies to:** ✔️ Aspire CLI 9.3.1 and later versions | ||
|
||
## Name | ||
|
||
`aspire` - The generic driver for the Aspire CLI. | ||
|
||
## Synopsis | ||
|
||
To get information about the available commands and the environment: | ||
|
||
```dotnetcli | ||
aspire [command] [options] | ||
``` | ||
|
||
## Description | ||
|
||
The `aspire` command provides commands for working with Aspire projects. For example `aspire run` runs an Aspire AppHost project. | ||
|
||
## Options | ||
|
||
The following options are available when `aspire` is used by itself, without specifying a command. For example, `aspire --version`. | ||
|
||
- **`-?, -h, --help`** | ||
|
||
Prints out help and usage documentation for the available commands and options. | ||
|
||
- **`--version`** | ||
|
||
Prints the version of the .NET Aspire CLI tool. | ||
|
||
- **`-d, --debug`** | ||
|
||
Enable debug logging to the console, which prints out 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. | ||
|
||
## Commands | ||
|
||
| Command | Function | | ||
|-------------------------------------|----------------------------------------------------------------| | ||
| [aspire new](aspire-new.md) | Create an Aspire sample project or solution from a template. | | ||
| [aspire run](aspire-run.md) | Run an Aspire app host in development mode. | | ||
| [aspire add](aspire-add.md) | Add an integration to the Aspire project. | | ||
| [aspire publish](aspire-publish.md) | Generates deployment artifacts for an Aspire app host project. | | ||
| [aspire config](aspire-config.md) | | | ||
| [aspire exec](aspire-exec.md) | | | ||
|
||
## Examples | ||
|
||
Create an Aspire solution from the template: | ||
|
||
```dotnetcli | ||
aspire new aspire-starter | ||
``` | ||
|
||
Run an Aspire app host project: | ||
|
||
```command | ||
aspire run | ||
``` | ||
|
||
## See also | ||
|
||
- [Environment variables used by .NET SDK, .NET CLI, and .NET runtime](dotnet-environment-variables.md) | ||
- [Runtime Configuration Files](https://github.com/dotnet/sdk/blob/main/documentation/specs/runtime-configuration-file.md) | ||
- [.NET runtime configuration settings](../runtime-config/index.md) | ||
Check failure on line 75 in docs/cli-reference/aspire.md
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: Install .NET Aspire CLI | ||
description: Learn how to install .NET Aspire CLI, which is a .NET global tool. Use the .NET Aspire CLI to create, run, and manage .NET Aspire projects. | ||
author: adegeo | ||
ms.author: adegeo | ||
ms.topic: install-set-up-deploy | ||
ms.date: 06/26/2025 | ||
|
||
#customer intent: As a developer, I want to install the .NET Aspire CLI so that I can create, run, and manage .NET Aspire projects. | ||
|
||
--- | ||
|
||
# Install .NET Aspire CLI | ||
|
||
This article teaches you how to install .NET Aspire CLI, which is a .NET global tool used to manage your .NET Aspire projects. | ||
|
||
## Prerequisites | ||
|
||
- [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) or [.NET SDK 9.0](https://dotnet.microsoft.com/download/dotnet/9.0). | ||
|
||
## Install the global tool | ||
|
||
Use the `dotnet tool` command to install .NET Aspire CLI global tool. The name of the global tool is [Aspire.Cli](https://www.nuget.org/packages/Aspire.CLI). | ||
|
||
01. Open a terminal. | ||
01. Run the following command to install Aspire CLI: | ||
|
||
```dotnetcli | ||
dotnet tool install -g Aspire.Cli --prerelease | ||
``` | ||
|
||
## Validation | ||
|
||
To validate that the global tool is installed, use the `--version` option to query Aspire CLI for a version number: | ||
|
||
``` | ||
aspire --version | ||
``` | ||
|
||
If that command works, you're presented with the version of the .NET Aspire CLI tool: | ||
|
||
``` | ||
9.3.1-preview.1.25305.6+5bc26c78ff8c7be825d0ae33633a1ae9f1d64a67 | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
title: .NET Aspire CLI Overview and Commands | ||
description: Learn .NET Aspire CLI commands for creating projects, running an app host, and adding integrations. Get started with command-line tools to build and manage distributed applications efficiently. | ||
ms.date: 06/26/2025 | ||
ms.topic: overview | ||
ms.custom: | ||
- ai-gen-docs-bap | ||
- ai-gen-title | ||
- ai-seo-date:06/26/2025 | ||
- ai-gen-description | ||
--- | ||
|
||
# .NET Aspire CLI Overview | ||
|
||
// TODO: More selling of why you want to use this instead of the .NET CLI you're probably already familiar with. | ||
|
||
The .NET Aspire CLI (`aspire` command) is a .NET global tool that provides command-line functionality to create, manage, run, and publish Aspire projects. Use the .NET Aspire CLI to streamline development workflows for distributed applications. | ||
|
||
The Aspire CLI is an interactive-first experience. | ||
|
||
- [Install .NET Aspire CLI](install.md) | ||
|
||
## Create projects | ||
|
||
The `aspire new` command is an interactive-first CLI experience, and is used to create one or more Aspire projects. As part of creating a project, Azure CLI ensures that the latest Aspire project templates are installed into the `dotnet` system. | ||
|
||
<!-- Add asciinema here --> | ||
|
||
Use the `aspire new` command to create an Aspire project from a list of templates. Once a template is selected, the name of the project is set, and the output folder is chosen, `aspire` downloads the latest templates and generates one or more projects. | ||
|
||
While command line parameters can be used to automate the creation of an Aspire project, the Aspire CLI is an interactive-first experience. | ||
|
||
## Run the app host project | ||
|
||
The `aspire run` command runs the app host project in development mode, which configures the Aspire environment, builds the app host, launches the web dashboard, and displays a terminal-based dashboard. This is similar to running the app host project in your IDE of choice, however, a terminal dashboard is also visible. | ||
|
||
When `aspire run` starts, it searches the current directory for an app host. If an app host isn't found, the sub directories are searched until an app host is found. If no app host is found, Aspire stops. Once an app host is found, Aspire CLI takes the following stesp: | ||
|
||
- Installs or verifies that Aspires local hosting certificates are installed and trusted. | ||
- Builds the app host project. | ||
- Starts the app host. | ||
- Starts the dashboard. | ||
- Displays a terminal-based dashboard. | ||
|
||
<!-- Add asciinema here instead of the terminal dashboard --> | ||
|
||
The following snippet is an example of the terminal dashboard: | ||
|
||
```Aspire CLI | ||
Dashboard: | ||
📈 Direct: https://localhost:17077/login?t=64ebc6d760ab2c48df93607fd431cf0a | ||
|
||
╭─────────────┬─────────┬─────────┬────────────────────────╮ | ||
│ Resource │ Type │ State │ Endpoint(s) │ | ||
├─────────────┼─────────┼─────────┼────────────────────────┤ | ||
│ apiservice │ Project │ Running │ https://localhost:7422 │ | ||
│ │ │ │ http://localhost:5327 │ | ||
│ webfrontend │ Project │ Running │ https://localhost:7241 │ | ||
│ │ │ │ http://localhost:5185 │ | ||
╰─────────────┴─────────┴─────────┴────────────────────────╯ | ||
Press CTRL-C to stop the app host and exit. | ||
``` | ||
|
||
## Add integrations | ||
|
||
The `aspire add` command is an easy way to add official integration packages to your app host. Use this as an alternative to a NuGet search through your IDE. You can run `aspire add <name|id>` if you know the name or NuGet ID of the integration package, If you omit a name or ID, the tool provides a list of packages to choose from. If you provide a partial name or ID, the tool filters the list of packages with items that match the provided value. | ||
|
||
<!-- Add asciinema here --> | ||
|
||
## Publish Aspire applications | ||
|
||
// TODO: Stuff about publishing | ||
|
||
## Configure Aspire environment | ||
|
||
|
||
Check failure on line 76 in docs/cli/overview.md
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.