Skip to main content

CLI commands

CommandWhat it does
graphlens-mcp initDetect languages → toolchain doctor → full index → configure agents → install skill
graphlens-mcp serveStart the MCP server over stdio. Launched by the agent, not by you
graphlens-mcp statusShow detected languages, toolchain status, and graph size/freshness
graphlens-mcp reindexForce a full rebuild (e.g. after installing a new toolchain)
graphlens-mcp removeDeregister from agents and (with --purge-db) delete the local graph

init

graphlens-mcp init [--root DIR] [--db PATH] \
[--agent NAME ...] [--no-agent] [--no-skills] [--yes]
  • --root — project root (default: current directory).
  • --db — graph database path (default: <root>/.graphlens/graph.db).
  • --agent — agent to configure, repeatable; skips the interactive selector.
  • --no-agent / --no-skills — index only / skip the navigation skill install.
  • --yes — accept detected agents without prompting (CI-friendly).

serve

graphlens-mcp serve [--root DIR] [--db PATH] [--watch/--no-watch]

The agent launches this from its MCP config. The server answers queries from SQLite and, by default, starts a filesystem watcher that keeps the graph fresh as you edit. Pass --no-watch to disable it (the on-access freshness check still applies). See Freshness.

reindex

graphlens-mcp reindex [--root DIR] [--db PATH]

Clears and rebuilds the whole graph. Use it after installing a new language toolchain, or for an exact cross-language / whole-project re-link.

remove

graphlens-mcp remove [--root DIR] [--agent NAME ...] [--purge-db] [--yes]

Removes the graphlens entry from each agent's config (leaving your other servers intact). With --purge-db it also deletes the .graphlens/ cache.