# Copy-paste setup

> Give your agent one line. It installs metro, sets up your key file, and stops for you at every step that needs a human.

Source: https://metrocli.com/docs/agents/copy-paste-setup/ · Docs index: https://metrocli.com/llms.txt

Paste this into Claude Code, Codex, Cursor, or any agent with a terminal:

```text
set up metro - https://metrocli.com/llms.txt
```

The link is a brief written for the agent: the safety contract first, then setup steps, then how to report back. A human still does one thing: create the Metronome API token and paste it into a file. The agent does the rest.

## What your agent will do

**Install metro.**

```bash
git clone --depth 1 https://github.com/metrocli/metro.git ~/.metro/src && bash ~/.metro/src/scripts/install-global.sh
```

Once npm publishing is live, `npm install -g @metrocli/metro` does the same.

**Create your key file.** It runs `metro init --agent`, which never prompts. That creates `~/.metro/.env` (mode 600) with empty placeholders, copies the manual to `~/.metro/AGENTS.md`, and leaves metro read-only.

**Ask you to paste your sandbox key into the file.** It relays the three steps `metro init --agent` printed: open [the sandbox token page](https://app.metronome.com/sandbox/developer/api-tokens), create a token, paste it into `~/.metro/.env` after `METRONOME_SANDBOX_KEY=` in your editor, and say "done".

**Check the key with a read-only call.** It runs `metro init --check --json` and continues only when `keys.sandbox.status` is `working`. Otherwise it relays the `next` field to you, word for word, and waits.

**Learn your catalog.** It reads `~/.metro/AGENTS.md`, then runs `metro status --json`, `metro catalog bind --sandbox --write` and `metro tenant snapshot show --sandbox --markdown`.

**Report a doorway.** One line saying what you can now do, then exactly three next actions you can say yes to, based on your tenant. For example: bind the catalog, look up your largest customer, or preview one pricing change on sandbox with nothing applied.

When you ask for a change, the agent previews it, shows you the plain-English change and the `payloadHash`, waits for your yes, applies, and shows the readback. See the [safety contract](/docs/agents/safety-contract).

> **Never paste keys into chat.** The agent will never ask for a key in chat. If you paste one anyway, it won't repeat it, and it will ask you to revoke that token and create a new one. Keys belong in `~/.metro/.env`, which you edit yourself.

## Notes per agent

**Claude Code**

Paste the line into a Claude Code session in any folder. Claude Code runs the install and `metro init --agent` in its terminal, then pauses for you to edit `~/.metro/.env`. If it asks permission to run `git`, `bash` or `metro`, approve those. Opening `.env` for you is not needed; you edit it yourself.

**Codex**

Codex runs in a sandbox. The install needs network access to `github.com`, and the key check needs `api.metronome.com`. If either is blocked, the brief tells Codex to name the blocked host and stop rather than retry in a loop. Allow network for the session, then paste the line again.

**Cursor**

Use Cursor's agent mode with terminal access. The agent runs the commands in its integrated terminal. Edit `~/.metro/.env` in any editor, including Cursor, then tell the agent "done".

A hosted chat assistant without a terminal can't run metro. The brief tells it to say so and point you to [Install](/docs/install).

## Do it yourself instead

Prefer to set up by hand? It's two commands and `metro init`. See [Install](/docs/install) and [Keys: metro init](/docs/keys).
