# aspire secret set command

## Name

`aspire secret set` - Set a secret value.

## Synopsis

```bash title="Aspire CLI"
aspire secret set <key> <value> [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.

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

## 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 <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

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