Found during dogfooding v3.9.4
Severity: Medium
Command: codegraph watch
Every other command that operates on the graph DB accepts --db <path> to point at a DB outside the current working directory (build, stats, query, fn-impact, impact, etc.). watch does not — it rejects the flag with error: unknown option '--db' and only supports the positional [dir].
Reproduction
npx codegraph watch --db /abs/path/to/graph.db
# error: unknown option '--db'
Expected behavior
watch --db <path> <dir> should start the watcher against <dir> and write incremental updates to <path>, matching the behavior of build --db.
Actual behavior
Flag is rejected.
Impact
Users running watch mode from one directory against a graph DB in another (common in monorepo setups and MCP multi-repo workflows) must cd to the repo root, which defeats the purpose of having the --db flag in the other commands.
Suggested fix
Wire --db <path> into the watch command in src/cli.ts the same way it's wired in build, and thread it down to the watcher's DB handle.
Found during dogfooding v3.9.4
Severity: Medium
Command:
codegraph watchEvery other command that operates on the graph DB accepts
--db <path>to point at a DB outside the current working directory (build, stats, query, fn-impact, impact, etc.).watchdoes not — it rejects the flag witherror: unknown option '--db'and only supports the positional[dir].Reproduction
npx codegraph watch --db /abs/path/to/graph.db # error: unknown option '--db'Expected behavior
watch --db <path> <dir>should start the watcher against<dir>and write incremental updates to<path>, matching the behavior ofbuild --db.Actual behavior
Flag is rejected.
Impact
Users running watch mode from one directory against a graph DB in another (common in monorepo setups and MCP multi-repo workflows) must
cdto the repo root, which defeats the purpose of having the--dbflag in the other commands.Suggested fix
Wire
--db <path>into thewatchcommand insrc/cli.tsthe same way it's wired inbuild, and thread it down to the watcher's DB handle.