Usage
Arguments
| Argument | Description | Default |
|---|---|---|
paths | Files, directories, or globs to scan | current workspace |
paths, DevGraph scans the current workspace root.
Options
| Option | Description |
|---|---|
--out-dir <dir> | Output directory for generated artifacts |
--force | Bypass the shrink guard if a rebuild gets much smaller |
--json | Print the sync result as JSON |
--help | Show help |
What Build Does
devgraph build is a one-shot sync into local memory:
- Collect inputs from files, directories, or globs
- Apply default ignores and
.devgraphignore - Hash candidate files
- Compare against
.devgraph/manifest.json - Re-extract only changed files
- Merge per-file cache artifacts into
.devgraph/graph.json - Write the updated manifest and graph back to disk
Ignore Rules
DevGraph excludes common noise by default, including:.git/.devgraph/node_modules/dist/build/.next/examples/internal-docs/apps/docs/- static exports and public assets
- lockfiles and generated metadata
.devgraphignore file with .gitignore syntax to exclude more paths.
Incremental Cache
Build stores per-file extraction state in.devgraph/cache/. manifest.json records file hashes and extraction version so unchanged files can be reused.
Examples
Build the current repo:Output
Build writes the following files to.devgraph/:
| File | Description |
|---|---|
manifest.json | Indexed paths, hashes, kinds, extraction version, and sync time |
graph.json | Canonical code-memory graph |
cache/*.json | Per-file extracted artifacts |
Related Commands
devgraph watchto keep the graph fresh during active workdevgraph queryfor focused retrieval against the graphdevgraph statusfor index health and freshness