From 76a60559c8f7e1c6f3f29a69cdd3eacd9c87fc93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:20:58 +0000 Subject: [PATCH 1/2] Initial plan From 70cc0e948088b623853895bf153329bda47ab5fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:28:50 +0000 Subject: [PATCH 2/2] Add aspire secret CLI command documentation pages and sidebar entries Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../config/sidebar/reference.topics.ts | 30 ++++++++ .../cli/commands/aspire-secret-delete.mdx | 64 ++++++++++++++++ .../cli/commands/aspire-secret-get.mdx | 64 ++++++++++++++++ .../cli/commands/aspire-secret-list.mdx | 60 +++++++++++++++ .../cli/commands/aspire-secret-path.mdx | 50 ++++++++++++ .../cli/commands/aspire-secret-set.mdx | 62 +++++++++++++++ .../reference/cli/commands/aspire-secret.mdx | 76 +++++++++++++++++++ .../docs/reference/cli/commands/aspire.mdx | 1 + 8 files changed, 407 insertions(+) create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret-delete.mdx create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret-get.mdx create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret-list.mdx create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret-path.mdx create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret-set.mdx create mode 100644 src/frontend/src/content/docs/reference/cli/commands/aspire-secret.mdx diff --git a/src/frontend/config/sidebar/reference.topics.ts b/src/frontend/config/sidebar/reference.topics.ts index 82e063b8..8e78bba4 100644 --- a/src/frontend/config/sidebar/reference.topics.ts +++ b/src/frontend/config/sidebar/reference.topics.ts @@ -523,6 +523,36 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig[number] = { slug: 'reference/cli/commands/aspire-publish', }, { label: 'aspire run', slug: 'reference/cli/commands/aspire-run' }, + { + label: 'aspire secret', + collapsed: true, + items: [ + { + label: 'aspire secret', + slug: 'reference/cli/commands/aspire-secret', + }, + { + label: 'aspire secret set', + slug: 'reference/cli/commands/aspire-secret-set', + }, + { + label: 'aspire secret get', + slug: 'reference/cli/commands/aspire-secret-get', + }, + { + label: 'aspire secret list', + slug: 'reference/cli/commands/aspire-secret-list', + }, + { + label: 'aspire secret delete', + slug: 'reference/cli/commands/aspire-secret-delete', + }, + { + label: 'aspire secret path', + slug: 'reference/cli/commands/aspire-secret-path', + }, + ], + }, { label: 'aspire stop', slug: 'reference/cli/commands/aspire-stop' }, { label: 'aspire update', diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-delete.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-delete.mdx new file mode 100644 index 00000000..5521cdaf --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-delete.mdx @@ -0,0 +1,64 @@ +--- +title: aspire secret delete command +description: Learn about the aspire secret delete command and its usage. This command deletes a user secret for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret delete` - Delete a secret. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret delete [options] +``` + +## Description + +The `aspire secret delete` command deletes a user secret from the secrets store for an Aspire AppHost. + + + +The command returns the following exit codes: + +- `0`—The command succeeded. +- `3`—Failed to find the AppHost project. +- `4`—The specified secret key was not found. + +## Arguments + +The following arguments are available: + +- **`key`** + + The secret key to delete. + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Examples + +- Delete a secret: + + ```bash title="Aspire CLI" + aspire secret delete Parameters:postgres-password + ``` + +- Delete a secret for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret delete Parameters:rabbitmq-password --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-get.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-get.mdx new file mode 100644 index 00000000..d1b20cf7 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-get.mdx @@ -0,0 +1,64 @@ +--- +title: aspire secret get command +description: Learn about the aspire secret get command and its usage. This command retrieves a user secret value for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret get` - Get a secret value. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret get [options] +``` + +## Description + +The `aspire secret get` command retrieves a user secret value for an Aspire AppHost. + + + +The command returns the following exit codes: + +- `0`—The command succeeded. +- `3`—Failed to find the AppHost project. +- `4`—The specified secret key was not found. + +## Arguments + +The following arguments are available: + +- **`key`** + + The secret key to retrieve. + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Examples + +- Get the value of a password parameter: + + ```bash title="Aspire CLI" + aspire secret get Parameters:postgres-password + ``` + +- Get a secret for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret get Parameters:rabbitmq-password --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-list.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-list.mdx new file mode 100644 index 00000000..689e598c --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-list.mdx @@ -0,0 +1,60 @@ +--- +title: aspire secret list command +description: Learn about the aspire secret list command and its usage. This command lists all user secrets for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret list` - List all secrets. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret list [options] +``` + +## Description + +The `aspire secret list` command lists all user secrets stored for an Aspire AppHost. By default, secrets are displayed in a table format sorted alphabetically by key. If no secrets are configured, the command displays "No secrets configured." + + + +## Options + +The following options are available: + +- **`--format `** + + Output format. Use `Json` for machine-readable output suitable for scripting and automation. Defaults to `Table`. + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Examples + +- List all secrets for the current AppHost: + + ```bash title="Aspire CLI" + aspire secret list + ``` + +- List secrets in JSON format: + + ```bash title="Aspire CLI" + aspire secret list --format json + ``` + +- List secrets for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret list --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-path.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-path.mdx new file mode 100644 index 00000000..306c29cd --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-path.mdx @@ -0,0 +1,50 @@ +--- +title: aspire secret path command +description: Learn about the aspire secret path command and its usage. This command shows the file path where user secrets are stored for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret path` - Show the secrets file path. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret path [options] +``` + +## Description + +The `aspire secret path` command displays the full file path to the user secrets file for an Aspire AppHost. This is useful when you need to directly inspect or edit the secrets file, or when troubleshooting secrets resolution. + + + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Examples + +- Show the secrets file path for the current AppHost: + + ```bash title="Aspire CLI" + aspire secret path + ``` + +- Show the secrets file path for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret path --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-set.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-set.mdx new file mode 100644 index 00000000..013905bd --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret-set.mdx @@ -0,0 +1,62 @@ +--- +title: aspire secret set command +description: Learn about the aspire secret set command and its usage. This command sets a user secret value for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret set` - Set a secret value. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret set [options] +``` + +## Description + +The `aspire secret set` command sets a user secret value for an Aspire AppHost. If user secrets haven't been initialized for the AppHost yet, this command automatically initializes them before setting the value. + + + +## Arguments + +The following arguments are available: + +- **`key`** + + The secret key to set. Use a colon (`:`) as a separator for hierarchical keys, such as `Parameters:postgres-password`. + +- **`value`** + + The secret value to set. + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Examples + +- Set a password parameter: + + ```bash title="Aspire CLI" + aspire secret set Parameters:postgres-password MySecretPassword123 + ``` + +- Set a secret for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret set Parameters:rabbitmq-password Pass123 --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-secret.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret.mdx new file mode 100644 index 00000000..914fbc98 --- /dev/null +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-secret.mdx @@ -0,0 +1,76 @@ +--- +title: aspire secret command +description: Learn about the aspire secret command and its usage. This command is used to manage user secrets for an Aspire AppHost. +--- + +import Include from '@components/Include.astro'; + +## Name + +`aspire secret` - Manage AppHost user secrets. + +## Synopsis + +```bash title="Aspire CLI" +aspire secret [command] [options] +``` + +## Description + +The `aspire secret` command manages user secrets for an Aspire AppHost project. User secrets provide a safe way to store sensitive configuration values—such as passwords, API keys, and connection strings—outside of your project files during local development. + +Aspire uses user secrets to persist values that resources need across restarts, such as auto-generated passwords for database containers. When you add a persistent resource that requires a password, Aspire automatically initializes user secrets for the AppHost and saves the generated password. On subsequent runs, the saved password is reused so that the resource retains its state. + + + +## Options + +The following options are available: + +- **`--apphost`** + + The path to the Aspire AppHost project file. Alias: `--project`. + +- + +- + +- + +## Commands + +The following commands are available: + +| Command | Function | +| -------------------------------------------------------------- | ----------------------------- | +| [`aspire secret set `](../aspire-secret-set/) | Set a secret value. | +| [`aspire secret get `](../aspire-secret-get/) | Get a secret value. | +| [`aspire secret list`](../aspire-secret-list/) | List all secrets. | +| [`aspire secret delete `](../aspire-secret-delete/) | Delete a secret. | +| [`aspire secret path`](../aspire-secret-path/) | Show the secrets file path. | + +## Examples + +- Set a secret value for the current AppHost: + + ```bash title="Aspire CLI" + aspire secret set Parameters:postgres-password MySecretPassword123 + ``` + +- List all secrets for a specific AppHost: + + ```bash title="Aspire CLI" + aspire secret list --project ./src/MyApp.AppHost/MyApp.AppHost.csproj + ``` + +- Get the value of a specific secret: + + ```bash title="Aspire CLI" + aspire secret get Parameters:postgres-password + ``` + +- Show the path to the secrets file: + + ```bash title="Aspire CLI" + aspire secret path + ``` diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx index 27f1b61f..34b976c4 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire.mdx @@ -56,6 +56,7 @@ The following commands are available: | [`aspire ps`](../aspire-ps/) | Stable | List running Aspire AppHost processes. | | [`aspire publish`](../aspire-publish/) | Preview | Generates deployment artifacts for an Aspire apphost project. | | [`aspire run`](../aspire-run/) | Stable | Run an Aspire apphost for local development. | +| [`aspire secret`](../aspire-secret/) | Stable | Manage AppHost user secrets. | | [`aspire stop`](../aspire-stop/) | Stable | Stop a running Aspire AppHost. | | [`aspire update`](../aspire-update/) | Preview | Update Aspire packages and templates in your project. |