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

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli version 0.1.4, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli@0.1.4` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# Secrets

> Give agents that run in your hosted workspace the model provider keys they need, from your shell with ancha secrets, without pasting keys into a form or a file.

Agents that run in your hosted workspace, the ones you start from the console, need their model provider's key. Running your own agent in the workspace is in private beta; see [Hosted workspace](https://docs.ancha.io/cloud/overview.md). You set the key from a shell where it is exported. It never goes through a form or a command argument.

```bash theme={null}
export OPENAI_API_KEY=...        # already in your shell
ancha secrets set OPENAI_API_KEY # or ANTHROPIC_API_KEY, OPENROUTER_API_KEY
ancha secrets list
```

The value is stored on your workspace's disk and given to attempts of agents that declare that provider when you connect them. Setting or removing a variable restarts the workspace's processes; give it a few seconds.

| Command | Does |
| - | - |
| `ancha secrets set NAME...` | Copies each named variable from your shell into the workspace. |
| `ancha secrets list` | Prints the names, never the values. |
| `ancha secrets unset NAME` | Removes one variable. |

Names are upper snake case, up to 64 characters. You must be signed in with `ancha login`, or have `ANCHA_SERVER_URL` and `ANCHA_API_KEY` set. See [`ancha secrets`](https://docs.ancha.io/cli/secrets).

## Which runs use them

| Run | Where the agent gets keys |
| - | - |
| **Run tasks** in the console | Workspace secrets, for agents that declare that provider. |
| `ancha run` on your computer, even when signed in | The names you list in `agent.pass_env` or `--pass-env`, taken from your own shell. Workspace secrets are not used. |
| `ancha run` in CI | The names you pass from the CI job's environment. See [CI](https://docs.ancha.io/cloud/ci.md). |

Model calls are billed by your provider.


## Related topics

- [ancha secrets](https://docs.ancha.io/cli/secrets.md)
- [Troubleshooting](https://docs.ancha.io/troubleshooting.md)
- [Gong](https://docs.ancha.io/tools/gong.md)
- [Clerk](https://docs.ancha.io/tools/clerk.md)
- [Environment variables](https://docs.ancha.io/reference/environment-variables.md)


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