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
- Indexing —
index,reindex,clear-index,status,watch - Discovery —
files,list,glob,path-search - Search —
text-search,symbol-defs,symbol-search,word-refs,callers - Code Structure —
outline,trace-deps,brief - Read & Edit —
read,patch,create - Audit —
audit(architecture review) - Pipeline —
pipeline(composable query chains) - Maintenance —
upgrade,changes,recent
Common flags and output modes
Two output formats:
- Pretty text (default) — human-friendly, colored in interactive terminals.
- JSON — pass
--jsonto switch every command's output to JSON viaserde_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
stepsarray form for the pipeline. - MCP
structuredContentis opt-in (see Output Formats).
