> ## Documentation Index
> Fetch the complete documentation index at: https://capy.sc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# capy add: Add Secrets

> Add one or more secret values, either interactively or from a value piped on standard input.

## Synopsis

```bash theme={null}
capy add API_KEY
capy add API_KEY DATABASE_URL --web
command-that-prints-a-value | capy add API_KEY --json
```

## Description

`capy add` records a new value for each supplied environment-variable name. In a terminal it prompts for the values. With `--web`, it collects them in a local browser page. It writes encrypted values to `.env` and syncs them to the active secret branch by default.

When standard input is piped and `--web` is absent, `capy add` accepts exactly one variable name and reads its value from standard input. This is the safe non-interactive form because the secret is not part of the command line. An existing name requires `--force` in piped mode.

Use `--no-push` to update `.env` without syncing. `--non-tty` without piped input or `--web` refuses because there is no value source to prompt from.

## Flags

| Flag | Description |
| - | - |
| `--reason <text>` | Short note shown on the browser intake page. |
| `--help-url <NAME=URL>` | Per-variable link shown in browser intake. Repeat the option for more variables. |
| `--no-open` | Do not automatically open the browser for `--web`; print its URL instead. |
| `--no-push` | Write `.env` only. |
| `-f, --force` | Overwrite an existing value without prompting. |
| `--non-tty` | Never prompt. Use `--web` or pipe a single value. |
| `--json` | Emit machine-readable output for piped input. |

## See also

* [`capy edit`](/docs/cli/edit)
* [`capy remove`](/docs/cli/remove)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.