Skip to content

bug: build command rejects --db flag, breaking workflow with non-default DB locations #1177

@carlos-alm

Description

@carlos-alm

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

  1. Dogfooding workflows need to build the source repo without overwriting the user's existing .codegraph/graph.db (which production hooks rely on).
  2. Multi-repo registry workflows can have DBs in nonstandard locations.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions