ivar graph
Graph commands — index, explore, callers, impact, affected tests, the viewer, the MCP server and its tools.
ivar graph indexes every repo in the hall into .ivar/memory.db and answers
structural questions about it. The Code graph guide covers
how indexing and feature layers work.
Every subcommand accepts the global options:
| Option | Description |
|---|---|
--json | Emit machine-readable output |
--compact | Token-optimized pipe-delimited records with a schema header |
--color <COLOR> | auto (default), always or never |
Index
index
ivar graph indexIncrementally update or build the index.
| Option | Description |
|---|---|
--repo <REPO> | Index one repository; all declared repos if omitted |
--full | Force a full reindex regardless of the last indexed commit |
--no-mcp | Do not declare the graph MCP server in ivar.json |
stats
ivar graph statsRepositories, files, symbols, edges and database size.
clean
ivar graph clean --feature billing-currencyRemove indexed data.
| Option | Description |
|---|---|
--repo <REPO> | Remove one repository from the index |
--feature <FEATURE> | Remove one feature's layers |
--all | Remove all repositories and data |
Query
explore
ivar graph explore renderInvoiceSymbol discovery, source, callers and impact in one answer.
| Argument / option | Description |
|---|---|
<QUERY> | Symbol name or query pattern |
--repo <REPO> | Limit to one repository |
find
ivar graph find Invoice --limit 20| Argument / option | Description |
|---|---|
<QUERY> | Symbol name pattern |
--repo <REPO> | Restrict to one repository |
--limit <LIMIT> | Maximum matching symbols |
callers
ivar graph callers formatAmount --cross-repo| Argument / option | Description |
|---|---|
<SYMBOL> | Symbol name |
--repo <REPO> | Restrict to one repository |
--cross-repo | Include callers in other repositories |
--min-confidence <MIN_CONFIDENCE> | Minimum edge confidence, 0.0 to 1.0 |
callees
ivar graph callees 42Outgoing calls from a symbol. <SYMBOL_ID> is the symbol's row ID, as --json
output from other queries reports it.
file
ivar graph file api src/billing.tsOutline of one file: every symbol it defines. Takes <REPO> and <PATH>.
impact
ivar graph impact 42 --max-depth 3Transitive blast radius of a symbol, by <SYMBOL_ID>.
| Option | Description |
|---|---|
--max-depth <MAX_DEPTH> | Maximum traversal depth |
affected
git diff --name-only | ivar graph affected --stdinTest files that transitively depend on the changed files.
| Argument / option | Description |
|---|---|
[FILES]... | Changed file paths |
--stdin | Read paths from stdin, one per line |
--repo <REPO> | Restrict to one repository |
--max-depth <MAX_DEPTH> | Maximum search depth |
path
ivar graph path checkout formatAmount --max-hops 6Shortest path between two symbols or files, <FROM> and <TO>.
| Option | Description |
|---|---|
--max-hops <MAX_HOPS> | Maximum traversal hops |
hierarchy
ivar graph hierarchy ProviderClass, struct and trait inheritance or implementation for <SYMBOL>. Takes
--repo <REPO>.
dead-code
ivar graph dead-code --limit 50Unreferenced private symbols. Takes --repo <REPO> and --limit <LIMIT>.
complexity
ivar graph complexity --threshold 15Functions and methods ranked by cyclomatic complexity.
| Option | Description |
|---|---|
--threshold <THRESHOLD> | Minimum complexity, default 10 |
--repo <REPO> | Limit to one repository |
--limit <LIMIT> | Maximum items |
Visualise
view
ivar graph view --repo api --depth 2Interactive viewer served on a loopback port.
| Option | Description |
|---|---|
--repo <REPO> | Focus on a repository |
--symbol <SYMBOL> | Focus on a symbol |
--file <FILE> | Focus on a file path |
--impact <IMPACT> | Focus on the transitive impact of a symbol |
--depth <DEPTH> | Neighborhood depth, 1 to 2 |
--limit <LIMIT> | Nodes loaded initially, 1 to 500 |
--no-open | Do not open the browser |
--port <PORT> | Port to listen on; an ephemeral port if omitted |
viz
ivar graph viz --output graph.htmlWrite a standalone HTML visualizer with no dependencies.
| Option | Description |
|---|---|
-o, --output <OUTPUT> | Output path, default graph.html |
--repo <REPO> | Limit to one repository |
MCP server
ivar graph mcp --tools allServes the graph over MCP on stdio.
| Option | Description |
|---|---|
--tools <TOOLS> | explore (default) advertises only graph_explore; all advertises every tool |
MCP tools
| Tool | What it returns |
|---|---|
graph_explore | Line-numbered source of the relevant files, who depends on them, and the call path between named symbols. Takes query, paths, repo, format |
get_callers | Every call site and type use of a symbol across repos, where it is defined, and which files import it |
get_callees | Every outgoing call a symbol makes |
get_file_outline | Symbols and imports declared in one file, with line numbers |
get_affected_tests | Test files transitively reachable from changed source files |
get_path | Shortest call or import chain between two symbols |
get_impact | Everything transitively affected by changing a symbol |
refresh_index | Force a reindex now; rarely needed while a watcher leader is running |
get_dead_code | Unreferenced private symbols |
get_complexity | Functions ranked by cyclomatic complexity |
get_hierarchy | Inheritance and implementation hierarchy of a symbol |