cmd/bd/main.go, cmd/bd/config.go, and internal/configfile/.
beads has two complementary configuration systems:
- Tool-level configuration (YAML, managed by Viper) — startup flags and tool behavior, stored in
config.yamlfiles. These are user preferences: output format, auto-commit behavior, CLI ergonomics. - Project-level configuration (managed by
bd config) — integration credentials, status maps, and project-specific settings, stored in the Dolt database. Some keys are routed toconfig.yamlinstead (see YAML-only keys below).
bd dolt push. That is also why secrets are refused in the database — see Security.
Dolt is the only storage backend. Embedded mode (the default) stores data at .beads/embeddeddolt/; server mode (bd init --server or BEADS_DOLT_SERVER_MODE=1) uses .beads/dolt/. See Dolt architecture.
Configuration Locations
config.yaml is searched in this order, with later files overriding earlier ones:
~/.beads/config.yaml(legacy user-level, lowest priority)~/.config/bd/config.yaml(user-level; this exact path is checked even on platforms whose native user-config directory differs)<repo>/.beads/config.yaml(project-level, walked up from the current directory)$BEADS_DIR/config.yaml(highest priority, whenBEADS_DIRpoints at a different workspace)
config.local.yaml next to the project config.yaml is also merged in last for machine-specific overrides that should not be committed.
Precedence
For Viper-managed (YAML) keys, highest to lowest:- Command-line flags (e.g.
--json,--db,--actor) - Environment variables (
BD_*, plus a small set of legacyBEADS_*names — see below) config.yamlfiles (in the order listed above)- Built-in defaults
bd config set (Jira, Linear, GitHub, status maps, etc.) live in the Dolt database. They are read at command time and have no env var override.
When a config.yaml value or environment variable shadows a database key, bd config list prints an override warning, and bd config show reports the source of every effective key.
Managing Configuration
bd config set automatically routes the write to the right location: keys in the YAML namespace (see below) are written to the project config.yaml; everything else is written to the Dolt database. beads.role is stored in git config.
Unrecognized keys produce a warning with a did-you-mean suggestion; use the custom.* namespace for user-defined keys.
YAML-only Keys (Startup Settings)
These keys must live inconfig.yaml, not the database, because they are read before the database is opened. Writing them with bd config set automatically updates config.yaml.
The full namespaces routed to YAML are:
routing.*, sync.*, git.*, directory.*, repos.*, external_projects.*, validation.*, lint.*, hierarchy.*, ai.*, backup.*, export.*, dolt.*, federation.*, metrics.*, list.*
lint.* holds lint settings: lint.sections.<type> is a comma-separated, additive list of sections that bd lint additionally requires for issues of that type (built-in required sections still apply; unset means no behavior change).
Plus these individual keys:
no-db, json, db, actor, identity, no-push, no-git-ops, agent.profile, create.require-description, import.auto, import.path, prime.max-memories, prime.max-memory-chars, and the secret keys github.token, gitlab.token, jira.api_token, ado.pat, linear.api_key, linear.oauth_client_id, linear.oauth_client_secret.
Any key whose name contains api_key, api-key, secret, token, or password is treated as a secret: it is refused on git-tracked config.yaml files unless you pass --force-git-tracked. Prefer exporting the value as an environment variable instead (e.g. LINEAR_API_KEY).
Tool-Level Settings (config.yaml)
Routing note:
output.title-length and agents.file are functionally tool-level settings, but bd config set writes them to the Dolt database. They are typically read from config.yaml when set there directly.
bd config show is the source of truth for what’s currently effective on your machine, including provenance.
Dolt History, Backup, and Push
Three post-write behaviors run after each successful write command, in this order: auto-commit, auto-backup, auto-push.Auto-commit: SQL Commits vs Dolt Commits
There are two different kinds of “commit”:- SQL transaction commit — what happens when a
bdcommand updates tables successfully (durable in the Dolt working set). - Dolt version-control commit — what records those changes into Dolt history (visible in
bd history, and what push/pull/merge workflows operate on).
dolt.auto-commit: on), bd creates a Dolt history commit after each successful write command, so changes are never left only in the working set. The cost is more Dolt commits over time — one per write command — which is intentional; use bd compact to squash old history.
Disable for a single command:
config.yaml:
Auto-backup
Periodic Dolt-native backup to.beads/backup/ provides a recovery path independent of the live database. Local Dolt commits (via dolt.auto-commit) remain the primary safety net; backup is a secondary layer. Unlike bd export or .beads/issues.jsonl, this is a full database backup: it preserves tables, branches, commit history, and working-set data.
- After each write command,
bdcompares the Dolt HEAD commit hash against the last backup state. - If data changed and the throttle interval has passed, a Dolt-native backup is synced to
.beads/backup/(or to abackup/directory insidebackup.git-repowhen configured). - State is tracked in
backup_state.jsoninside the backup directory.
Auto-push
By default,bd does not push automatically after write commands. Auto-push is explicit opt-in because concurrent pushes to git-protocol Dolt remotes can corrupt or strand remote history when multiple writers race.
- After each write command (after auto-commit and auto-backup),
bdchecks whether a push is due. - Pushes are debounced: skipped if the last push was less than
dolt.auto-push-intervalago. - Change detection: skipped if the Dolt HEAD commit hasn’t changed since the last push.
- Push failures are warnings only (non-fatal), and failed attempts are throttled too.
- Last push time and commit are tracked in
.beads/push-state.json, a per-machine file (not in the database, to avoid merge conflicts across machines).
bd verifies the local chunk store with dolt fsck --quiet, bounded by a 30-second timeout. For large stores, raise it with the runtime-only BEADS_FSCK_TIMEOUT environment variable (accepts durations like 2m or bare seconds like 90).
Actor Identity Resolution
The actor name (used forcreated_by and audit trails) is resolved in this order:
--actorflag (explicit override)BEADS_ACTORenvironment variableBD_ACTORenvironment variable (deprecated alias)git config user.name$USERenvironment variable"unknown"(final fallback)
BEADS_ACTOR in your shell profile:
Project-Level Settings (Database)
These are written to the Dolt database bybd config set and have no env var override. Common namespaces:
Issue prefix (
issue_prefix) is not settable via bd config set — use bd init --prefix, bd bootstrap, or bd rename-prefix.
Custom Statuses and Types
Custom statuses supplement the built-ins (open, in_progress, blocked, deferred, closed). Each entry is name or name:category:
Custom types extend the built-in issue types:
bd statuses and bd types to list everything configured.
Sequential Counter IDs
By default, beads generates hash-based IDs (e.g.bd-a3f2). For projects that prefer short sequential IDs (bd-1, bd-2, …), enable counter mode:
Counter mode behavior:
- Each prefix (
bd,plug, …) has its own independent counter, so multi-repo or routed setups don’t interleave. - The counter is stored atomically in the database; concurrent creates within a single Dolt session are safe.
- On first use (including switching an existing repository to counter mode), the counter seeds itself from the highest existing numeric ID for that prefix, so new IDs don’t collide with old ones.
- An explicit
--idflag onbd createbypasses ID generation entirely; the counter is not incremented. - Counter mode applies only to regular issues, not wisps.
Adaptive Hash IDs
Hash IDs size themselves to the database: lengths start atmin_hash_length and grow toward max_hash_length to keep the collision probability under max_collision_prob.
Sync and Federation
Beads syncs exclusively through Dolt remotes (bd dolt push / bd dolt pull) with cell-level merge. Use bd export for issue portability and bd backup for restorable database backups.
Federation settings live in config.yaml:
federation.remote: Dolt remote URL (dolthub://org/beads,gs://bucket/beads,s3://bucket/beads,az://account.blob.core.windows.net/container/beads,file://...)federation.sovereignty: data sovereignty tier:T1: Full sovereignty — data never leaves controlled infrastructureT2: Regional sovereignty — data stays within region/jurisdictionT3: Provider sovereignty — data with trusted cloud providerT4: No restrictions — data can be anywhere
bd config validate checks the remote URL format, the sovereignty tier, federation.allowed-remote-patterns, and routing.mode.
Integration Configuration
Tracker settings are project-level config under the tracker’s namespace; secrets (jira.api_token, linear.api_key, github.token, gitlab.token, ado.pat) are YAML-routed and better supplied as environment variables. Every tracker records <tracker>.last_sync automatically after a sync, enabling incremental syncs.
Jira
jira.custom_fields.<field> applies to every issue pushed to Jira. jira.custom_fields.<JiraType>.<field> applies only when the mapped Jira issue type matches <JiraType>; per-type fields override global fields with the same field key. Values beginning with { or [ are sent as JSON (useful for select-like fields); other values are sent as strings. jira.url, jira.project/jira.projects, and jira.api_token fall back to the JIRA_URL, JIRA_PROJECT/JIRA_PROJECTS, and JIRA_API_TOKEN environment variables. See bd jira.
Linear
linear.team_ids is set, bd linear sync fetches issues from all listed teams; push with multiple teams configured requires an explicit --team. The singular linear.team_id remains supported.
Mapping namespaces — linear.priority_map.* (Linear 0–4 → beads 0–4), linear.state_map.* (Linear state types and custom state names → beads statuses, e.g. bd config set linear.state_map.in_review in_progress), linear.label_type_map.* (Linear labels → bd issue types), and linear.relation_map.* (Linear relations → bd dependencies; imported only when pulling with --relations) — are documented with defaults in bd linear.
Staleness detection: after each successful pull, bd writes a timestamp to .beads/last_pull (a local-only, per-machine file covered by the .beads/.gitignore template). bd linear sync --pull-if-stale pulls only when data is older than the threshold (--threshold, default 20m), and a 5-minute debounce prevents agent loops. bd prime and other core commands never contact Linear — run bd linear sync --pull-if-stale from a session-start hook to keep data fresh in agent sessions.
GitHub
Azure DevOps
Connection keys (ado.pat, ado.org, ado.project, ado.projects, ado.url) each have an AZURE_DEVOPS_* environment variable equivalent; config keys take priority over env vars. When ado.projects is set, bd ado sync fetches work items from all listed projects in a single query. State maps default to the Agile process template (override with ado.state_map.* / ado.type_map.* for Scrum or CMMI), and priority mapping (ADO 1–4 ↔ beads 0–4, with backlog collapsing to low) is automatic and not configurable. Full setup, mapping tables, and sync commands: Azure DevOps integration and bd ado.
Environment Variables
The Viper env prefix isBD_. Config keys map to env vars by upper-casing and replacing . and - with _ (e.g. dolt.auto-commit → BD_DOLT_AUTO_COMMIT, validation.on-create → BD_VALIDATION_ON_CREATE).
Selected commonly-used variables:
Integration secrets follow tracker-specific conventions:
LINEAR_API_KEY, GITHUB_TOKEN, GITLAB_TOKEN, JIRA_API_TOKEN, AZURE_DEVOPS_PAT, ANTHROPIC_API_KEY. These are preferred over storing the value in config.yaml for git-tracked projects.
bd config show will display the source of every effective key, making overrides explicit.
Security: Where Secrets Live
- Tokens and API keys are never stored in the Dolt database — database config is pushed to remotes, which would expose secrets and trip GitHub secret scanning.
bd config setroutes secret keys to the localconfig.yamlinstead. - Writing a secret to a git-tracked
config.yamlis refused unless you pass--force-git-tracked; environment variables are the safer default. bd initwrites a.beads/.gitignorethat keeps the database directories (embeddeddolt/,dolt/), runtime files, push state, and the federation credential key out of git.
Example .beads/config.yaml
.beads/config.local.yaml; it is merged in last.
Per-Command Override
Use in Scripts
Configuration is designed for scripting; everybd config subcommand takes --json: