Skip to main content

Usage

devgraph build [paths...] [options]

Arguments

ArgumentDescriptionDefault
pathsFiles, directories, or globs to scancurrent workspace
If you omit paths, DevGraph scans the current workspace root.

Options

OptionDescription
--compare <path>Compare the current graph output against a previous graph.json
--out-dir <dir>Output directory for generated files
--helpShow help

What Build Does

devgraph build is the canonical hybrid pipeline:
  1. Collect inputs from files, directories, or globs
  2. Apply default ignores and .devgraphignore
  3. Classify and extract deterministic graph data
  4. Merge service metadata from devgraph-* blocks with file-level graph structure
  5. Analyze the graph and emit reports plus diagrams
devgraph-service blocks remain the authoritative service layer. The rest of the build adds file nodes and typed graph edges around that layer.

Ignore Rules

DevGraph applies default exclusions such as:
  • .git/
  • .devgraph/
  • node_modules/
  • dist/
  • build/
  • .next/
  • coverage outputs
  • obvious generated artifacts
You can add a repo-local .devgraphignore file with .gitignore syntax to exclude more paths.

Incremental Cache

Build stores file extraction state in .devgraph/cache/manifest.json. The cache is keyed by file path, file hash, and extractor version so unchanged files can be skipped on later builds.

Examples

Build the current repo:
devgraph build .
Build selected paths:
devgraph build apps packages docs/**/*.md
Build and compare against an earlier graph:
devgraph build . --compare .devgraph/graph.json

Output

Build writes the following files to .devgraph/:
FileDescription
graph.jsonMachine-readable output containing top-level services, apis, and knowledgeGraph
summary.mdHuman-readable service overview
GRAPH_REPORT.mdHybrid graph analysis with god nodes, surprising connections, bridge nodes, and coverage gaps
agents/*.mdPer-service context files for coding assistants
system.mmdMermaid diagram of the build pipeline and service relationships
codemap.mmdMermaid diagram of owned paths and file relationships
At a high level, graph.json contains:
  • top-level services
  • top-level apis
  • knowledgeGraph.nodes
  • knowledgeGraph.edges
  • knowledgeGraph.communities
  • knowledgeGraph.analysis