Skip to content

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.

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

Every command accepts these:

FlagTypeDefaultDescription
--rootstringproject 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.

CommandWhat it does
ctx activityShow recent push/pull activity on the current repo
ctx authAuthentication management
ctx auth loginAuthenticate with a Contexo server
ctx auth statusShow authentication status
ctx captureCapture utilities for the agent-reasoning buffer
ctx capture statusShow pending capture buffers
ctx detachReverse `ctx init` — remove Contexo wiring (and, by default, the .contexo/ directory)
ctx diffShow the structured diff between two versions of a page
ctx evolutionShow the full evolution of a page: each commit + what it changed
ctx generateSeed a Contexo knowledge base from the codebase (via Graphify)
ctx historyShow the commit timeline for a single page
ctx hooksManage the Contexo capture hook (Claude Code, Codex)
ctx hooks installInstall the Contexo capture hook for an agent (claude|codex|all)
ctx hooks statusShow whether the Contexo capture hook is installed per agent
ctx hooks uninstallRemove the Contexo capture hook for an agent (claude|codex|all)
ctx initInitialize .contexo knowledge directory
ctx inviteManage repo invite keys
ctx invite listList active invite keys on the current repo
ctx invite mintMint a new invite key for the current repo
ctx invite revokeRevoke an invite key by id
ctx joinJoin an existing Contexo repo using an invite key
ctx logShow the server's commit timeline (who changed what when)
ctx loginAuthenticate with a Contexo server (alias for `ctx auth login`)
ctx mcpRun the MCP server over stdio against the local .contexo/
ctx mcp guideHow to add Contexo to other agents/harnesses (Windsurf, OpenCode, Hermes, OpenClaw, ...)
ctx mcp installWire the Contexo MCP server into an agent's config (claude|cursor|codex|all)
ctx mcp statusShow agent integrations for this project (MCP + capture hook)
ctx mcp uninstallRemove the Contexo MCP server from an agent's config (claude|cursor|codex|all)
ctx membersList and manage who can access the current repo
ctx members removeRemove a member from the current repo (owner only)
ctx migrateBulk-import an existing knowledge base into Contexo
ctx pullPull new pages from the server into .contexo/
ctx pushPush local .contexo pages to the server
ctx remoteConfigure the Contexo server URL and repo ID
ctx remote getShow the configured server URL and repo
ctx remote setSet the Contexo server URL
ctx remote set-repoSet the repo_id for this project (interactive picker if omitted)
ctx statusShow .contexo status and local-vs-server delta
ctx updateUpdate ctx to the latest release
ctx versionPrint the ctx version