Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

CLI Overview

Lexa is a CLI plus an MCP server backed by a single indexed graph. Every command reads from the same per-project graph, and every command is also exposed as an MCP tool under the same name.

Sibling pages

  • Indexingindex, reindex, clear-index, status, watch
  • Discoveryfiles, list, glob, path-search
  • Searchtext-search, symbol-defs, symbol-search, word-refs, callers
  • Code Structureoutline, trace-deps, brief
  • Read & Editread, patch, create
  • Auditaudit (architecture review)
  • Pipelinepipeline (composable query chains)
  • Maintenanceupgrade, changes, recent

Common flags and output modes

Two output formats:

  • Pretty text (default) — human-friendly, colored in interactive terminals.
  • JSON — pass --json to switch every command's output to JSON via serde_json::to_string_pretty.

Common command-line options:

  • -m, --max <N> — cap the number of results (most commands accept this).
  • -L, --line-range <RANGE>START-END, START-, or a single line number.
  • --path-glob — match a glob pattern against indexed paths.
  • --language — restrict to one of the supported languages.

CLI ↔ MCP parity

Every CLI command has an MCP tool with the same name and (mostly) the same flags. Differences:

  • MCP accepts a JSON object; the CLI accepts positional args and flags.
  • MCP supports a steps array form for the pipeline.
  • MCP structuredContent is opt-in (see Output Formats).