Found during dogfooding v3.10.1-dev.80
Severity: Low (UX inconsistency)
Command: codegraph build [dir] --db <path>
Reproduction
codegraph build /path/to/repo --db /tmp/my-graph.db
# → error: unknown option '--db'
Expected
Every other DB-scoped command accepts -d/--db to point at a graph.db outside cwd:
stats --db <path> ✓
query <name> --db <path> ✓
where <name> --db <path> ✓
watch --db <path> ✓ (added in #987 for exactly this reason — "restores consistency with every other DB-scoped command")
- ...
But build (the most DB-scoped command) silently writes to <dir>/.codegraph/graph.db with no way to override.
Why this matters
- Dogfooding workflows need to build the source repo without overwriting the user's existing
.codegraph/graph.db (which production hooks rely on).
- Multi-repo registry workflows can have DBs in nonstandard locations.
- The asymmetry surprises users — they assume
--db works on build because it works on every other command that touches the DB.
Suggested fix
Add -d, --db <path> to the build command in src/cli/commands/build.ts. Wire it through to the build pipeline (the option already flows correctly for the other commands via findDbPath(customPath)).
PR #987's rationale applies here verbatim — the asymmetry is the bug, the fix is one option and one wire-through.
Found during dogfooding v3.10.1-dev.80
Severity: Low (UX inconsistency)
Command:
codegraph build [dir] --db <path>Reproduction
codegraph build /path/to/repo --db /tmp/my-graph.db # → error: unknown option '--db'Expected
Every other DB-scoped command accepts
-d/--dbto point at a graph.db outside cwd:stats --db <path>✓query <name> --db <path>✓where <name> --db <path>✓watch --db <path>✓ (added in #987 for exactly this reason — "restores consistency with every other DB-scoped command")But
build(the most DB-scoped command) silently writes to<dir>/.codegraph/graph.dbwith no way to override.Why this matters
.codegraph/graph.db(which production hooks rely on).--dbworks onbuildbecause it works on every other command that touches the DB.Suggested fix
Add
-d, --db <path>to thebuildcommand insrc/cli/commands/build.ts. Wire it through to the build pipeline (the option already flows correctly for the other commands viafindDbPath(customPath)).PR #987's rationale applies here verbatim — the asymmetry is the bug, the fix is one option and one wire-through.