Skip to content

CLI Command Reference ​

igraph init ​

Initialize project configuration.

bash
igraph init [options]
OptionDescription
-f, --forceForce overwrite existing config file

Generates .igraph/config.json in the current directory. Skips if config already exists; use --force to overwrite.

igraph build ​

Build the code knowledge graph.

bash
igraph build [options]
OptionDescription
--incrementalExplicit incremental mode (auto-detected by default)
--dry-runPreview parse stats without writing to DB
--no-llmSkip LLM summaries and vectorization, use heuristic fallback

First run performs a full build; subsequent runs auto-increment (based on SHA-256 diff).

igraph rebuild ​

Clear database and rebuild from scratch.

bash
igraph rebuild [options]
OptionDescription
--fullFull rebuild (default behavior)
--dry-runPreview only, no deletion or writing
--no-llmHeuristic fallback rebuild

Use when switching LLM models or modifying parser config.

igraph status ​

View graph status.

bash
igraph status

Output includes:

  • File count, node count, edge count
  • Vector index status
  • Mounted multimodal resources
  • Build progress

igraph query ​

Natural language query against the code graph.

bash
igraph query <question> [options]
OptionDescription
--top-k <n>Number of results to return (default 5)
--jsonOutput results in JSON format

Examples:

bash
igraph query "where is user auth implemented"
igraph query "JWT validation" --top-k 10 --json

igraph eval ​

Evaluate retrieval quality.

bash
igraph eval [options]
OptionDescription
--test-set <path>Test set file path
--top-k <n>Top-K value for evaluation

Outputs Recall@K, MRR, and latency metrics.

igraph serve ​

Start the MCP Server (stdio transport).

bash
igraph serve

Starts with the current working directory as the repository root, exposing 4 read-only retrieval tools. Usually not invoked directly — called automatically by AI assistants via MCP config.

igraph register ​

Register the MCP Server with AI assistant configs.

bash
igraph register [options]
OptionDescription
-t, --target <targets>Target assistants (auto / claude / cursor, comma-separated), default auto
-g, --globalWrite to global config instead of project-level

auto mode auto-detects installed Claude Code and Cursor.

Examples:

bash
igraph register                       # Auto-detect and register
igraph register --target claude       # Claude Code only
igraph register --target cursor       # Cursor only
igraph register --global              # Write to global config

igraph unregister ​

Remove MCP Server registration from AI assistant configs.

bash
igraph unregister [options]
OptionDescription
-t, --target <targets>Target assistants (auto / claude / cursor, comma-separated), default auto
-g, --globalRemove from global config

igraph mount prd ​

Mount a PRD document.

bash
igraph mount prd <path> [options]
OptionDescription
--top-k <n>Association match count

Supported formats: .md .txt .pdf .docx

igraph mount db ​

Mount a DB Schema.

bash
igraph mount db <path> [options]
OptionDescription
--top-k <n>Association match count

Supported formats: .sql .ddl .json .xlsx

igraph gui ​

Launch the Web GUI.

bash
igraph gui [options]
OptionDescription
-p, --port <port>HTTP port (default 3210)
--host <host>Listen address (default 127.0.0.1)
--openAuto-open browser

Opens a browser-based management panel with project dashboard, graph structure browser, query simulation, and configuration management. See Web GUI for details.

igraph config ​

Manage global configuration (~/.igraph/config.json).

igraph config set ​

bash
igraph config set <key> <value>

Set a global config value. Supported keys:

KeyDescriptionExample
apiKeyAPI Keyigraph config set apiKey sk-xxx
embeddingBaseURLEmbedding service URLigraph config set embeddingBaseURL http://localhost:8080/v1
llmBaseURLLLM service URLigraph config set llmBaseURL https://api.openai.com/v1
section.fieldAny config fieldigraph config set llm.model gpt-4o-mini

igraph config get ​

bash
igraph config get <key>

Get a global config value (credentials are masked).

igraph config list ​

bash
igraph config list

List all global config values.

igraph config path ​

bash
igraph config path

Print the global config file path (~/.igraph/config.json).

Released under the MIT License