Appendix

June 21, 2026 · View on GitHub

Every CLI command lean-ctx exposes, grouped by purpose. Source of truth: rust/src/cli/dispatch/mod.rs. Aliases are shown in parentheses.

Tip: lean-ctx help shows the short list of everyday commands; lean-ctx help all shows the full reference.

Getting started / setup

CommandPurpose
onboardZero-prompt golden path: connect all detected AI tools
setupGuided wizard (full control); flags: --non-interactive, --yes, --fix, --json, --skip-rules, --no-auto-approve
installAlias for setup; install --repair = non-interactive refresh
bootstrapNon-interactive setup + fix (CI/scripts); --json
init --globalInstall shell aliases/hook only
init --agent <name>Configure MCP + rules + skill + hook for one agent
doctorDiagnostics; --fix, --json, integrations
statusQuick "am I connected?"; --json

Daily use

CommandPurpose
-c / exec "cmd"Run a shell command with compressed output (--raw = full)
-t / --track "cmd"Track a command (full output + stats, no compression)
shellInteractive shell with compression
bypass "cmd"Run with zero compression
read <file>Read with compression; -m/--mode, --fresh
diff <a> <b>Compressed file diff
grep <pattern> [path]Search with compressed output
find <pattern> [path]Find files (compressed)
ls [path]Compressed directory map; --depth, -a
deps [path]Show project dependencies
gainToken-savings dashboard; --live, --graph, --daily, --json, --wrapped, --svg, --share, --copy, --open, --publish, --leaderboard, --unpublish, --cost, --tasks, --agents, --heatmap
token-report (report-tokens)Token + memory report; --json
learningAdaptive-learning state: status, export [file], import <file|-> — share learned thresholds + LITM calibration with your team (secret-free, idempotent merge)
introspectCognition v2 activity: cognition (which science subsystems are wired/active, --json), qubo (experimental QUBO-vs-greedy selection benchmark)
discoverFind uncompressed commands in shell history; --card (shareable "before" SVG)
ghostGhost-token report (hidden waste); --json
cheatsheet (cheat)Workflow cheat sheet
dashboardWeb dashboard (localhost:3333); --port, --host

Memory & sessions

CommandPurpose
sessionTasks/findings/decisions + adoption stats: task, finding, decision, save, load, status, reset
sessions (session-store)Manage saved CCP snapshots: list, show, cleanup, doctor
knowledgeProject knowledge: remember, recall, search, export, import, remove, status, health
overview [task]Project overview (task-contextualized)
compressContext-compression checkpoint; --signatures
controlContext field manipulation: exclude/pin/priority
plan <task>Context planning (Phi-scored); --budget
compileContext compilation (knapsack + Boltzmann); --mode, --budget
ledgerContext-ledger: status, reset, evict, prune

Code intelligence

CommandPurpose
graphProperty graph: build, related, impact, symbol, context, status, export-html
smellsCode-smell detection (8 rules): scan, summary, rules, file
visualizeInteractive HTML report (D3); --output, --open
indexIndex utilities: status, build, build-full, build-graph, watch
heatmapContext heatmap; --top, --by
cepCEP impact report (score trends)
benchmarkrun, report, eval, compare

Advanced — network / providers / team / plugins

CommandPurpose
serveMCP over Streamable HTTP; --daemon, --root PATH[:ALIAS] (multi-repo), --rrf-k
proxyAPI proxy: start, stop, status, enable, disable, cleanup
daemonIPC daemon: start, stop, status, enable, disable
providerExternal provider OAuth (Jira): auth, logout, list
teamTeam server (feature-gated): serve, token create, sync
plugin (plugins)list, enable, disable, info, init, hooks
rulesContextOps governance: sync, diff, lint, status, init
packContext Package Manager + PR pack (create, install, export, import, pr, …)
compact [path]Compress agent transcripts
learnLearned gotchas; --apply → AGENTS.md
gotchas (bugs)Bug memory: list, clear, export, stats
buddy (pet)Token Guardian companion
safety-levels (safety)Compression safety-level table

Lifecycle

CommandPurpose
update (--self-update, upgrade)Self-update; --check, --insecure, --skip-rules, --schedule [off|status|notify|<h>h]
stopStop ALL lean-ctx processes (LaunchAgent-safe)
restartRestart daemon (apply config.toml)
dev-installBuild release + atomic install + restart (dev)
uninstallStop processes + remove configs, autostart, data, and the binary; --dry-run, --keep-config, --keep-binary
cacheRead cache: stats, clear, reset, invalidate, prune
hardenHarden native read/grep in MCP configs; --hard, --undo

Tools / profiles / config

CommandPurpose
toolsMCP tool profile: minimal, standard, power, show, list
allowShell allowlist: add/remove commands in shell_allowlist_extra, --list shows the effective allowlist + any parse errors
trust / untrustWorkspace trust: gate a cloned repo's project-local .lean-ctx.toml security overrides; trust status, trust --list
profileContext profiles: list, show, active, diff, create, set
configConfig file: dump, init, set <k> <v>, schema, validate, show, apply
themeTerminal colors: list, set, export, import
terse / compressionCompression level: off, lite, standard, max
filterCustom compression filters: list, validate, init
teeOutput tee logs: list, clear, show, last
slow-logSlow commands: list, clear
statsRaw stats store: summary, reset-cep, json

Cloud

CommandPurpose
login <email>Cloud login
register <email>Create cloud account
forgot-password <email>Password reset email
syncUpload local stats to cloud
contributeShare anonymized compression data
cloudstatus, pull-models

Internal / hidden (used by agents, not for daily use)

CommandPurpose
mcpExplicit stdio MCP server
hook <sub>Agent hook entry points (Cursor/Claude/Copilot/Codex)
auditCompliance report from audit trail
instructionsCompile MCP instructions for a client
export-rulesHigh-confidence knowledge → rules files
proof / verifyContext-proof artifacts
report-issue (report)Open a GitHub issue with diagnostics

Known help-text drift (tracked for cleanup)

The dispatch exposes ~35 commands not yet in lean-ctx help all, including provider, team, heatmap, ledger, control, plan, compile, compact, learn, stats, bypass, safety-levels, and several subcommands (graph export-html, proxy enable/disable, cache prune, full pack actions). These are intentionally advanced/internal but should be surfaced in a future help advanced tier. See Journey 1 UX notes.