Skip to content

CLI Overview ​

ctxo is both a Model Context Protocol (MCP) server and a CLI. Running ctxo with no arguments starts the stdio MCP server; any other argument dispatches to a subcommand.

Command summary ​

CommandPurpose
ctxo installInstall language plugins (auto-detects if omitted)
ctxo initInteractive setup: AI tool rules, git hooks, plugin install
ctxo indexBuild the codebase index (symbols, edges, history)
ctxo watchFile watcher for incremental re-indexing
ctxo syncRebuild the SQLite cache from committed JSON
ctxo statusShow index manifest, symbol counts, per-file freshness
ctxo doctorHealth check every subsystem (with optional --fix)
ctxo visualizeGenerate an interactive dependency graph HTML
ctxo verify-indexCI gate: fail if index drifts from source
ctxo statsShow MCP usage statistics (--json, --days N, --clear)
ctxo versionVerbose version report (--json, --short)
ctxo --helpPrint compact help

Global flags ​

FlagMeaning
--version, -v, -VPrint core version. Combine with --verbose or --json
--help, -hPrint the bundled help block

Debug output

Every subcommand honors DEBUG=ctxo:*. Narrow the namespace (for example DEBUG=ctxo:git,ctxo:storage) when you only want to see one subsystem.

Exit codes ​

Most commands exit 0 on success and 1 on failure. Two commands have richer semantics:

CommandExitMeaning
ctxo index --check0Index up to date
ctxo index --check1Stale or missing files β€” run ctxo index
ctxo doctor0All checks passed
ctxo doctor1One or more checks failed
ctxo doctor --fix2Remediation halted before completing

Released under the MIT License.