Skip to content

CLI Reference

Terminal window
npm install -g @intentweave/cli
iw --version

Or with npx:

Terminal window
npx @intentweave/cli <command>

Initialize an IntentWeave workspace.

Terminal window
iw init [directory]

Creates a .iw/ directory with config, cache, and index storage.

Build the CARI index.

Terminal window
iw index build [options]
OptionDefaultDescription
--depth <mode>structuredstructured or full (body text + IDF)
--include <glob>Only index matching files
--exclude <glob>Skip matching files
-v, --verboseoffShow per-stage progress

Ranked file retrieval.

Terminal window
iw index retrieve <query> [options]
OptionDefaultDescription
--limit <n>10Maximum results
--scope <type>allcode, docs, or all

Cross-layer connection discovery.

Terminal window
iw index connections <entity> [options]
OptionDefaultDescription
--limit <n>15Maximum connections
--include <type>alldoc_cooc, co_change, code_import

CI drift detection.

Terminal window
iw index check [options]
OptionDefaultDescription
--changed <files...>Changed files
--severity <level>infoinfo, warning, critical
-f, --formattexttext, json, github

Corpus-wide health dashboard.

Terminal window
iw index report

Incremental index update.

Terminal window
iw index update [-v]

Extract knowledge from documents.

Terminal window
iw run [files...] [options]
OptionDefaultDescription
-t, --track <track>mainmain, open, both
--provider <name>smart-mocksmart-mock, openai
--model <name>gpt-4o-miniOpenAI model
-i, --incrementaloffContent-addressed cache
--persistoffAuto-persist to Neo4j
--forceoffIgnore cache
-p, --profile <name>standardExtraction profile
--concurrency <n>5Parallel LLM calls
--from-fx <source>Skip FX, reuse cached output
-v, --verboseoffStage details

Query the knowledge graph.

Terminal window
iw query <question> [options]
iw query --cypher <cypher> [options]
OptionDefaultDescription
-s, --sessionNeo4j session scope
-f, --formattabletable, json
-o, --outputWrite to file
-v, --verboseoffShow generated Cypher

Build RAG context.

Terminal window
iw context <topic> [options]
iw context -e <entity> [options]
iw context --all [options]
OptionDefaultDescription
-s, --sessionSession scope
-e, --entitySeed entity
--hops <n>2Expansion depth
--alloffDump everything
--code-refsoffInclude source references
-f, --formattexttext, json
-o, --outputWrite to file

Semantic impact analysis.

Terminal window
iw impact <files...> [options]
OptionDefaultDescription
-s, --sessionSession scope
--hops <n>2Ripple depth
-f, --formattextOutput format
-o, --outputWrite to file

Documentation freshness analysis.

Terminal window
iw doc-health [files...] [options]
OptionDefaultDescription
-s, --sessionSession scope
-f, --formattextOutput format
-o, --outputWrite to file

Write to Neo4j.

Terminal window
iw persist [run-id] [options]
OptionDefaultDescription
--latestoffPersist most recent run
--file <path>Persist from specific file
-v, --verboseoffDetails

Cross-layer code linking.

Terminal window
iw xlink [directory] [options]
OptionDefaultDescription
-s, --sessionSession scope
--persistoffWrite links to Neo4j
-v, --verboseoffDetails

Start MCP server for GitHub Copilot.

Terminal window
iw mcp [options]
OptionDefaultDescription
-s, --sessionDefault session
-v, --verboseoffLog invocations

VariableDefaultDescription
NEO4J_URIbolt://localhost:7687Neo4j URI
NEO4J_USERNAMEneo4jNeo4j user
NEO4J_PASSWORD(required for KG)Neo4j password
NEO4J_DATABASEneo4jNeo4j database
IW_SESSIONdefaultDefault session ID
OPENAI_API_KEY(optional)For --provider openai + NL queries
IW_LLM_MODELgpt-4o-miniLLM model