Why Dolt?
- Native version control — cell-level diffs and merges, not line-based
- Multi-writer support — server mode enables concurrent agents
- Built-in history — every write creates a Dolt commit
- Native branching — Dolt branches independent of git branches
- Single-binary option — embedded mode for solo users (no server needed)
Getting Started
Install Dolt (Server Mode Only)
Embedded mode includes everything in thebd binary; no separate Dolt install
is needed. Install the standalone dolt CLI only when you want to run server
mode or work directly with the database via dolt sql.
New Project
Migrate from SQLite (Legacy)
If upgrading from an older version that used SQLite:Note: TheMigration creates backups automatically. Your original SQLite database is preserved asbd migrate --to-doltcommand was removed in v0.58.0. For pre-0.50 installations with JSONL data, use the migration script:See Troubleshooting if you encounter connection errors after migration.
beads.backup-pre-dolt-*.db.
Modes of Operation
Embedded Mode (Solo / Standalone)
In-process Dolt engine — no separate server needed. This is the default for standalone Beads users. Thebd binary includes everything; just bd init and go.
- Single-writer (one process at a time)
- Data lives in
.beads/embeddeddolt/alongside your code - Push to GitHub with
bd dolt push— code and issues in one repo - Zero ops: no server, no ports, no PID files
Server Mode (Multi-Writer / Orchestrator)
Connects to a runningdolt sql-server for multi-client access.
| Flag | Env Var | Default |
|---|---|---|
--server-host | BEADS_DOLT_SERVER_HOST | 127.0.0.1 |
--server-port | BEADS_DOLT_SERVER_PORT | 3307 |
--server-socket | BEADS_DOLT_SERVER_SOCKET | (none; uses TCP) |
--server-user | BEADS_DOLT_SERVER_USER | root |
BEADS_DOLT_PASSWORD | (none) |
--server-socket to connect via a Unix socket
instead of TCP. This avoids port conflicts between concurrent projects and is
useful in sandboxed environments (e.g., Claude Code) where file-level access
control is simpler than network allowlists. The Dolt server must be started
with dolt sql-server --socket <path>. Auto-start is not supported in socket
mode.
Switch to server mode when you need:
- Multiple agents writing simultaneously
- Orchestrator multi-rig setups
- Federation with remote peers
Maintenance — bd prune and bd purge
bd prune permanently deletes closed non-ephemeral beads to reclaim storage
and shrink auto-exports. bd purge does the same for ephemeral beads (wisps,
transient molecules). Both require --force to execute.
bd prune automatically skips closed beads
whose ID appears in the description, notes, or comments of any open or
in-progress bead. This prevents accidental deletion of ADR, decision, and
verification beads that downstream work still cites. Use
--ignore-references to override when cleaning up known-stale references:
bd purge is unaffected — ephemeral beads’ references are themselves
transient. For full Dolt storage reclaim after deleting many rows, follow
with bd flatten.
Migrating Between Backends
You can migrate data between embedded mode and server mode usingbd backup.
Both directions preserve full Dolt commit history.
bd export is not a substitute for this flow. JSONL exports contain issue
records from the issues table for migration and interoperability; they do not
capture Dolt branches, full commit history, working-set state, or non-issue
tables. Use bd backup or a manual Dolt backup when you need a restorable
database backup.
Server → Embedded
-
Create a backup from the server-mode project:
-
Create a new embedded-mode project and restore:
--forceoverwrites the freshly-initialized database with the backup contents. The restore automatically:- Updates
metadata.jsonto match the restored project identity - Registers the backup directory for future
bd backup sync - Backfills the embedded migration tracker (
schema_migrations)
- Updates
-
Verify:
Embedded → Server
-
Create a backup from the embedded-mode project:
-
Create a new server-mode project and restore:
-
Verify:
Backup Commands Reference
| Command | Description |
|---|---|
bd backup init <path> | Register a backup destination (filesystem or DoltHub URL) |
bd backup sync | Push database to the configured backup destination |
bd backup restore [path] | Restore from a backup directory (--force to overwrite) |
bd backup remove | Unregister the backup destination |
bd backup status | Show backup configuration and last sync time |
Notes
- Data locations differ between modes:
.beads/embeddeddolt/(embedded) vs.beads/dolt/(server) - The backup directory is a full Dolt backup, not an
issues.jsonlexport — it can be on a local drive, NAS, or DoltHub - You can also migrate via Dolt remotes (
bd dolt push/bd dolt pull) if both projects share a remote
Federation (Peer-to-Peer Sync)
Federation lets independent Dolt-backed workspaces (“towns”) sync issues directly with each other viabd federation add-peer/sync/status,
without a central hub. Credentials are AES-256 encrypted and stored locally.
See Federation Setup Guide for the full setup guide, including
peer configuration, sovereignty tiers, sync/status/topology details, and
troubleshooting.
Dolt Remotes
Usebd dolt remote add to configure remotes. This ensures the running Dolt SQL
server sees the remote immediately. Remotes added directly with the dolt CLI
are written to filesystem config and may not be visible to the server until
restart.
Push/Pull
bd dolt remote add registers the remote through the Dolt store API. SQL
remotes are the source of truth for bd dolt remote list, bd dolt push, and
bd dolt pull.
For git-protocol remotes, credentialed external-server remotes, and cloud
remotes whose credentials are only present in the current shell, bd dolt push
and bd dolt pull automatically materialize a matching local CLI remote before
using the dolt CLI transport. The CLI remote is a local transport mirror, not
a separate configuration source.
If you are upgrading from an older beads version and previously added remotes
with raw dolt remote add, re-register them with bd dolt remote add <name> <url> so they are visible through SQL. bd doctor reports legacy CLI-only or
mismatched CLI remotes under Dolt Remote Migration.
Sharing a Git repo: Dolt stores data underrefs/dolt/data, separate from standard Git refs (refs/heads/,refs/tags/). You can safely point agit+ssh://remote at the same repository as your project source code. See Dolt Git Remotes.
List/Remove Remotes
Contributor Onboarding (Clone Bootstrap)
When someone clones a repository that uses Dolt backend:- Run
bd bootstrapin the clone - If the git remote has
refs/dolt/data(pushed viabd dolt push),bd bootstrapauto-detects it and clones the database from the remote - Work continues normally — all existing issues are available
bd bootstrap. The auto-detect:
- Probes
originforrefs/dolt/data - Clones the Dolt database from the remote (instead of creating a fresh one)
- Configures the Dolt remote for future
bd dolt push/pull
sync.remote is set in .beads/config.yaml, that takes precedence
over auto-detection. Any Dolt-compatible remote URL is supported (DoltHub,
S3, GCS, file, or git). On brand-new projects, bd init auto-detects
git origin and persists it as sync.remote, so the first bd dolt push
publishes Dolt history to refs/dolt/data on the same git remote.
Verifying Bootstrap Worked
Troubleshooting
Server Not Running
Symptom: Connection refused errors when using server mode.Bootstrap Not Running
Symptom:bd list shows nothing on fresh clone.
Check:
Database Corruption
Symptom: Queries fail, inconsistent data. Diagnosis:-
Repair what’s fixable:
-
Rebuild from remote:
Already Committed .beads/dolt/ to Git
If you accidentally committed a Dolt data directory:
- Update gitignore:
bd doctor --fix - Remove it from git tracking:
git rm --cached -r .beads/dolt/(or.beads/embeddeddolt/) - Commit the removal:
git commit -m "fix: remove accidentally committed dolt data" - To purge from history, use BFG Repo-Cleaner or
git filter-repo
Lock Contention (Embedded Mode)
Symptom: “database is locked” errors. Embedded mode is single-writer (enforced via file lock). If you need concurrent access, switch to server mode. See Migrating Between Backends.Configuration Reference
Environment Variables
| Variable | Purpose |
|---|---|
BEADS_DOLT_PASSWORD | Server mode password (highest priority) |
BEADS_CREDENTIALS_FILE | Path to credentials file (overrides default location) |
BEADS_DOLT_SERVER_MODE | Enable server mode (set to “1”) |
BEADS_DOLT_SERVER_HOST | Server host (default: 127.0.0.1) |
BEADS_DOLT_SERVER_PORT | Server port (default: 3307, or 3308 in shared mode) |
BEADS_DOLT_SERVER_TLS | Enable TLS (set to “1” or “true”) |
BEADS_DOLT_SERVER_USER | MySQL connection user |
BEADS_DOLT_SHARED_SERVER | Enable shared server mode (set to “1” or “true”) |
DOLT_REMOTE_USER | Clone/push/pull auth user |
DOLT_REMOTE_PASSWORD | Clone/push/pull auth password |
BD_DOLT_AUTO_COMMIT | Override auto-commit setting |
Credentials File
For multi-server setups, you can store passwords in an INI-style credentials file instead of juggling environment variables per project. Passwords are looked up by[host:port] section, so each project automatically gets the right password based
on its configured server.
Password resolution order:
BEADS_DOLT_PASSWORDenv var (highest priority, existing behavior)- Credentials file lookup by
[host:port](using the resolved runtime port) - Empty string (no password)
[host:port] used for credential lookup matches the
resolved runtime port (from the port file, env var, or config — in that priority
order), not necessarily the port stored in metadata.json. This matters when using
IAP tunnels: if your tunnel maps remote:3307 to localhost:3308, store your password
under [127.0.0.1:3308] and the credentials file will match the actual connection.
Default location: ~/.config/beads/credentials (Linux/macOS), %APPDATA%\beads\credentials (Windows)
Override location: Set BEADS_CREDENTIALS_FILE env var.
File format:
Dolt Version Control
Dolt maintains its own version history, separate from Git:Auto-Commit Behavior
In embedded mode (standalone default), eachbd write command creates a Dolt commit:
DOLT_COMMIT after every write
under concurrent load causes ‘database is read only’ errors.
Override for batch operations (embedded) or explicit commits (server):
Server Management (Orchestrator)
The orchestrator provides integrated Dolt server management:Standalone-to-managed-city handoff
When an existing standalone project is later added to a managed city or orchestrator, avoid letting two Dolt servers become sources of truth for the same beads database name. A common split-brain symptom is that.beads/dolt-server.port
points at the old standalone server while the shell environment points bd at
the managed server with BEADS_DOLT_PORT or BEADS_DOLT_SERVER_PORT.
Check before migrating:
bd doctor warns when the runtime managed port differs from the local port
file. The warning is intentionally diagnostic only; do not delete the local port
file until the standalone store has been exported and imported into the managed
server.
Safe manual handoff:
bd doctor shows one healthy store and the imported issue count is
correct, archive the old local Dolt data directory instead of deleting it
immediately. Keep the backup until the managed city has been pushed or otherwise
snapshotted.
Shared Server Mode
On machines with multiple beads projects, each project normally starts its own Dolt server. Shared server mode runs a single Dolt server at~/.beads/shared-server/ that serves all projects:
- No port conflicts between projects (single server on port 3308, avoids orchestrator on 3307)
- Reduced resource usage (one process instead of many)
- Automatic database isolation (each project uses its own database name)
- Server state files (PID, port, lock, log) live in
~/.beads/shared-server/ - Dolt data directory:
~/.beads/shared-server/dolt/ - Each project’s database is stored as a subdirectory (e.g.,
~/.beads/shared-server/dolt/myproject/) - The file lock mechanism ensures safe concurrent access from multiple projects
- Default port is 3308 (not 3307) to avoid conflict with the orchestrator. Override with
BEADS_DOLT_SERVER_PORTordolt.portin config.yaml
bd init --shared-server.
Data Location (Orchestrator)
Central Dolt Server (macOS LaunchAgent)
If you do not use the orchestrator but still want a single persistent Dolt server for multiple projects on macOS, run a customLaunchAgent instead of
spawning per-project embedded instances.
Why Not brew services start dolt?
After installing Dolt with brew install dolt, the natural next step is
brew services start dolt. However, the Homebrew formula runs
dolt sql-server without the --config flag, and Dolt does not auto-discover
config.yaml from its working directory. The config file must be passed
explicitly with --config <file>.
Setup with a Custom LaunchAgent
Install Dolt and initialize its data directory:Advanced Dolt Usage
Thedolt CLI lets you operate directly on the database for power-user
workflows. The data directory depends on your mode: .beads/embeddeddolt/
(embedded) or .beads/dolt/ (server).
Branching
Time Travel
Diff and Blame
Migration Cleanup
After successful migration from SQLite, you may have backup files:See Also
- Sync Concepts - The conceptual model behind cross-machine sync (Dolt source of truth, wire format, anti-patterns)
- Sync Setup Guide - Setting up sync across multiple computers
- Federation Setup Guide - Peer-to-peer federation setup
- Configuration - Full configuration reference
- Dependencies and Gates - Dependencies and gates
- Git Integration - Git worktrees and protected branches
- Troubleshooting - General troubleshooting