> Markdown version of https://tuna.am/en/docs/cli/secrets/run/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# tuna secrets run

Run a command with injected secrets.

Usage

```bash
tuna secrets run -- [COMMAND] [ARGUMENTS] [flags]

```

| Flag                           | Description                                                                                                                                          |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--command string`             | Command to execute via shell (e.g. "echo $HOME && env").                                                                                             |
| `-c, --config string`          | Configuration name.                                                                                                                                  |
| `--fallback string`            | Path to the encrypted fallback file (default is derived from the configuration).                                                                     |
| `--fallback-only`              | Read secrets from the fallback file without contacting the API.                                                                                      |
| `--fallback-passphrase string` | Passphrase for the fallback file, env `TUNA_SECRETS_FALLBACK_PASSPHRASE` (default is derived from the API key, project and config).                  |
| `--fallback-readonly`          | Disable modifying the fallback file.                                                                                                                 |
| `--forward-signals`            | Forward signals to the child process (defaults to true when stdout is not a TTY). Default: `true`.                                                   |
| `--mount string`               | Write secrets to an ephemeral file (named pipe), accessible at `TUNA_SECRETS_MOUNT_PATH`; secrets are not injected into the environment.             |
| `--mount-format string`        | Mount file format (env, env-no-quotes, json, yaml or docker). Default: `env`.                                                                        |
| `--mount-max-reads int`        | Maximum number of times the mounted file can be read (0 for unlimited).                                                                              |
| `--mount-template string`      | Template file to render into the mount instead of a fixed format.                                                                                    |
| `--name-transformer string`    | Transform secret names (upper-camel, camel, lower-snake, lower-kebab, tf-var or dotnet-env).                                                         |
| `--no-fallback`                | Disable reading and writing the fallback file.                                                                                                       |
| `--offline`                    | Alias for `--fallback-only`.                                                                                                                         |
| `--only-secrets`               | Pass only secrets to the child process (plus PATH, HOME, PS1, USER, SHELL, TMPDIR).                                                                  |
| `--preserve-env string`        | List of secrets, comma-separated, for which the existing environment value takes precedence; "true" preserves all existing values. Default: `false`. |
| `-p, --project string`         | Project name.                                                                                                                                        |
| `--scope string`               | Directory to scope configuration. Default: `.`.                                                                                                      |
| `--watch`                      | Automatically restart the process when secrets change.                                                                                               |

Also accepts the flags of [`tuna secrets`](https://tuna.am/en/docs/cli/secrets.md).

## Subcommands

| Command                                                                      | Description                |
| ---------------------------------------------------------------------------- | -------------------------- |
| [`tuna secrets run clean`](https://tuna.am/en/docs/cli/secrets/run/clean.md) | Delete old fallback files. |

[Global flags](https://tuna.am/en/docs/cli.md#global-flags) work too.

## History

|        |                                                                                                                                                                                                                                                                                                                                                                                         |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 0.35.0 | Added the `--command`, `--fallback`, `--fallback-only`, `--fallback-passphrase`, `--fallback-readonly`, `--forward-signals`, `--mount`, `--mount-format`, `--mount-max-reads`, `--mount-template`, `--name-transformer`, `--no-fallback`, `--offline`, `--only-secrets` and `--preserve-env` flags.<br />Added the [`clean`](https://tuna.am/en/docs/cli/secrets/run/clean.md) command. |
| 0.24.0 | Command added.                                                                                                                                                                                                                                                                                                                                                                          |
