Reference
CLI Reference
You never need to type any of these: open your AI tool and just talk, and the auto-intuition protocol maps your intent to the right action. Every command below exists for people who prefer explicit control, and each one is valid on its own.
egc initRun once in each project you want EGC to manage. Bootstraps the cognitive protocol in every detected tool, registers the MCP servers, prepares the state store, configures the commit-privacy filter for the repository and ends with a compact install check. Each step prints one check line; the full report is one egc doctor away.
$ egc init
✓ cognitive protocol 6 tools up to date (v9)
✓ MCP registration 7 tools already registered
✓ memory state store ready (6 migrations); loads on your first session
✓ commit-privacy filter already configured; populated memory is stripped from staged blobs (local repo only)
✓ token crusher shim installed and on PATH
✓ install check 12 targets healthy
Installation complete.egc doctorVerify every installed target (its managed files and hooks), the database and the MCP registrations of each detected tool, one block per target and a summary at the end. The first command to run after installation.
$ egc doctor
Doctor report:
- egc-home
Status: OK
Install-state: ~/.gemini/egc/install-state.json
Issues: none
- claude-home
Status: OK
...
Summary: checked=12, ok=12, warnings=0, errors=0
MCP servers:
- [OK] egc-guardian at .../egc-guardian/build/index.js: answers tools/list (8 tools)
- [OK] egc-memory at .../egc-memory/build/index.js: answers tools/list (24 tools)
MCP summary: registrations=12, registered=12, servers=4, answering=4, warnings=0, errors=0
# Check against a local development checkout instead of the installed package:
$ egc doctor --repo-root /path/to/EGCegc statusShow the state store in use, the sessions active on the session bus and the outcome of the last 20 skill runs. To read the decisions of a project, use egc export.
$ egc status
EGC status
Database: ~/.egc/egc/state.db
Active sessions: 0
- none
Skill runs (last 20):
Success: 0
Failure: 0
Unknown: 0
Success rate: n/a
Failure rate: n/a
Recent runs: noneegc consolidateCompact the state file for the current project when it grows too large. Rewrites entries in three layers: Working (last 7 days, kept verbatim), Episodic (last 30 days, summarized per week), and Semantic (older entries, condensed to core facts). The original file is backed up to ~/.egc/state/archive/ before any rewrite.
$ egc consolidate
Consolidating state for my-app...
Working layer: 3 entries kept verbatim
Episodic layer: 12 entries summarized (2 weeks)
Semantic layer: 31 entries condensed
✓ Written to ~/.egc/state/my-app/main.md
Backup at ~/.egc/state/archive/my-app-main-20260613.md
# Preview without writing:
$ egc consolidate --dry-run
# Run even if below the line threshold:
$ egc consolidate --forceegc exportPrint the decrypted memory document for a project (default: the current directory) or for the user-wide global scope. Plain text is the Agent Memory Interchange Markdown document as stored; --json parses it into header fields and the five sections. Read-only: the state file and the key are never modified. Exit codes: 0 printed, 1 usage error or a state file or key that cannot be read or trusted, 2 no memory for the scope, 3 encrypted memory whose key is missing.
$ egc export
# Project State
project: /home/you/projects/my-app
branch: main
...
# Another project, as JSON:
$ egc export --project /path/to/other-app --json
# The global scope shared by all projects:
$ egc export --scope globalegc importBring a memory document printed by egc export back into the memory of a project (default: the current directory) or of the user-wide global scope. By default it merges: the entries of the document go first, each text is kept once, every section keeps its cap, and Next Session comes from the document when it has one; --replace writes the document in place of the memory. A document that does not parse, or that carries the shape of a credential, is refused and nothing is written. --dry-run prints the change per section and writes nothing; --json prints the summary as an object.
$ egc import memory.md --dry-run
# Merge into another project:
$ egc import memory.md --project /path/to/other-app
# Replace the global scope:
$ egc import global.md --scope global --replaceegc installBare: set up the engine and ask about the optional prompt library (default no; from v1.1.22, --prompt-library and --no-prompt-library decide without the question). With --target and --profile: install the library to one tool, for example after adding a new tool.
$ egc install --target cursoregc catalogList the profiles and the components of the prompt library, show one component, or search the whole catalog by keyword with ranked results. Without a subcommand it prints the usage.
$ egc catalog profiles
$ egc catalog components --family language
$ egc catalog components --target cursor --json
$ egc catalog show framework:nextjs
$ egc catalog search memory sessionegc repairRestore drifted or missing managed files from the installed package, target by target, and report how many were repaired. To re-inject the memory protocol into an instruction file, run egc init in the project.
$ egc repair
# Repair against a local development checkout instead of the installed package:
$ egc repair --repo-root /path/to/EGCegc replayPlay back a recorded session with timeline scrubbing: every tool call, file edit, and token count in order.
$ egc sessions
$ egc replay <session-id>egc budgetSet per-session token and cost limits, enforced by the pre-tool hook before each call.
$ egc budget set --tokens 500000
$ egc budget statusegc pluginCommunity plugin registry: install, list, update, and remove EGC plugins distributed via npm.
$ egc plugin install <name>
$ egc plugin listegc savedShort token-savings report from the local Token Crusher ledger. Use egc gain for the full panel and egc discover for missed opportunities.
$ egc saved
Token Crusher savings (local ledger, zero token cost)
Crushed runs: 10022
Output size: 326.2 MB -> 44.4 MB (86% smaller)
Tokens saved: ~73877387egc uninstallRemove every EGC-managed file recorded in install-state, leaving your own configuration untouched.
$ egc uninstall --target cursoregc watchStart the bidirectional state sync daemon. Watches all EGC-managed tool config files in the project. When any file is edited outside of EGC's own propagation cycle - for example, when you update context in Cursor - the change is extracted from the EGC block and synced to all other tools automatically. Changes are also merged back into ~/.egc/state/ for full round-trip persistence.
$ egc watch
[egc watch] Watching 4 tool config file(s) in /my-project
[egc watch] Press Ctrl+C to stop.
[egc watch] antigravity changed -> synced to: cursor, copilot, aider + state file
# Watch a specific project:
$ egc watch /path/to/project
# Suppress output:
$ egc watch --quietegc dashboardStart the EGC Dashboard, a real-time Mission Control panel at http://localhost:7890. Shows live tool calls, file edits, shell commands, token usage, memory state, and agent status as your AI works. The dashboard auto-starts after egc install and egc init and runs as a background server.
$ egc dashboard
EGC Dashboard running at http://localhost:7890
# Stop the background server:
$ egc dashboard stop
# Check if it's running:
$ egc dashboard statusegc runRun any command through the Token Crusher. Noisy output (long git logs, test noise, install spam, giant JSON) is compressed up to 90% before it reaches the model; errors and warnings always survive. On hook-capable tools this happens silently without typing anything.
$ egc run git log
... (12439 more commits)
[egc-crusher] saved ~139178 tokens (full output: rerun with --raw)
# Escape hatch, full output:
$ egc run --raw git logegc gainThe full Token Crusher savings panel: totals, average per run, biggest crush, efficiency meter, and a breakdown by command kind and by layer (the automatic shim or the egc run prefix). Read from the local ledger at zero token cost. --share prints the same savings as a short block you can paste anywhere, with nothing that names your machine, your projects or your commands (--json for an object). Or just ask your AI "how much did I save?" and it runs this for you.
$ egc gain
EGC Token Gain (local ledger, zero token cost)
Crushed runs: 12
Tokens saved: ~412.7K
Efficiency: ████████████████████████ 97.3%
# Run-by-run log:
$ egc gain --history
# A block to paste anywhere, no identifiers:
$ egc gain --share
# Short summary:
$ egc savedegc contextRank the files of the project for the task you describe and print a briefing the AI can start from: the files most likely to matter, with the signal table behind each pick when you add --explain. Scope with --project, feed a session history with --history, cap the list with --top.
$ egc context "fix the Windows path of the Zed target"
# With the signal table behind each pick:
$ egc context --explain "fix the Windows path of the Zed target"egc discoverScan your recent session transcripts for crushable output that never went through the Token Crusher, and see what those runs could have saved.
$ egc discover
EGC Discover: crushable output that skipped the Token Crusher
Transcripts scanned: 40 (last 7 days)
Missed runs: 41
Potential savings: up to ~39.5K tokensegc crusher-shimInstalled automatically by egc install and egc auto-update. A PATH-level binary shim (git, npm, pip, gh, and more) that compresses noisy output for any tool that shells out to run them. Covers a known gap: on Claude Code, the PreToolUse hook rewrite never fires for commands the AI assistant runs through its own Bash tool, only for a human typing directly into the terminal, so this is what makes the Crusher work there too. A human at an interactive terminal always gets full, untouched output; only non-interactive output capture goes through the Token Crusher.
$ egc crusher-shim install
Shim directory: ~/.egc/bin
Installed: git, npm, pip, gh, ...
PATH updated in: ~/.bashrc, ~/.profile
Open a new terminal for it to take effect.
# Check status:
$ egc crusher-shim status
# Remove it:
$ egc crusher-shim uninstallegc clawNanoClaw REPL: a persistent, session-aware agent loop with zero dependencies. Conversation history lives in plain Markdown files, so sessions survive restarts and stay greppable.
$ egc claw
NanoClaw v2: Session: default
Type /help for commands, exit to quit.
claw> egc harness-auditScores your harness setup across tool coverage, context efficiency, quality gates, memory persistence, eval coverage, security guardrails, and cost efficiency. Text or JSON output.
$ egc harness-audit --format json
{
"scope": "repo",
"deterministic": true,
...
}egc auto-updatePull the latest changes from GitHub, reinstall managed targets, and re-run the cognitive bootstrap so already-configured installs pick up new protocol sections instead of staying frozen at whatever shipped on first install. On an npm install it prints the upgrade command instead; on Windows, close the AI tools and terminals that run EGC before running it, or npm fails with EBUSY on a file it cannot rename.
$ egc auto-update
Pulling latest from origin/main...
Building egc-guardian... done
Building egc-memory... done
Reinstalling targets...
✓ claude code updated
✓ cursor updated
# Update against a local development checkout instead of the installed package:
$ egc auto-update --repo-root /path/to/EGCegc planInspect the selective-install manifests and the resolved plan for a target and profile before anything is written.
$ egc plan --profile core --target cursoregc consultRecommend EGC components and profiles from a natural-language description of what you are building.
$ egc consult "a Django API with Celery workers"egc list-installedInspect the install-state files for the current context: which target, which profile, which files.
$ egc list-installedegc overviewAggregated, read-only view of every per-project memory state on this machine.
$ egc overviewegc verifyRun the project verification command and record a receipt for the commit gate.
$ egc verifyegc teamThe Team Brain over a git remote you own: init once per machine (the first machine prints the team key, the others join with --key), sync to pull the teammates' sealed state and push yours, status for the last sync and its health.
$ egc team init --backend git --remote git@github.com:you/egc-memory
$ egc team init --backend git --remote git@github.com:you/egc-memory --key <hex>
$ egc team sync
$ egc team statusegc telemetryAnonymous usage telemetry, asked once on the first install, doctor or init run: status, on, off.
$ egc telemetry status
$ egc telemetry offegc session-inspectEmit canonical EGC session snapshots from dmux or Gemini history targets.
$ egc session-inspectegc loop-statusInspect transcripts for stale loop wakeups and pending tool results.
$ egc loop-status