pub(super) fn quickstart_text() -> String {
format!(
"lean-ctx {version} — Context Gateway for AI agents
With no arguments, lean-ctx speaks the MCP protocol on stdin/stdout — that is
for your AI editor, not for interactive use. It is doing that right now and
will sit there waiting for JSON-RPC; press Ctrl-C to stop it. You probably
want one of these:
lean-ctx wrap cursor One-command setup for Cursor (recommended)
lean-ctx wrap claude One-command setup for Claude Code
lean-ctx doctor Check that everything is wired up correctly
lean-ctx help Common commands (or `help all` for everything)
Docs: https://leanctx.com
",
version = env!("CARGO_PKG_VERSION"),
)
}
pub(super) fn capability_banner() -> String {
format!(
"{} MCP tools | Select · Control · Learn · Prove (supported paths)",
lean_ctx_server::server::registry::tool_count()
)
}
pub(super) fn print_help_concise() {
print!("{}", concise_help_text());
}
pub(super) fn concise_help_text() -> String {
format!(
"lean-ctx {version} — Context Gateway for AI agents
{banner}
GETTING STARTED:
lean-ctx wrap <agent> One-command setup (wrap cursor / wrap claude / wrap codex)
lean-ctx unwrap <agent> Undo wrap, restore pre-wrap config
lean-ctx onboard Connect all AI tools at once (zero questions)
lean-ctx setup Guided setup with full control over every option
lean-ctx doctor Check that everything is wired up correctly
lean-ctx inspect Inspect recorded context operations and evidence
lean-ctx cockpit (also: lean-ctx dashboard) Savings · Spend · Proof in the browser
EVERYDAY COMMANDS:
lean-ctx -c \"command\" Run a shell command with compressed output
lean-ctx raw \"command\" Same, but full uncompressed output (escape hatch)
lean-ctx read <file> Read a file with compression
lean-ctx grep <pattern> Search with compressed output
lean-ctx gain Terminal summary of local context-usage estimates
lean-ctx tools <profile> Choose how many MCP tools your agent sees
(minimal · standard · power)
lean-ctx tools health Token-budget & rot report (unused tools,
duplicate rules, stale knowledge)
MANAGE:
lean-ctx status Am I connected? (quick check)
lean-ctx update Update to the latest version
lean-ctx enable-gpu Install the CUDA-enabled binary (Linux, Windows)
lean-ctx uninstall Remove lean-ctx cleanly
SAFETY (env vars):
LEAN_CTX_DISABLED=1 Bypass ALL compression + prevent the shell hook from loading
LEAN_CTX_RAW=1 Pass output through unmodified (same as --raw)
MORE:
lean-ctx help all Full command reference (every subcommand)
lean-ctx cheatsheet Context cheat sheet for AI agents
WEBSITE: https://leanctx.com
GITHUB: https://github.com/yvgude/lean-ctx
",
version = env!("CARGO_PKG_VERSION"),
banner = capability_banner(),
)
}
pub(super) fn full_help_text() -> String {
format!(
"lean-ctx {version} — Context Gateway for AI agents
{banner}
GETTING STARTED:
lean-ctx wrap <agent> One-command setup (wrap cursor / wrap claude / wrap codex)
lean-ctx unwrap <agent> Undo wrap, restore pre-wrap config
lean-ctx onboard Connect all AI tools at once (zero questions)
lean-ctx setup Guided setup with full control over every option
lean-ctx doctor Check that everything is wired up correctly
lean-ctx cockpit (also: lean-ctx dashboard) Savings · Spend · Proof in the browser
(everything below is reference — run `lean-ctx help` for the short version)
USAGE:
lean-ctx Start MCP server (stdio)
lean-ctx serve Start MCP server (Streamable HTTP)
lean-ctx serve --daemon Start as background daemon (Unix Domain Socket)
lean-ctx serve --stop Stop the active data dir's daemon (exit 1 if none)
lean-ctx serve --status Show the active data dir's daemon status
lean-ctx -t \"command\" Track command (full output + stats, no compression)
lean-ctx -c \"command\" Execute with compressed output (used by AI hooks)
lean-ctx -c --raw \"command\" Execute without compression (full output)
lean-ctx raw \"command\" Raw escape hatch: full, exact output (alias: bypass)
lean-ctx exec \"command\" Same as -c
lean-ctx shell Interactive shell with compression
COMMANDS:
gain On a terminal: open the Cockpit (#savings); elsewhere the text report
gain --terminal Local context-usage report in the terminal (observed or estimated)
gain --web Open the Savings view in the Cockpit
gain --live Open the Calls (Ledger) view in the Cockpit
gain --deep Full breakdown (cost + tasks + agents + heatmap combined)
gain --graph 30-day local context-usage chart
gain --daily Bordered day-by-day table with USD
gain --score Gain score breakdown (4 sub-scores + trend)
gain --cost Agent cost attribution report (estimated)
spend Measured provider bill (real model + billed tokens)
spend --json Machine-readable measured spend
output-savings [--json] Local output-token estimate; evaluation claims require a declared quality gate
value-report [--format F] Task value report (table, markdown, or json)
gain --tasks Task breakdown by category
gain --agents Top agents by tool spend
gain --by-tool [--json] Per-tool local context breakdown (calls, tokens, USD, %)
gain --heatmap Top files by observed token reduction
gain --json Raw JSON export of all stats
gain --pipeline Per-layer pipeline stats (not collected; legacy file only)
gain --opportunity Find missed savings in shell history (replaces discover/ghost)
gain --raw [--json] Plain stats output (machine-friendly)
gain --reset Clear all token savings data
gain --model=<model> Model for USD pricing calculations
gain --period=<week|month|all> Period for wrapped/stats (default: all)
gain --limit=<N> Row limit for tables (default: 10, max: 50)
gain --wrapped Shareable Wrapped card (terminal)
gain --svg [=<path>] Shareable Wrapped card as SVG (social/OG image)
gain --share [=<path>] Self-hostable Wrapped page (HTML; alias: --page)
gain --copy Copy a ready-to-post share line to the clipboard
gain --svg|--share --open Also open the written card/page in your browser
savings [--period day|week|month|all] [--format table|json|markdown] Local representation-change report; not comparable proof
value [--session <id>|--all] [--json] What lean-ctx did, recomputed from the verified chains
statusline [--wrap \"<cmd>\"] Claude Code status line (set up by `init --agent claude`)
inspect [--last <N>|--task <ID>] [--json] Why the Context Gateway delivered, changed or withheld sources; --task: one task's plan→delivery→outcome
gateway why|list|allow-once|revoke <id> A withheld block of a model request: why, and the human-only override
claude-mod [status|install|uninstall] Claude Code mod: wake-not-poll, Bash shaping, /leanctx (opt-in)
prompt-segment [--shell zsh|bash|fish|plain] Shell prompt segment (set up by `init --prompt`)
learning [status] Local learning-efficacy evidence (export/import: retired, no effect)
autopilot [status|explain|history|export|evidence|reset] Personal receipt-validated learning; evidence: per-workload strategy evidence (help for options)
codex-protected --project <DIR> [--codex <PATH>|--check] One Codex session that reaches <DIR> only through lean-ctx
token-report [--json] Token + memory report (project + session + CEP)
pack --pr PR Context Pack (changed files, impact, tests, artifacts)
snapshot create|list|show|verify|restore|publish|import Context Time Machine: git-anchored, signed snapshots; replay, resume + share
index <status|build|build-full|watch|why <file>> Codebase index utilities
embeddings status Show the ONNX Runtime used for semantic embeddings (ORT_DYLIB_PATH)
cep CEP report (compression metrics, cache, modes, trends)
verify-cache [path] [--json] Inspect local session-cache re-read behavior
health [path] [--json] [--gate] Code-health report: cognitive complexity, naming, navigability score + token tax
cockpit [--port N] [--foreground] [--no-open] [--host=H] [--base-path=/prefix] [--open=browser|none|vscode] Open the Cockpit (also: lean-ctx dashboard; background server, default http://localhost:3333)
cockpit stop Stop the background Cockpit server
serve [--host H] [--port N] MCP over HTTP (Streamable HTTP, local-first)
proxy start [--port=4444] [--detach] API proxy: compress tool_results before LLM API
proxy status Show proxy statistics
daemon start|stop|restart|status IPC daemon management
daemon enable|disable Auto-start daemon on login (systemd/LaunchAgent; prints service file)
cache [list|clear|stats] Show/manage file read cache
sessions [list|show|delete|cleanup] Manage saved session snapshots — PLURAL; see 'session' for live memory (alias: session-store)
benchmark run [path] [--json] Run a local representation comparison on project files
benchmark report [path] Generate a local Markdown report
benchmark scorecard [--json] Local representation scorecard; not a matched-workload result
cheatsheet Context-tool cheat sheet & quick reference
onboard Zero-prompt golden path: connect tools + sensible defaults
setup Guided setup: shell + editor + verify (full control)
install Alias for setup; install --repair = non-interactive refresh
bootstrap Non-interactive setup + fix (zero-config)
status [--json] Show setup + MCP + rules status
init [--global] Install shell aliases (zsh/bash/fish/PowerShell)
init --agent <name> Configure MCP for specific editor/agent
read <file> [-m mode] Read file with compression
engine context-view ... Versioned local Engine context transport
engine recover ... Exact source recovery for a prior Engine view
engine tool-session ... Persistent SDK Agent Tools transport
diff <file1> <file2> Compressed file diff
grep <pattern> [path] Search with compressed output
find <pattern> [path] Find files with compressed output
ls [path] Directory listing with compression
deps [path] Show project dependencies
discover Find uncompressed commands in shell history
discover --card [=<path>] Shareable 'before lean-ctx' SVG from your history
ghost [--json] Ghost Token report: find hidden token waste
filter [list|validate|init] Manage custom compression filters (~/.lean-ctx/filters/)
session Live session memory — SINGULAR; see 'sessions' to manage snapshots
session task <desc> Set current task
session finding <summary> Record a finding
session save Save current session
session load [id] Load session (latest if no ID)
knowledge remember <value> --category <c> --key <k> Store a fact
knowledge recall [query] [--category <c>] Retrieve facts
knowledge search <query> Cross-project knowledge search
knowledge export [--format json|jsonl|simple] [--output <path>] Export knowledge
knowledge import <path> [--merge replace|append|skip-existing] Import knowledge
knowledge remove --category <c> --key <k> Remove a fact
knowledge status Knowledge base summary
tasks [list|show|propose|decide|claim|update|submit|release|verify|stop] [--json] The project's tasks (local, or its Hive vault)
docs list|show|history|write|move|delete [--json] The project's doc pages (local, or its Hive vault)
activity list --json [--session <id>] [--project-root <p>] [--since <ts>] [--kind <k>] Per-session activity stream
agents [--json] Coding agents on this machine (version, sign-in, LeanCTX attachment, ACP)
bus list|read|post|leases|claim|release --json The local agent bus (agent-bus/1)
presence list --json [--all] [--all-projects] Local agents on the bus with liveness
capabilities --json Local Read kinds and verbs this Instance supports
overview [task] Project overview (task-contextualized if given)
explore <query> [--citation] [--depth=N] Iterative code exploration → file:line citations
compress [--signatures] Context compression checkpoint
compress diff <file|-> [--shell \"cmd\"] [--json] Preview compression: original vs emitted + token diff
config Show/edit configuration (~/.lean-ctx/config.toml)
security [status] Show security posture (containment + secret defense)
yolo Disable containment: any path + any command (keeps secret redaction on)
secure Restore secure defaults (path jail + shell gating + secret redaction)
security secrets <on|off> Toggle secret/.env redaction (separate from containment)
allow <cmd> Allow one shell command (additive; granular re-enable after yolo)
allow-path <dir> Let tools reach a dir outside ~ or a protected one (no restart)
workspace <create|add|remove|show|diagnose> Launcher-bound Workspace: the only roots a server bound
with LEAN_CTX_WORKSPACE_FILE may reach (revision-checked changes)
tools [minimal|standard|power|show|list] How many MCP tools your agent sees
profile [list|show|diff|create|set|suggest] Manage local context configuration profiles
kit [list|load|show|unload] [name] Manage available local TOML/.ctxpkg substrate; first-class Kit semantics are Research
theme [list|set|export|import] Customize terminal colors and themes
tee [list|clear|show <file>|last] Manage output tee files (~/.lean-ctx/tee/)
compression [off|lite|standard|max] Set local output-density preference (alias: terse)
slow-log [list|clear] Show/clear slow command log (~/.lean-ctx/slow-commands.log)
debug-log [list|tail N|clear|path] Opt-in tool-call + hook-routing log (set debug_log / LEAN_CTX_DEBUG_LOG)
update [<version>] [--check] Update from a verified GitHub release
[--pin <version>|--unpin|--status|--rollback]
enable-gpu [--check] Install CUDA-enabled binary (x86_64 Linux/Windows)
stop Stop ALL lean-ctx processes (daemon, proxy, orphans)
restart Restart daemon (applies config.toml changes)
dev-install [--fast|--release] Fast incremental build + atomic install + restart
codesign-setup macOS: one-time stable signing identity (stops repeating TCC prompt, #356)
gotchas [list|clear|export|stats] Bug Memory: view/manage auto-detected error patterns
doctor integrations [--json] Integration health checks (Cursor/Claude Code/CodeBuddy)
doctor [--fix] [--json] Run diagnostics (and optionally repair)
doctor --migrate-check v1.0 migration readiness audit (config, deprecations, data)
migrate config [path] --rollback Restore digest-bound pre-v4 global config
migrate task-receipt <dir> [--rollback] Preserve or roll back V3 task migration metadata
migrate legacy-context [--adopt --project <root> --items <ids|all> [--dry-run]]
List / adopt pre-3.11.5 context that belongs to no project
smells [scan|summary|rules|file] [--rule=<r>] [--path=<p>] [--json]
Code smell detection (Property Graph, 8 rules)
control <action> [--target=<t>] Context field manipulation (exclude/pin/priority)
plan <task> [--budget=N] Context planning (optimal Phi-scored context plan)
compile [--mode=<m>] [--budget=N] Context compilation (knapsack + Boltzmann)
addon list|search|info|add|remove
Unavailable: marketplace/addon surface is Research
decisions list|show|check|new Recorded team decisions (.leanctx/decisions); check exits 1
on a violation (--rev A..B | --staged | --diff FILE|-)
rules sync|diff|lint|status|init
Local rules management; no public cross-agent governance product
policy list|show|validate|coverage|org Local policy-pack utilities; organization controls are Research
uninstall [--keep-config] [--keep-binary] [--dry-run]
Full clean removal: stops all processes, removes hooks,
MCP configs, rules, autostart, data, AND the binary itself.
--keep-config preserves MCP/rules · --keep-binary keeps the
binary · --dry-run previews without changing anything
PROJECT & AGENT TOOLS:
semantic-search <query> [options] Hybrid BM25 + embeddings code search (alias: search-code)
repomap [--json] [--max-tokens N] [--limit N] PageRank-ranked repository map (alias: repo-map)
glob <pattern> [path] Find files by glob pattern
heatmap [--top=N] [--dir=D] [--by=connections|tokens] [--json] Most-connected / costliest files
call <tool> --project-root <path> --json '<json>' [--json-file <path>]
Invoke one MCP tool from the shell
ledger <status|reset|evict|prune|push> [args] Inspect and manage the context ledger
ocla [ocla] Inspect Open Context & Token Lifecycle Architecture state
summary [recall|record|list] [query] [--top-k N] Record + recall AI session summaries
checkpoints [--session <id>] [--commit <sha>] [--orphaned] List provenance checkpoints
import <claude-code|codex|cursor|opencode>|--all [--dry-run] Import facts from AI session histories
skillify [mine|list|status|promote <slug>] Codify recurring session patterns into .cursor/rules
learn [--apply] [--mine [dir]] Learned error→fix corrections (--mine: distill a transcript dir)
export-rules [--format mdc|agents-md|claude-md|codebuddy-md] [--root DIR]
Export high-confidence knowledge as agent rules
compact [path] Compact agent transcripts (default: ~/.claude/projects)
agent register|list|presence|show|heartbeat|suspend|resume|decommission|check
Agent identities: registered, attested, revocable
client fs-read|fs-write|exec --json --session <id> --agent <id>
ACP client calls through the Instance (jail, allowlist, receipts)
instructions --client <id> [--profile <name>] [--json] | --list-clients
Print the agent instructions lean-ctx generates for a client
provider init|auth|logout|list|check|credentials
Context sources (scaffolds, Jira OAuth, checks, stored credentials)
trust [<path>|status [<path>]|--list] Trust a workspace (gates project-level overrides)
untrust [<path>] Remove a workspace from the trust store
harden [options] Deny native Read/Grep/Glob in IDE configs
telemetry [status|on|off|show|reset-id|history] Inspect and control product telemetry
{hive} completions <zsh|bash|fish> Print the shell completion script
report-issue [--title T] [--description D] [--dry-run] [--include-tee]
Open a GitHub issue with diagnostics (alias: report)
Plan, entitlement and usage details
EVIDENCE & MEASUREMENT:
stats [json|reset-cep] Raw token counters (JSON export, reset CEP stats)
roi [--json|--md] [--export <path>] Recorded savings (ROI) report from the signed ledger
finops export [--target=focus|cbf|vantage] [--from=D] [--to=D] [--out=FILE]
Daily cost/savings rows from the savings ledger
evidence run|workflow|realworld|report|v2|inspect Generate or inspect evidence bundles
evidence-export [--output DIR] [--format markdown|json] Portable package of local evidence
shadow [--latest|--list|--force] Inspect local Shadow Mode comparisons
verify [--format summary|json|both] [--json] Output-verification statistics
verify <bundle.zip> [--public-key F] [--verbose] [--json] Verify an evidence bundle offline
proof [--format json|summary|both] [--no-write] [--filename F] Write context proof artifacts
audit [evidence|determinism] Compliance report (default), evidence audit, determinism check
compliance report|facts|verify Signed CISO report (frameworks: Enterprise), assessed facts, offline verify
conformance [--json] Conformance scorecard, non-zero exit on failure (alias: selftest)
scenario [all|triage|knowledge|shadow|value-gate|full-loop] Run an end-to-end scenario
triage accuracy [--json] Triage model accuracy report
model install triage | model status | model remove triage Manage the local triage model
introspect [cognition] [--json] Cognition snapshot (which subsystems are wired/active)
safety-levels Per-command compression safety levels (alias: safety)
INTEGRATION ENTRY POINTS (called by editors and hooks, not by hand):
mcp Start the MCP server on stdio (same as bare lean-ctx)
hook <rewrite|redirect|deny|read-dedup|observe|post-commit|copilot|...>
Agent hook handlers (Claude, Cursor, Copilot, Codex, Vibe)
editor-signal --file <path> Report the file an editor has open
editor-session --event <open|heartbeat|close> --source <editor> --workspace <path> --session-id <id>
Record editor session presence
editor-bridge dir Print the directory an editor's semantic bridge announces itself in
git-trailer <msg-file> [source] Add the lean-ctx commit trailer (prepare-commit-msg hook)
RESEARCH & RENAMED:
upgrade [args] Renamed to `update`; forwards its arguments
SHELL HOOK PATTERNS (95+):
git status, log, diff, add, commit, push, pull, fetch, clone,
branch, checkout, switch, merge, stash, tag, reset, remote
docker build, ps, images, logs, compose, exec, network
npm/pnpm install, test, run, list, outdated, audit
cargo build, test, check, clippy
gh pr list/view/create, issue list/view, run list/view
kubectl get pods/services/deployments, logs, describe, apply
python pip install/list/outdated, ruff check/format, poetry, uv
linters eslint, biome, prettier, golangci-lint
builds tsc, next build, vite build
ruby rubocop, bundle install/update, rake test, rails test
tests jest, vitest, pytest, go test, playwright, rspec, minitest
iac terraform, make, maven, gradle, dotnet, flutter, dart
data-eng dbt, spark, alembic, flyway
ai ollama, mlflow
security semgrep, trivy, grype, syft, cosign, swiftlint
vcs/tool jj, mise, buf, gem, uv add/lock/tool
edge/iac pulumi, linkerd, argocd, vercel, fly, wrangler, skaffold, supabase
utils curl, grep/rg, find, ls, wget, env
data JSON schema extraction, log deduplication
READ MODES:
auto Auto-select optimal mode (default)
full Full content (eligible re-reads use cache references)
map Dependency graph + API signatures
signatures tree-sitter AST extraction (27 languages)
task Task-relevant filtering (requires ctx_session task)
reference One-line reference stub (cheap cache key)
aggressive Syntax-stripped content
entropy Shannon entropy filtered
diff Changed lines only
lines:N-M Specific line ranges (e.g. lines:10-50,80)
ENVIRONMENT:
LEAN_CTX_DISABLED=1 Bypass ALL compression + prevent shell hook from loading
LEAN_CTX_ENABLED=0 Prevent shell hook auto-start (lean-ctx-on still works)
LEAN_CTX_RAW=1 Same as --raw for current command
LEAN_CTX_AUTONOMY=false Disable autonomous features
LEAN_CTX_COMPRESS=1 Force compression (even for excluded commands)
OPTIONS:
--version, -V Show version
--help, -h Show this help
EXAMPLES:
lean-ctx -c \"git status\" Compressed git output
lean-ctx -c \"kubectl get pods\" Compressed k8s output
lean-ctx -c \"gh pr list\" Compressed GitHub CLI output
lean-ctx gain Open the Cockpit (#savings); --terminal for the text summary
lean-ctx gain --live Calls (Ledger) view in the Cockpit
lean-ctx gain --graph 30-day local context-usage chart
lean-ctx gain --daily Day-by-day breakdown with USD
lean-ctx token-report --json Machine-readable token + memory report
lean-ctx cockpit (also: lean-ctx dashboard) Open the Cockpit
lean-ctx cockpit --foreground Run the Cockpit server in this terminal
lean-ctx cockpit stop Stop the background Cockpit server
lean-ctx cockpit --host=0.0.0.0 Bind to all interfaces (remote access)
lean-ctx gain --wrapped Wrapped report card (recommended)
lean-ctx gain --wrapped --period=month Monthly Wrapped report card
lean-ctx gain --svg Shareable SVG card -> lean-ctx-wrapped.svg
lean-ctx gain --svg=card.svg --period=month Monthly SVG card to a chosen path
lean-ctx gain --share Self-hostable Wrapped page -> lean-ctx-wrapped.html
lean-ctx gain --share --base-url=https://you.dev/w Page with social preview meta
lean-ctx gain --copy Copy your share line to the clipboard
lean-ctx savings Local representation-change ledger; not comparable proof by itself
lean-ctx savings verify Re-check the savings ledger SHA-256 hash chain
lean-ctx savings sign Export an Ed25519-signed savings batch (ROI/audit artifact)
lean-ctx savings verify-batch <file> Verify a signed batch offline (no ledger needed)
lean-ctx sessions list List all CCP sessions
lean-ctx sessions show Show latest session state
lean-ctx sessions delete <id> Delete one saved session
lean-ctx discover Find local opportunities to shape shell output
lean-ctx discover --card Shareable 'before' SVG -> lean-ctx-before.svg
lean-ctx onboard One-command setup (shell + editors + verify)
lean-ctx install --repair Non-interactive repair path (merge-based)
lean-ctx bootstrap Non-interactive setup + fix (zero-config)
lean-ctx bootstrap --json Machine-readable bootstrap report
lean-ctx init --global Install shell aliases (includes lean-ctx-on/off/mode/status)
lean-ctx-on Enable shell aliases in track mode (full output + stats)
lean-ctx-off Disable all shell aliases
lean-ctx-mode track Track mode: full output, stats recorded (default)
LEAN_CTX_DEBUG=1 lean-ctx-on Show shell hook mode-change notices
lean-ctx-mode compress Compress mode: all output compressed (power users)
lean-ctx-mode off Same as lean-ctx-off
lean-ctx-status Show whether compression is active
lean-ctx init --agent pi Install Pi Coding Agent extension
lean-ctx init --agent grok Configure Grok (xAI) MCP + hooks
lean-ctx doctor Check PATH, config, MCP, and dashboard port
lean-ctx doctor integrations Detailed integration checks (Cursor/Claude Code/CodeBuddy)
lean-ctx doctor --fix --json Repair + machine-readable report
lean-ctx status --json Machine-readable current status
lean-ctx session task \"implement auth\"
lean-ctx session finding \"auth.rs:42 — missing validation\"
lean-ctx knowledge remember \"Uses JWT\" --category auth --key token-type
lean-ctx knowledge recall \"authentication\"
lean-ctx knowledge search \"database migration\"
lean-ctx overview \"refactor auth module\"
lean-ctx compress --signatures
lean-ctx read src/main.rs -m map
lean-ctx grep \"pub fn\" src/
lean-ctx deps .
GRAPH (project analysis):
lean-ctx graph build [path] Build/rebuild project graph index
lean-ctx graph status Show graph index statistics
lean-ctx graph related <file> List files related to a given file
lean-ctx graph impact <file> Show files impacted by changes to a file
lean-ctx graph symbol <spec> Inspect a symbol (format: <file>::<symbol>, or bare <symbol>)
lean-ctx graph context <query> Query the property graph for a concept
PROJECT:
project status [<path>] [--json]
This checkout: partition, project link, workspace-root choice
project link --project <team-project-id> [--organization <uuid>] [--label <text>] [<path>]
Checkouts linked to the same project share their knowledge
project unlink [<path>] Remove this checkout's project link
project use <path> Of several workspace roots, bind sessions to <path> (default: first)
All of it: lean-ctx project help
TROUBLESHOOTING:
Commands broken? lean-ctx-off (fixes current session)
Permanent fix? lean-ctx uninstall (removes all hooks)
Manual fix? Edit {rc_file}, remove the \"lean-ctx shell hook\" block
Binary missing? Aliases auto-fallback to original commands (safe)
Preview init? lean-ctx init --global --dry-run
WEBSITE: https://leanctx.com
GITHUB: https://github.com/yvgude/lean-ctx
",
version = env!("CARGO_PKG_VERSION"),
banner = capability_banner(),
rc_file = lean_ctx::shell_hook::shell_rc_file(),
hive = if lean_ctx_hive::HIVE_AVAILABLE {
" hive connect|status|disconnect|link Connect this machine to LeanCTX | Hive\n models List the models your Hive plan includes\n"
} else {
""
},
)
}
pub(super) fn print_help() {
println!("{}", full_help_text());
}
#[cfg(test)]
mod tests {
#[test]
fn full_help_does_not_advertise_the_removed_tui_dashboard() {
let text = super::full_help_text();
assert!(
!text.contains("Live TUI dashboard"),
"`help all` must not list the removed TUI dashboard"
);
assert!(
text.contains("cockpit [--port N]"),
"the Cockpit — the actual replacement — must still be listed"
);
}
#[test]
fn full_help_lists_hive_only_when_available() {
let text = super::full_help_text();
assert_eq!(text.contains("hive connect"), lean_ctx_hive::HIVE_AVAILABLE);
assert!(text.contains(" completions <zsh|bash|fish>"));
}
}