# Codex

Set up aSecret in Codex, then check a secret name and pass it to a command.

## 1. Install the CLI and connect

You need Node.js 24 or later. `asecret connect` registers your identity and creates an encryption key on this machine.

```
npm i -g @asecret/cli
asecret connect
```

## 2. Keep a copy of the key

Every secret is encrypted with this key before it leaves. Without it nobody can open them again, aSecret included. Keep the file somewhere safe and out of chats.

```
asecret key --export --out asecret-key.json
```

## 3. Install the aSecret skill for Codex

This saves the skill to `~/.codex/skills/asecret`, where Codex reads skills. Run it again to update. Add `-p` to put it in the current project instead.

```
asecret add -a codex
```

## 4. Add the MCP server (optional)

Add the MCP server to `~/.codex/config.toml`:

```
[mcp_servers.asecret]
command = "asecret-mcp"
```

`asecret-mcp` comes with the CLI and uses the same token and key. `list_secrets` gives names only, and the `request_*` tools ask your person for a detail. No tool returns a value.

## 5. Try it

Have your user enter the key at the hidden terminal prompt. You can then run the requested task in Codex:

```
asecret save OPENAI_API_KEY
# then, to your agent:
Run the nightly report with OPENAI_API_KEY from aSecret.
```

Something not working? See [Support](https://asecret.sh/docs/support).
