utilities
Beads Dolt Init
Use when a repository needs beads initialized or recovered with the Dolt backend, especially when `.beads/config.yaml` already exists, an Azure `sync.git-remote` is configured, or `bd doctor` reports repo fingerprint mismatches, empty remotes, or missing local Dolt state.
Beads + Dolt Initialization
Purpose
Use this skill when a repository needs beads initialized or recovered with the current Dolt-based workflow.
This skill is specifically tuned for the common Trimble setup where:
.beads/config.yamlalready existssync.git-remotepoints at an Azure Dolt remote such asaz://...- the remote may be empty on first use
- agents need a non-destructive, verifiable setup path
When to Use
- A repo has
.beads/config.yamlbutbd statussays no beads database exists bd bootstrapfails because the configured Azure remote has no Dolt data yetbd doctorreports missingmetadata.json, missing database, or failed Dolt connectionbd doctorreportsDatabase belongs to different repositoryeven though the configured Dolt remote looks correct- You need to seed a fresh Azure Dolt remote from a new local beads database
- You need the exact safe sequence for
bootstrap,init, Dolt server startup, and remote push
Non-Goals
- Do not wipe an existing healthy beads database just to re-run setup
- Do not use legacy SQLite-era instructions
- Do not invent
bdcommands or remote-management syntax; usebd dolt remote ...
Preflight
Run these checks first:
git --no-pager status --short --branch
bd version
bd doctor --json || true
bd dolt remote list
bd bootstrap --dry-run --json
Then inspect .beads/config.yaml and confirm:
- the expected
issue-prefix - whether
sync.git-remoteis present - whether Dolt auto-commit or other repo-specific settings already exist
- whether
bd dolt remote listmatches the configured remote exactly (originURL should equalsync.git-remote)
Decision Rules
Case 1: Existing database already present
If bd bootstrap --dry-run --json reports action: "none" or bd status works, do not reinitialize immediately.
If bd doctor is clean, verify and stop:
bd status --json
bd where
bd dolt remote list
If bd doctor reports a repository fingerprint mismatch, follow Case 1b instead of stopping here.
If bd doctor reports a different error, continue to the matching case below instead of stopping just because bd status works.
Case 1b: Existing database present, but repo fingerprint mismatch
If bd status --json works and bd dolt remote list matches .beads/config.yaml, but bd doctor reports an error like:
Database belongs to different repository
Prefer the least-destructive repair first: execute Path C: Repo fingerprint mismatch recovery.
If the remote reported by bd dolt remote list does not exactly match .beads/config.yaml, stop and reconcile remote configuration first. Do not run bd migrate --update-repo-id --yes against an ambiguous or unexpected remote.
Case 2: Remote configured and contains data
If bd bootstrap --dry-run --json reports action: "sync" and the remote is already seeded, prefer bootstrap:
bd bootstrap --json
If bd bootstrap prompts Proceed? [Y/n], only confirm after the dry-run output matches the intended remote and target directory.
Case 3: Remote configured but empty
If bootstrap fails with an error like:
clone failed; remote at that url contains no Dolt data
treat this as an empty remote, not a bad configuration.
The correct recovery is:
- Start the project Dolt server
- Initialize a fresh local beads database
- Keep the configured Dolt remote
- Push local Dolt data to seed the empty remote
Recommended Workflow
Path A: Normal bootstrap from remote
bd bootstrap --dry-run --json
bd bootstrap --json
bd status --json
bd where
bd dolt remote list
Path B: Empty Azure remote fallback
Use this exact sequence when clone-based bootstrap fails because the Azure remote is empty:
bd dolt start
bd init --sandbox --json
bd status --json
bd where
bd dolt remote list
bd dolt push
Why this works:
bd dolt startclears the common "circuit breaker is open" / server-not-running failure modebd init --sandbox --jsonsafely initializes the local Dolt database without destructive re-bootstrap behaviorbd initstill honors.beads/config.yaml, so it can keep/configure the Azure remote asoriginbd dolt pushseeds the remote after local init succeeds
Path C: Repo fingerprint mismatch recovery
Use this when the local beads database exists and the remote is correct, but bd doctor reports a repository fingerprint mismatch:
bd where
bd status --json
bd dolt remote list
bd migrate --update-repo-id --yes
bd doctor --json || true
bd where
bd status --json
bd dolt remote list
bd dolt pull
Why this works:
bd whereshould point at the expected repo-local.beadspath before and after the migrate- the local Dolt/beads database already exists, so re-init is unnecessary
bd migrate --update-repo-idrepairs the local repository binding without discarding beads statebd dolt pullconfirms the clone can talk to the configured remote after the metadata fix
Failure handling:
- If
bd dolt remote listdoes not exactly match.beads/config.yaml, stop and reconcile the remote configuration first. - If
bd migrate --update-repo-id --yesfails, do not keep retrying blindly. Investigate whether the local database actually belongs to a different repository, then return tobd bootstrap --dry-run --jsonand follow Case 2 or Case 3 if re-bootstrap is actually required. - If
bd dolt pullfails after a successful migrate, treat that as a remote/auth/connectivity problem. Verify credentials and remote reachability before considering any local reset.
Interactive Prompts
Some bd commands may still prompt even when using --json.
Common prompts and the correct response:
Proceed? [Y/n]duringbd bootstrap: answerYonly after validating the dry-run planAlready configured as: maintainer / Change role? [y/N]: answerNunless the user explicitly asked to change role
Do not leave the session hanging on prompts. If a command pauses, respond explicitly and continue verification.
Verification Checklist
After initialization or recovery, verify all of the following:
bd status --json
bd where
bd dolt remote list
bd doctor --json
# If a remote is configured:
bd dolt pull
git --no-pager status --short --branch
Success indicators:
bd status --jsonreturns summary data instead of "no beads database found"bd whereshows the.beadsdirectory and Dolt data pathbd dolt remote listshows the expected Azure remote asoriginbd doctor --jsonno longer reports "No dolt database found"bd doctorno longer reports a repository fingerprint mismatchbd dolt pullsucceeds against the configured remote when a remote is configured (for examplePull complete.orAlready up to date.)- the repo branch is pushed if
bd initcreated tracked file changes
Git Persistence
bd init may update tracked files under .beads/ and create local commits as part of setup. Do not leave those changes stranded.
Finish the session with:
git pull --rebase
bd dolt push
git push
git --no-pager status --short --branch
The final git status should show the branch aligned with origin.
Troubleshooting
| Symptom | Meaning | Fix |
|---|---|---|
Error: no beads database found | Repo has config but no local Dolt DB | Start with bd bootstrap --dry-run --json |
clone failed; remote at that url contains no Dolt data | Azure remote exists but is empty | Run the empty-remote fallback flow |
dolt circuit breaker is open | Dolt server is down or unhealthy | bd dolt start, then retry init |
database "<name>" not found on Dolt server | Server is running, but the project DB is not initialized yet | Run bd init --sandbox --json |
Database belongs to different repository | Local beads DB exists, but its stored repo fingerprint does not match this clone | Run bd migrate --update-repo-id --yes, then re-verify remote access |
unknown command "remote" for "bd" | Used an outdated command surface | Use bd dolt remote ... instead |
Rules
- Always run
bd bootstrap --dry-run --jsonbefore mutating setup commands - Prefer
bd bootstrapfirst; fall back to local init only when the remote is empty or bootstrap cannot complete - Prefer
bd migrate --update-repo-id --yesover re-init when the only failure is a repository fingerprint mismatch - Treat an empty remote as recoverable
- Start the Dolt server before retrying if you see circuit-breaker or connection errors
- Verify remote configuration with
bd dolt remote list, not guesswork - Push Dolt data after local init so future sessions can bootstrap from the remote immediately