# aspire secret get command

## Name

`aspire secret get` - Get a secret value.

## Synopsis

```bash title="Aspire CLI"
aspire secret get <key> [options]
```

## Description

The `aspire secret get` command retrieves a user secret value for an Aspire AppHost.

<Include relativePath="reference/cli/includes/project-search-logic-description.md" />

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 <apphost>`**

  The path to the Aspire AppHost project file.

- <Include relativePath="reference/cli/includes/option-help.md" />

- <Include relativePath="reference/cli/includes/option-log-level.md" />

- <Include relativePath="reference/cli/includes/option-non-interactive.md" />

- <Include relativePath="reference/cli/includes/option-nologo.md" />

- <Include relativePath="reference/cli/includes/option-banner.md" />

- <Include relativePath="reference/cli/includes/option-wait.md" />

## 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 --apphost ./src/MyApp.AppHost/MyApp.AppHost.csproj
  ```