Skip to content

CLI Reference

The Contox CLI (contox) is the universal command-line interface for managing your AI project memory. It works with any AI coding tool and provides full control over your project's knowledge base.

Package information

FieldValue
npm packagecontox-cli
Binary namecontox
Installnpm install -g contox-cli

Commands at a glance

Authentication and setup

CommandDescription
loginStore your API key in the global config file
whoamiShow current authentication status and config details
initInitialize a project by creating .contox.json and updating CLAUDE.md

Memory operations

CommandDescription
memoryLoad the full project memory via the V2 brain
saveSave session work into categorized sub-contexts
contextBuild a focused context pack via V2 semantic search

Codebase and sync

CommandDescription
scanScan your codebase and generate hierarchical sub-contexts
pushPush local files as contexts to the Contox platform
pullPull contexts from the platform to local markdown files
statusShow a table of contexts with their sync status
exportExport your brain to Cursor Rules, Copilot instructions, or markdown

Monitoring and operations

CommandDescription
oncallView operational summary: recent sessions, stale drafts, bugs, brain health
explainDeep-dive into any brain schema key with metadata, links, and entries
approveFlush the daemon and show brain stats
hygieneAnalyze and clean up memory items with a two-phase review workflow

Session capture

CommandDescription
daemonManage the background daemon for auto-capture
collectCollect session evidence and send to the V2 ingest pipeline

Global behavior

All commands that interact with the Contox API require authentication. Run contox login first to store your API key, then contox init inside your project directory to link it to a Contox project.

Configuration is resolved in the following order of precedence:

  1. Command-line flags (highest priority)
  2. Environment variables (CONTOX_API_KEY, CONTOX_API_URL, CONTOX_TEAM_ID, CONTOX_PROJECT_ID)
  3. Project config (.contox.json in current directory)
  4. Global config (~/.contoxrc)

See Configuration for full details.