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

# Removing secrets

> Remove unused secrets from the active Capy branch and sync the change.

Run these commands from your Capy-managed project. Check the active secret branch and its variable names first:

```bash theme={null}
capy branch
capy list
```

## Remove a value

```bash theme={null}
capy remove OLD_API_KEY
```

Capy asks you to confirm before removing the value from the active branch. On success, it updates `.env`, `keep.lock`, and the remote branch. You do not need a separate `capy push`.

To remove several values together:

```bash theme={null}
capy remove OLD_API_KEY LEGACY_TOKEN
```

Every supplied name must exist on the active branch. If a value being removed has an unpushed local edit, Capy refuses rather than silently discarding it. Resolve that edit with [`capy`](/docs/using/syncing-secrets) or push the intended value, then retry the removal.

## Remove without a prompt

For an already-approved automated operation, explicitly pass `--yes`:

```bash theme={null}
capy remove OLD_API_KEY --yes --json
```

`--json` and non-interactive execution require `--yes`; they do not implicitly approve deletion.

## Finish the change

Run `capy list` again to check the active branch, then review and commit the `keep.lock` changes. Update application code or configuration that still expects the removed variable.

Removing a value from Capy does not revoke the credential at its provider or erase copies already held by running processes or deployment targets. Revoke the provider credential separately when it should no longer work, and update affected deployments.

`capy remove` requires a cloud or BYOC project; it is unavailable in local-only mode.

## See also

* [`capy remove` reference](/docs/cli/remove) — all options
* [Adding secrets](/docs/using/adding-secrets) — add new values
* [Syncing secrets](/docs/using/syncing-secrets) — resolve local and remote changes


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