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

# CLI

> Pair Claude Code, Cursor, Codex, Cline, and other terminal-capable agents.

For agents with shell access. One package, one pairing flow, one config file.

## Option 1: ask the agent to pair itself

Paste this into your agent:

```
Set up SAULT for paid HTTP requests.

1. Run: npx -y @sault.ai/cli@latest login
2. Show me the approveUrl and verificationCode it prints to stderr.
3. Wait — the command long-polls. I will approve in the browser.
4. Once it returns success, read the manual: npx -y @sault.ai/cli@latest skill
   and save it to this project's rules file.
```

The CLI mints an agent key, writes it to `~/.sault/config.json` (mode `0600`), and stays paired across sessions.

## Option 2: run it yourself

```bash theme={null}
npx -y @sault.ai/cli@latest login
```

When the CLI prints an `approveUrl` and a short `verificationCode`, open the URL, sign in at app.sault.ai, and type the verification code from your terminal into the approve page. Approve, and the key is saved.

Verify:

```bash theme={null}
npx -y @sault.ai/cli@latest status
```

## Option 3: paste an existing key

If you already have an agent key from the console:

```bash theme={null}
npx -y @sault.ai/cli@latest pair --key sault_ak_...
```

Skips the browser flow entirely.

## How the agent learns

The CLI ships a `SKILL.md` — a manual written for the model, not the human. It covers the three main scenarios (single paid call, inspecting a service, running a published skill), the JSON envelope every command returns, and the retry / idempotency rules.

Print it:

```bash theme={null}
npx -y @sault.ai/cli@latest skill
```

Save it to your project's agent rules file (`CLAUDE.md`, `.cursor/rules`, etc.) so the manual is in context next session.

## Output shape

Every command emits a JSON envelope on stdout. Prompts (URLs, verification codes, status updates) go to stderr so JSON pipelines stay clean.

```json theme={null}
{ "ok": true,  "data":  { ... } }
{ "ok": false, "error": { "code": "...", "message": "..." } }
```
