Mitosis Labs

CLI

Mitosis CLI

mi: query and manage a memory from a terminal.

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 shell.

Install

npx -y -p @mitosislabs/sdk@latest mi --help
npm install -g @mitosislabs/sdk
mi --help

Authenticate

mi login     # device-code flow, prints a URL to approve in the browser
mi whoami    # verify the session

For headless use, set MI_API_KEY=mi_... with a key from the dashboard user menu; no mi login needed. See authentication.

Commands

CommandWhat it does
mi cortex ask "<question>" --office <id>Query a memory 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 and feed status
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
mi config --office-manager <url>Point the CLI at production or the sandbox backend

Scripting

Every command accepts --json for machine-readable output, and exit codes are POSIX-style (0 on success, non-zero on failure), so mi composes cleanly inside shell pipelines and CI steps.

mi cortex ask "open questions on billing" --office "$OFFICE_ID" --json \
  | jq -r '.citations[]'

The same surface elsewhere

Everything the CLI does is also available over REST and MCP. The CLI is a convenience layer over the same API, not a separate capability set.