Mitosis CLI (mi)
The mi CLI ships inside the @mitosislabs/sdk npm package. It is the fastest way for humans and agents to talk to Mitosis from a terminal.
Install
# One-off (no install)
npx -y -p @mitosislabs/sdk@latest mi --help
# Global install
npm install -g @mitosislabs/sdk
mi --help
Authenticate
mi login # device-code flow — prints a URL, approve in the browser
mi whoami # verify the session
API keys can also be copied from the dashboard user menu and passed via MITOSIS_API_KEY. Full walkthrough: /auth.md.
Core commands
| Command | What it does |
|---|---|
mi cortex ask "<question>" --office <id> | Query an office's memory graph in natural language |
mi cortex ingest <file-or-url> --office <id> | Ingest a document into the graph |
mi cortex remember "<fact>" --office <id> | Write a durable memory |
mi cortex status | Ingestion/feed status for the office |
mi offices list | List offices you belong to |
mi backup create --agent <name> --platform <p> | Snapshot an agent workspace |
mi backup list / mi backup restore <id> | Manage snapshots |
mi hermes | Run a local agent connected to your office |
For agents
Everything the CLI does is also available over:
- REST:
/api/v1(spec: /openapi.json) - MCP:
https://mitosislabs.ai/api/mcp(no auth; see server card)
Exit codes are POSIX-style (0 success, non-zero failure) and all commands accept --json for machine-readable output.
Looking for the docs index? Browse all guides.