CLI Reference
serve & compile
Run the engine daemon and turn directories into claims.
root serve
Starts the REST API + MCP server — the daemon the Console and AI tools talk to.
root serve --port 31760 --host 127.0.0.1| Flag | Default | Purpose |
|---|---|---|
--port <PORT> | 31760 | Port to bind (Cortex Protocol canonical port) |
--host <HOST> | 127.0.0.1 | Host to bind |
--api-key <KEY> | — | Enable bearer auth (compared in constant time) |
--path <PATH> | — | Mount a workspace by path (repeatable) |
--name <NAME> | — | Mount a single workspace by registry name |
--branch <BRANCH> | — | Serve a specific branch instead of main |
--mcp-stdio | off | Run as an MCP stdio server (no HTTP) |
--no-rest / --no-mcp | off | Disable one of the two surfaces |
--install-service | off | Install an OS service file (launchd/systemd/Windows) |
This is what the cloud runs
Each cloud project runs root serve in its own container with a unique
--api-key that the gateway injects. Self-hosting is the same command — see
Cloud vs Self-host.
root compile
Compiles a directory through the knowledge pipeline into claims.
root compile ./docs # compile a directory
root ./docs # shorthand for the above
root compile ./docs --watch # recompile on changes| Flag | Default | Purpose |
|---|---|---|
--branch <NAME> | main | Compile into a specific branch |
--watch | off | Stay running and recompile on file changes |
--debounce <MS> | 200 | Debounce window for --watch |
--no-incremental | off | Force a full pipeline (ignore incremental cutoffs) |
--json | off | Emit the run summary as one line of JSON (pipe to jq) |
--cloud | off | Offload compilation to ThinkingRoot Cloud (requires root login) |
Asking and searching
root ask "what depends on the billing service?" # grounded, cited answer
root query "rate limiting" # raw retrieval
root status # current branch + workspace
root health # knowledge health score