Skip to content

CLI

Terminal window
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 extensions
graft build --no-reuse # re-parse every file instead of replaying unchanged ones from cache
Terminal window
graft ask "<task>" [dir] # query the graph — ranked nodes + exact file:line (no LLM, no key)
graft ask "<task>" --json # machine-readable result
graft 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 prefix
graft 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 shown
Terminal window
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+mtime
Terminal window
graft viz [dir] # see the graph: serves an interactive viewer on localhost
graft viz --port 5000 --no-open # pick a port; don't auto-open the browser
Terminal window
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 exit
graft 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 agent
graft init --no-global # skip writes outside this repo (~/.codex/ config + hooks)
graft init --no-build # wire the files only; don't build the graph
graft init --all-agents # wire every known agent, detected or not
graft init --list-agents # list known agent ids and exit
graft version # print the installed + latest published npm version
graft upgrade # npm install -g the latest published version
Terminal window
graft --dir <path> # use a context dir other than <repo>/graft
graft --version, -v # print the installed version and exit

Method 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.