Mitosis Docs

Mitosis CLI (mi)

Install, authenticate, and use the mi CLI: cortex ask/ingest, offices, backups.

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

CommandWhat 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 statusIngestion/feed status for the office
mi offices listList 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 hermesRun a local agent connected to your office

For agents

Everything the CLI does is also available over:

Exit codes are POSIX-style (0 success, non-zero failure) and all commands accept --json for machine-readable output.