# CommandAGI, for agents

<!-- Written by scripts/sites/front-door.mjs from sites/pages/docs/foundations/quickstart/en.md, sites/pages/docs/reference/sdk-and-mcp/en.md, sites/pages/docs/operations/threads-and-grants/en.md, deployments/clients/host/package.json and global/simulations/eval-reach/eval-reach.3d.tsx. Do not edit: edit those. -->

> CommandAGI is building the infrastructure to make anything happen, from software and machines to entire organizations. What we are building, why, and what we believe.

This page is for an AI agent that a person sent here (https://commandagi.com/agents.md). It says what CommandAGI is, how to connect to it over MCP or its command line, the first world to write, and the rule for acting on real machines. The docs are at https://commandagi.com/docs; a short index for models is at https://commandagi.com/llms.txt.

## What CommandAGI is

CommandAGI is one workbench and plain-file platform where people and agents handle everyday work, design hardware, simulate physics, and run real machines. Everything rests on five shared primitives:

- **Plain files and Drives.** Every document, device definition, world, run, and setting is a plain file in a Drive folder (`cloud://home/<account>/…`, `local://<host>/<drive>/…`, or browser storage). There is no hidden database or proprietary bundle.
- **Devices and channels.** A device definition (`definition.tsx`) describes any machine, robot, computer, phone, camera, or instrument as named **channels** — a G-code line, a servo bus, RTDE/FCI/ROS 2, a browser tab, a shell, or video/audio streams.
- **Designs vs worlds.** A **design** (`.3d.tsx`, `.study.tsx`, `.sch.tsx`, `.pcb.tsx`, `.opportunity.tsx`) models what you build and simulates safely without touching hardware. A **world** (`world.tsx`) places **units** against real equipment and keeps a simulated twin beside physical reality.
- **Runs, threads, and streams.** Every hardware session, simulation, and multi-agent **thread** records into a `runs/<run>/` folder beside the file it belongs to — keeping channel streams, chat messages, and participants (`members.jsonl`) on one synchronized clock.
- **Standing grants.** Agents and people act on physical hardware, money, shipping, outreach, markets, local Python execution, or gated folders only inside an explicit, recorded **standing grant** ([Threads & standing grants](https://commandagi.com/docs/operations/threads-and-grants)).

## Connect over MCP

### The hosted server

`https://api.commandagi.com/mcp` speaks Streamable HTTP with stateless JSON responses. OAuth 2.0 PKCE clients discover authorization metadata automatically from the `401` challenge (add the URL directly and sign in via `/mcp` in Claude Code or `codex mcp add commandagi --url https://api.commandagi.com/mcp`), or pass a bearer API key (`cagi_…`):

```sh
claude mcp add --transport http commandagi https://api.commandagi.com/mcp \
  --header "Authorization: Bearer cagi_YOUR_KEY"
```

### The local relay, for machines on your person's computer

On machines running `@commandagi/host` or the desktop app, `commandagi mcp` serves a stdio MCP relay over loopback (`POST /control/<tool>` also accepts `Authorization: Bearer <credential>` directly and blocks browser origins). Pass `cagp_…` credentials via `COMMANDAGI_CREDENTIAL` or `--credential-file` — never inline as CLI flags:

```sh
claude mcp add commandagi -e COMMANDAGI_CREDENTIAL=cagp_… -- commandagi mcp
# or load cleanly from a file
claude mcp add commandagi -- commandagi mcp \
  --credential-file ~/.config/claude/commandagi.credential
```

## Install the command line

The `commandagi` command and this computer's host are one npm package, `@commandagi/host`. It is the CommandAGI local host and the commandagi command: the workbench, the files and devices of this computer, the MCP host, the 3D design service and the link to your account.

```sh
npm install -g @commandagi/host
commandagi whoami
```

## Write your first world

A world is code: one `world.tsx` that declares a `<world>`, the same file the workbench's editors write back to. This is `cloud://home/user-commandagi/global/simulations/eval-reach/eval-reach.3d.tsx`, a simulation the engine steps as it is. Open it: https://app.commandagi.com/?open=%2Ffile%3Fpath%3Dcloud%3A%2F%2Fhome%2Fuser-commandagi%2Fglobal%2Fsimulations%2Feval-reach%2Feval-reach.3d.tsx

```tsx
// eval-reach: a design in code: the units it places and the scene the simulator steps (docs/formats.md § a 3D document's units). Its runs are simulated.
export default () => (
  <part name="Eval: reach">
    <slot
      name="description"
      value="The reach grading fixture: an SO-101 arm on a bench and a target marker its tool point must come within 2 cm of."
    />
    <slot
      name="scene"
      value={{
        hz: 240,
        record_hz: 30,
        robots: [
          {
            id: "arm",
            device: "../../devices/so101-follower-arm/definition.tsx",
            at: [0, -0.049, 0.76],
            joints: {
              shoulder_pan: 0,
              shoulder_lift: 0.5399612373357457,
              elbow_flex: 0,
              wrist_flex: 0,
              wrist_roll: 0,
              gripper: 1.745329,
            },
          },
        ],
        bodies: [
          {
            id: "ground",
            shape: { type: "box", hx: 3, hy: 3, hz: 0.1 },
            at: [0, 0, -0.1],
            type: "fixed",
            friction: 0.8,
            color: [0.32, 0.36, 0.34],
          },
          {
            id: "bench",
            shape: { type: "box", hx: 0.6, hy: 0.4, hz: 0.02 },
            at: [0, 0, 0.74],
            type: "fixed",
            friction: 0.7,
            color: [0.55, 0.45, 0.35],
          },
          {
            id: "target",
            shape: { type: "sphere", r: 0.01 },
            at: [0.08, -0.12, 0.86],
            type: "fixed",
            sensor: true,
            color: [0.9, 0.2, 0.2],
          },
        ],
      }}
    />
  </part>
);
```

## The grant rule

A **standing grant** is authority conferred on one principal by an explicit act of another principal with authority on the account. People carry no hidden privilege exception over agents: identical identity, scope, and rate validations apply to both.

**Safing is always allowed.** `stop`, `disarm`, and `close` — plus equipment safing commands such as feed hold, emergency stop, torque off, and cancelling a resting market order — remain open to anyone holding an unexpired grant on the unit, the session opener, and the account owner. `commandagi unit stop --world <world> --unit <uid>` sends the safing command to every open channel and stops running agents on that unit.

Grants apply to worlds, which name real machines. A design (a `.3d.tsx`) and a world's twin are simulated, and need none.

Every action follows these rules:

- **Recorded before it is sent.** Before any driver executes, an entry naming the principal and the command is appended to the run stream and flushed. A read-only Drive or folder refuses the action rather than acting off the record.
- **An acknowledgement is not a state.** Returning `ok` or HTTP `200` never implies the commanded physical state was reached; state stays pending until the device reports back.
- **Unknown stays unknown.** Dropped sockets record `state: unknown`, and streams ending without an explicit close banner render as *interrupted: state unknown*.
- **No silent retries.** The platform never silently retries physical commands, transfers, shipments, or market orders.
- **Bounds live in the driver.** Soft limits, workspace bounds, intervals, and rate pacing (at least `30 ms` between discrete inputs) are enforced below the agent inside the driver.
- **Simulated and physical never mix.** A run's `reality` (`simulation` or `physical`) is immutable, and simulated runs never count as physical commissioning evidence.

## Keep this as a skill

One command installs `SKILL.md` into Claude Code, Codex, Cursor, and compatible Agent Skills clients:

```sh
npx skills add https://commandagi.com
```

## Read next

- [Quickstart](https://commandagi.com/docs/foundations/quickstart): Five-minute end-to-end walkthrough of CommandAGI — guest browser workbench, CLI setup, agent threads, verified physics runs, and bridging a local host.
- [Architecture](https://commandagi.com/docs/foundations/architecture): CommandAGI's core ontology — plain-file Drives, worlds vs designs, devices with channels, append-only runs and Merkle seals, threads, and zero-ambient-authority grants.
- [Files & formats](https://commandagi.com/docs/foundations/files-and-formats): Complete taxonomy of plain-code documents in TypeScript, Python, and Rust (.3d.tsx, .study.tsx, .opportunity.tsx, .vid.tsx, .graph.json, .company.tsx, .flow.tsx, .firmware.tsx, .eval.tsx, .release.tsx, .testplan.tsx), devices, worlds, runs, and settings.
- [CAD, FEA & studies](https://commandagi.com/docs/engineering/cad-and-studies): Parametric 3D B-rep CAD in code, CalculiX C3D10 structural FEA and bisection sweeps, engineering drawings, DFM, CAM/slicing, CFD, KiCad PCB/EMI, and 3D ray tracing.
- [Worlds & physics](https://commandagi.com/docs/engineering/worlds-and-physics): 240 Hz Rapier proving grounds, multi-robot collision enforcement, whole-facility digital twins, the Matrix 3D Earth, and Geoeconomics conserved flow and shock simulations.
- [Threads & standing grants](https://commandagi.com/docs/operations/threads-and-grants): Multi-agent threads, human approval barriers, all seven standing grant kinds, all four principal forms, safing guarantees, and supervising local AI CLIs.
- [Automation & opportunities](https://commandagi.com/docs/operations/automation-and-opportunities): Computer-use skill chains across Linux/macOS/Windows/iOS/Android/CDP, communications (mail, phone, postal, calendar), company operating folders, and evidence-graded Opportunities.
- [Robotics](https://commandagi.com/docs/hardware/robotics): Real-robot control (Franka FCI, Unitree G1/Z1 SDK2, UR RTDE, xArm, SO-101, OpenArm 2.0, ROS 2), twin-vs-real trajectories, finetune, skill libraries, diagnose, and the physical-vs-twin boundary.
- [Local host & drivers](https://commandagi.com/docs/hardware/local-host): One local host per machine (`127.0.0.1:4173`), ~/.commandagi files, host pairing, WebSerial/BLE page drivers, hardware interlocks, Drive sync, all 74 drivers and 12 simulators, and local workerd.
- [CLI reference](https://commandagi.com/docs/reference/cli): Complete commandagi CLI command-family reference — daemon hosting, local workerd platform, agents and threads, robotics, 3D CAD, FEA/CFD, KiCad EDA, verification, drives, and hosting.
- [SDKs & MCP](https://commandagi.com/docs/reference/sdk-and-mcp): Agent Skills SKILL.md, the 453-tool hosted MCP server, the 190-tool local MCP relay, OAuth 2.0 PKCE, and TypeScript, Python (+ Gym/LeRobot), and Rust parity SDKs.
- [HTTP API & streams](https://commandagi.com/docs/reference/api): Cloud and local workerd base URLs, API key and OAuth 2.0 auth, ETag concurrency, NDJSON/WebSocket thread and run streams, endpoint groups, models, and 422/428/503 semantics.
