CLI reference
ctx is the Contexo command-line tool. It manages a per-project knowledge base
under .contexo/, syncs it with a Contexo server, and wires your AI agent into
both.
This reference is generated against ctx 0.6.5 — every flag table on these pages is rendered from the shipped binary’s own command tree, so it cannot describe a flag that doesn’t exist.
How the reference is organised
Section titled “How the reference is organised”One page per top-level command. Commands that have subcommands (ctx mcp,
ctx remote, ctx invite, ctx hooks, ctx capture, ctx members,
ctx auth) document each subcommand as a section on the parent’s page.
| Group | Commands | Start with |
|---|---|---|
| Setup | init, detach, login, join, remote |
ctx init |
| Sync | push, pull, status, log |
ctx push |
| History | history, diff, evolution |
ctx diff |
| Agents | mcp, hooks, capture |
ctx mcp |
| Team | invite, members, activity |
ctx invite |
| Onboarding | migrate, generate |
ctx migrate |
| Maintenance | update, version |
ctx update |
Global flags
Section titled “Global flags”Every command accepts these:
| Flag | Type | Default | Description |
|---|---|---|---|
--root | string | project root directory (default: current directory) |
Plus the conventions cobra gives every command: --help on any command or
subcommand prints its usage, and ctx --version prints the installed version.
See Global flags and environment for the environment
variables ctx reads.
Every command
Section titled “Every command”| Command | What it does |
|---|---|
ctx activity | Show recent push/pull activity on the current repo |
ctx auth | Authentication management |
ctx auth login | Authenticate with a Contexo server |
ctx auth status | Show authentication status |
ctx capture | Capture utilities for the agent-reasoning buffer |
ctx capture status | Show pending capture buffers |
ctx detach | Reverse `ctx init` — remove Contexo wiring (and, by default, the .contexo/ directory) |
ctx diff | Show the structured diff between two versions of a page |
ctx evolution | Show the full evolution of a page: each commit + what it changed |
ctx generate | Seed a Contexo knowledge base from the codebase (via Graphify) |
ctx history | Show the commit timeline for a single page |
ctx hooks | Manage the Contexo capture hook (Claude Code, Codex) |
ctx hooks install | Install the Contexo capture hook for an agent (claude|codex|all) |
ctx hooks status | Show whether the Contexo capture hook is installed per agent |
ctx hooks uninstall | Remove the Contexo capture hook for an agent (claude|codex|all) |
ctx init | Initialize .contexo knowledge directory |
ctx invite | Manage repo invite keys |
ctx invite list | List active invite keys on the current repo |
ctx invite mint | Mint a new invite key for the current repo |
ctx invite revoke | Revoke an invite key by id |
ctx join | Join an existing Contexo repo using an invite key |
ctx log | Show the server's commit timeline (who changed what when) |
ctx login | Authenticate with a Contexo server (alias for `ctx auth login`) |
ctx mcp | Run the MCP server over stdio against the local .contexo/ |
ctx mcp guide | How to add Contexo to other agents/harnesses (Windsurf, OpenCode, Hermes, OpenClaw, ...) |
ctx mcp install | Wire the Contexo MCP server into an agent's config (claude|cursor|codex|all) |
ctx mcp status | Show agent integrations for this project (MCP + capture hook) |
ctx mcp uninstall | Remove the Contexo MCP server from an agent's config (claude|cursor|codex|all) |
ctx members | List and manage who can access the current repo |
ctx members remove | Remove a member from the current repo (owner only) |
ctx migrate | Bulk-import an existing knowledge base into Contexo |
ctx pull | Pull new pages from the server into .contexo/ |
ctx push | Push local .contexo pages to the server |
ctx remote | Configure the Contexo server URL and repo ID |
ctx remote get | Show the configured server URL and repo |
ctx remote set | Set the Contexo server URL |
ctx remote set-repo | Set the repo_id for this project (interactive picker if omitted) |
ctx status | Show .contexo status and local-vs-server delta |
ctx update | Update ctx to the latest release |
ctx version | Print the ctx version |
