On this page
Get started
The commands you actually need.
A compact companion for reads, diagnosis, context recovery and session continuity.
Inspect a project
lean-ctx ls .
lean-ctx grep "authenticate" src
lean-ctx read src/main.rs -m signatures
lean-ctx read src/main.rs -m full --fresh
Paths are examples. Run commands from the intended project root in PowerShell, Bash or zsh. For an npm installation on Windows, use lean-ctx.cmd as the command name. See platform conventions for quoting and paths, and read modes to choose a representation deliberately.
Use MCP tools
The blocks below are MCP calls, not shell commands. Supply the tool name and JSON arguments through your MCP client.
{"name":"ctx_compose","arguments":{"path":".","task":"Find where authentication is checked"}}
{"name":"ctx_search","arguments":{"action":"regex","path":".","pattern":"authenticate","max_results":12}}
{"name":"ctx_read","arguments":{"path":"src/main.rs","mode":"signatures"}}
If the host requires absolute paths, use the resolved project path. The tool reference gives exact parameter schemas.
Recover a missing detail
A signature is not an implementation. Request a focused line range or raw: true when you need exact file text. For archived command output, use the returned identifier with ctx_expand; for a cached source reference, use the documented recovery tool.
{"name":"ctx_read","arguments":{"path":"src/main.rs","raw":true}}
Recovery depends on retained content, source availability and access policy. Do not paste compressed omission markers back into source files.
Keep the next task informed
lean-ctx session task "Investigate authentication failures"
lean-ctx session finding "The login handler validates the session cookie"
lean-ctx session save
lean-ctx knowledge status
Record useful facts and their evidence, not secrets or whole transcripts. Review retained knowledge when the source changes.
lean-ctx knowledge consolidate --session <id> turns one session’s findings into project facts. Without --session, only project facts are consolidated; another agent’s session is never imported.
Link a checkout to its team project
lean-ctx project link --project gateway
lean-ctx project status
lean-ctx project unlink
Replace gateway with your team project’s id. Linked checkouts of one team project share conventions, and team commands default to that project. When several workspace roots are open, lean-ctx project use <path> chooses the one sessions bind to. See linked checkouts.
Keep synchronized knowledge consistent
lean-ctx cloud pull
lean-ctx sync
lean-ctx sync --force
cloud pull keeps your local facts and lists the keys where the cloud value differs. sync refuses to replace newer cloud values; --force keeps your local values instead. See restore limits.
Connect a source without exposing its token
lean-ctx provider check github --json
lean-ctx provider credentials list --json
lean-ctx provider init weather --project-root .
provider credentials set reads NAME=value lines from stdin, so tokens never appear in your shell history; list prints names only. provider check <github|gitlab|jira|postgres> signs in once and reports the account; with --stdin it tests candidate values before you store them.
Diagnose before changing settings
lean-ctx status
lean-ctx doctor
lean-ctx security status
lean-ctx config path
lean-ctx config validate
lean-ctx setup --help
setup --help lists the setup options and never runs setup. The lean-ctx account … commands print one JSON line each and serve the Cockpit’s account page; you do not need them for local use.
Give a launched server exactly its own folders
lean-ctx workspace create --file ~/ws/app.json --id app ~/code/app
lean-ctx workspace add --file ~/ws/app.json --expect-revision 1 --read-only ~/code/shared-lib
lean-ctx workspace show --file ~/ws/app.json
lean-ctx workspace diagnose
A launcher that starts the MCP server with LEAN_CTX_WORKSPACE_FILE limits it to these roots; without the variable nothing changes. The security guide explains the file rules and what a Workspace does not limit.
Open the Cockpit
lean-ctx cockpit
Run from your project and use the authenticated browser URL printed in the terminal. lean-ctx gain --web opens Savings and lean-ctx gain --live the live context view. The Cockpit guide covers installation, views, editor integration, exports and troubleshooting. For services, profiles and logs, see local operation.
For the complete command surface, use CLI reference. Configuration, repair, update and uninstall commands can change local state; inspect their help before running them.
Sources & versions
- 02-daily-use.mddocs/reference/02-daily-use.mdReviewed checkout
- 03-memory-and-knowledge.mddocs/reference/03-memory-and-knowledge.mdReviewed checkout
- dynamic_tools.rsrust/src/server/dynamic_tools.rsReviewed checkout
- knowledge_cmd.rsrust/src/cli/knowledge_cmd.rsReviewed checkout
- project_cmd.rsrust/src/cli/project_cmd.rsReviewed checkout
- workspace_cmd.rsrust/src/cli/workspace_cmd.rsReviewed checkout
- mod.rsrust/src/cli/dispatch/mod.rsReviewed checkout
- Core checkout
4990237a15- Reviewed runtime
- 3.10.2
- SDK release
- 1.1.0
Separate baselines for source, CLI/configuration and SDK contracts. Review does not certify every platform or integration.
Versions & compatibility