CLI Reference
cortexa-cli is a standalone binary that communicates with a running Cortexa app over its HTTP API. It provides 26 commands with --json available on all structured-output commands.
Configuration
bash
# Set URL and token (from Settings → External)
cortexa-cli config --url http://127.0.0.1:7373 --token <TOKEN>
cortexa-cli config --show
# Or use environment variables
export CORTEXA_URL=http://127.0.0.1:7373
export CORTEXA_TOKEN=<TOKEN>Config file: %APPDATA%\com\cortexa\cortexa-cli\config\cli.json (Windows) or platform equivalent. Env vars override the config file.
Shell Completions
Generate shell completions for your shell:
bash
cortexa-cli completions bash # Bash
cortexa-cli completions zsh # Zsh
cortexa-cli completions fish # Fish
cortexa-cli completions powershell # PowerShellCommands
ingest
bash
cortexa-cli ingest "A new thought"
echo "from stdin" | cortexa-cli ingest --stdincapture
bash
cortexa-cli capture "Architecture decision" \
--thought-type decision \
--agent cli \
--project myapp \
--confidence high \
--tag arch --tag backendsearch
bash
cortexa-cli search "auth middleware" --limit 5
cortexa-cli search "auth middleware" --jsonlist
bash
cortexa-cli list --limit 20 --tag architecture --pinned
cortexa-cli list --session-id <uuid>
cortexa-cli list --include-archived
cortexa-cli list --jsonget
bash
cortexa-cli get <item-id>
cortexa-cli get <item-id> --jsoncontext
bash
cortexa-cli context "fixing the thesis parser" \
--project Cortexa \
--file src-tauri/src/agent/handlers.rs \
--limit 10
cortexa-cli context "auth bugs" --jsonsync-context
Generate .cortexa-context.md in a project directory.
bash
cortexa-cli sync-context MyProject --dir /path/to/project
# Output: Synced 15 items → /path/to/project/.cortexa-context.mdthink
bash
cortexa-cli think <item-id>brief
bash
cortexa-cli brief <item-id>
cortexa-cli brief <item-id> --jsonorchestrate
bash
cortexa-cli orchestrate <item-id>
cortexa-cli orchestrate <item-id> --jsontools
bash
cortexa-cli tools
cortexa-cli tools --jsonrun-tool
bash
cortexa-cli run-tool decompose <item-id>
cortexa-cli run-tool apply_lens <item-id> --params '{"lens": "pre-mortem"}'confidence-history
bash
cortexa-cli confidence-history <item-id>
cortexa-cli confidence-history <item-id> --jsonpeer-profiles
bash
cortexa-cli peer-profiles
cortexa-cli peer-profiles --jsonlearned-procedures
bash
cortexa-cli learned-procedures
cortexa-cli learned-procedures --thought-type decision --jsontool-metrics
bash
cortexa-cli tool-metrics
cortexa-cli tool-metrics --jsonreflection
bash
cortexa-cli reflectionpublications
bash
cortexa-cli publications
cortexa-cli publications --jsoncompletions
bash
cortexa-cli completions <shell>ping
bash
cortexa-cli pingBuilding
bash
cargo build -p cortexa-cli --release
# Binary: target/release/cortexa-cli