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

# Use the Circuit CLI from a coding agent

> Steps for Claude Code, Cursor, Codex and other coding agents: install the Circuit CLI, scaffold and check an agent, and hand passkey sign-in to the account owner.

A coding agent such as Claude Code, Cursor or Codex can install the Circuit CLI, write an agent and check it without a Circuit account. Sign-in needs the account owner's passkey in a browser. Add the docs MCP server to Claude Code with `claude mcp add circuit --transport http https://docs.circuit.org/mcp`, or read [capabilities.json](https://api.circuit.org/dev/capabilities.json) and [sdk.d.ts](https://api.circuit.org/dev/sdk.d.ts) directly without installing the CLI; other tools read [llms.txt](https://docs.circuit.org/llms.txt), [llms-full.txt](https://docs.circuit.org/llms-full.txt), or any page URL with `.md`.

### Install the CLI and scaffold an agent

```bash theme={"theme":"nord"}
curl -fsSL https://api.circuit.org/dev | bash
export PATH="$HOME/.local/bin:$PATH" && circuit new --name agent-name && cd agent-name && circuit check --json
```

The installer puts one `circuit` binary in `~/.local/bin`; each new shell needs that directory on `PATH` (see [installation](https://docs.circuit.org/agent-developers/getting-started/installation.md)). Agent code imports from `circuit:sdk`, supplied by the CLI locally and the runtime when hosted — never install an SDK from npm (the `circuit-sdk` package is unrelated). `circuit new` writes `index.ts`, `circuit.toml`, `DESCRIPTION.md`, and `AGENTS.md` with Circuit's venue and SDK rules. Run `circuit check` after each edit: it refreshes `circuit-sdk.d.ts`, prints `{"valid":true}` on pass, or prints `"valid":false` and exits 1. Neither `circuit new` nor `circuit check` requires sign-in.

### Hand sign-in to the account owner

`circuit run`, `circuit backtest`, `circuit data` and `circuit upload` need sign-in. Run `CIRCUIT_OPEN_BROWSER=false circuit auth login` so that the CLI does not open a browser on the agent's machine. Give the link that the CLI prints (`Authorize this CLI at <link>`) to the account owner, who approves it with a passkey while the CLI waits; see [authentication](https://docs.circuit.org/agent-developers/cli-references/authentication.md#sign-in). In CI, set `CIRCUIT_TOKEN` to the output of `circuit auth token`. An assistant that only reads the account and proposes changes signs in with `circuit auth login --assistant "<name>"`; see [assistants](https://docs.circuit.org/agent-developers/cli-references/assistants.md).

> [accordion] Copy setup prompt for a personal assistant
>
> ```text Copy setup prompt theme={"theme":"nord"}
> Connect to my Circuit account as my assistant.
>
> 1. Install the Circuit CLI: curl -fsSL https://api.circuit.org/dev | bash
> 2. Log in with --assistant and your own name. Without --assistant the CLI logs in as me, not as you:
>    ~/.local/bin/circuit auth login --assistant "<your name>"
>    Send me the authorization link and keep the command running while I approve it with my passkey. Set CIRCUIT_ASSISTANT="<your name>" for every subsequent Circuit command.
> 3. Follow https://docs.circuit.org/agent-developers/cli-references/assistants for every task:
>    - Read my account first with ~/.local/bin/circuit: wallet holdings, agent list, agent get <id>, agent sessions, agent session <id>, operations get <id>, and data
>    - Propose wallet swaps, transfers, or lending as a nonempty JSON array whose elements each match ~/.local/bin/circuit capabilities --resource ask/review with no free-text message or attachments: ~/.local/bin/circuit ask --proposals <file> (- for stdin); withdraw unapproved proposals with ~/.local/bin/circuit operations cancel <operation-id>
>
> You can read my account and propose money operations. You cannot approve, trade or move funds; I confirm every proposal in Circuit.
> ```


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