CLI
graft build [dir] # build graft/ from the code at [dir]: wiring graph + per-file cards (no LLM, no key)graft build --deep # add the LLM layer: concept nodes + per-symbol summary/crux (cached)graft build --extensions .ts .py # only include these code extensionsgraft build --no-reuse # re-parse every file instead of replaying unchanged ones from cacheQuery & Orient
Section titled “Query & Orient”graft ask "<task>" [dir] # query the graph — ranked nodes + exact file:line (no LLM, no key)graft ask "<task>" --json # machine-readable resultgraft ask "<task>" --in <scope> # narrow to one sub-project of a monorepo/multi-repo folder (see below)
graft skeleton <file> [dir] # every signature in one file, no bodies — the API surface for ~1/10th the tokens (no LLM, no key)
graft callers <symbol> [dir] # who calls/references/imports/implements/extends a symbol (no LLM, no key)graft callers <symbol> --direction out # the reverse: what the symbol itself calls/references (was `graft callees`)graft callers <symbol> -d N # walk transitively out to depth N — full blast radius (was `graft impact`)
graft grep "<regex>" [dir] # exhaustive regex search over indexed files, grouped by enclosing symbol (no LLM, no key)graft grep "<regex>" --in <path> # narrow to files at or under this path prefixgraft grep "<regex>" -i --fixed # case-insensitive; treat the pattern as a literal string, not a regex
graft map [dir] # token-budgeted repo orientation — dir clusters, hubs, hotspots (no LLM, no key)graft map --max-dirs N # raise/lower the number of directories shownVerify & Refresh
Section titled “Verify & Refresh”graft check [dir] # fail (exit 1) if graft/ has drifted from the code (never auto-refreshes — it's the drift report)graft check --json # print the drift report as JSON
# ask / skeleton / callers / grep / map all refresh the graph first if the working tree moved:# --no-refresh # answer from the graph exactly as it is on disk# GRAFT_NO_REFRESH=1 # same, for every command# GRAFT_REFRESH=hash # hash every file instead of trusting size+mtimeVisualize
Section titled “Visualize”graft viz [dir] # see the graph: serves an interactive viewer on localhostgraft viz --port 5000 --no-open # pick a port; don't auto-open the browserSetup & Maintenance
Section titled “Setup & Maintenance”graft init [dir] # pick which agents to wire (prompts on a terminal; writes nothing until you choose)graft init --dry-run # list every file it would touch, then exitgraft init --agents cursor kiro # wire only these agents, no prompt (ids: agents, cursor, gemini, copilot, kiro, windsurf, adal, claude)graft init --yes # no prompt; wire every detected agentgraft init --no-global # skip writes outside this repo (~/.codex/ config + hooks)graft init --no-build # wire the files only; don't build the graphgraft init --all-agents # wire every known agent, detected or notgraft init --list-agents # list known agent ids and exit
graft version # print the installed + latest published npm versiongraft upgrade # npm install -g the latest published versionGlobal Options
Section titled “Global Options”graft --dir <path> # use a context dir other than <repo>/graftgraft --version, -v # print the installed version and exitMethod calls resolve through the receiver’s type — constructor assignments
(self.router = APIRouter()) and type annotations, not just the call-site
name — so callers/grep --in return calls bound to the right
type on method-heavy code, not every method anywhere with that name.