beads/cmd/bd/testdata/command_tree/tree.golden
Julian Knutsen 36f81bab1c
test(cmd/bd): pin the command tree and representative --help output (#7675)
* test(cmd/bd): pin the command tree and representative --help output

Add two in-process goldens for the bd command surface, so any added,
removed, hidden or reworded command or flag fails until the goldens are
regenerated and shows up as a reviewed testdata diff:

- TestCommandTreeGolden walks the whole cobra tree (hidden commands
  included) and records, per command, Use, Aliases, Short, Long, Example,
  group, hidden/deprecated state, runnability and annotations, plus every
  local and persistent flag it defines (name, shorthand, type, default,
  usage, hidden, deprecation, annotations). Output is sorted and rendered
  twice to prove it is deterministic.
- TestCommandHelpGolden runs `bd <cmd> --help` through rootCmd for root,
  create, show, list, update, close, version, versions, config and serve.
  --help returns before the root pre-run, so no store is opened; color
  escapes are stripped. The snapshots are byte-identical to a built bd
  binary's --help output.

Both run from a fresh ordinary (dependency-mode) workspace: a
.beads/metadata.json with no graph marker and no database behind it.

The tree is primed the way the binary is (main()'s help command and its
--all/--doc/--list/--docs-root flags, ExecuteC's completion command), and
cobra's history-dependent pieces (the lazily added per-command --help flag,
the __complete request commands) are excluded, so the result does not
depend on which in-process tests ran first. The help runs reset every flag
afterwards so a later in-process command does not inherit --help.

docs/cli-docs.pin holds check-doc-flags at the v1.2.2 release, so drift on
main is not caught there; these goldens are the live guard. They pin the
cgo build (the !cgo build swaps in a federation stub). Regenerate with
BD_UPDATE_GOLDEN=1 go test -tags gms_pure_go ./cmd/bd -run '^TestCommand(Tree|Help)Golden$'.

Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(cmd/bd): keep the command goldens from merging flags into the shared tree

TestCommandTreeGolden read each command's flags through
LocalNonPersistentFlags, and TestCommandHelpGolden dispatches
`bd serve --help`. Both run cobra's mergePersistentFlags, which copies
every inherited persistent flag (--json, --db, ...) into the command's
own flag set for the rest of the process. TestServeFlags pins serveCmd's
exact flag set, so it failed whenever a golden test ran before it in the
same test binary: tree then serve flags, help then serve flags, and
-test.shuffle seeds 2 and 3, on the PR head and on its merge with main.
CI passes only because bd_test's 16 Bazel shards happen to run them in
different processes. Of 37 candidate tests, TestServeFlags is the only
one affected.

- goldenLocalFlags reads the set LocalNonPersistentFlags reports without
  calling it: c.Flags() minus c's own persistent flags and minus
  inherited copies. Like cobra, it treats a flag as inherited only if it
  is the nearest ancestor's own *pflag.Flag, so copies left by an
  earlier in-process execution are skipped and a flag that shadows an
  inherited one still renders.
- TestCommandTreeGolden fails if rendering changes the number of flags
  in any command's flag set.
- TestCommandHelpGolden calls restoreServeGlobals, which re-registers
  serveCmd's flags after the `bd serve --help` dispatch.

Review minors:
- The regeneration command (doc comment, failure-message constant,
  tree.golden header) sets CGO_ENABLED=1. Without cgo the file does not
  build, so the command matches no test and exits 0.
- enterOrdinaryWorkspaceForGolden calls isolateBeadsDirForTest.
- renderCommandHelpGolden's comment says when the ANSI strip matters.
- cmd/bd/AGENTS.md lists the goldens under "Adding a command" and
  "Guard tests".

Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <338826946+gascity-eddie[bot]@users.noreply.github.com>
2026-10-19 05:56:15 +00:00

7461 lines
366 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# bd command tree (cgo build), pinned by TestCommandTreeGolden.
# Regenerate after an intentional CLI change:
# BD_UPDATE_GOLDEN=1 CGO_ENABLED=1 go test -tags gms_pure_go ./cmd/bd -run '^TestCommand(Tree|Help)Golden$'
bd
use: "bd"
short: "bd - Dependency-aware issue tracker"
hidden: false
runnable: true
long:
| Issues chained together like beads. A lightweight issue tracker with first-class dependency support.
persistent-flag --actor type=string default="" usage="Actor name for audit trail (default: $BEADS_ACTOR, git user.name, $USER)"
persistent-flag --cpu-profile type=bool default="false" usage="Generate CPU profile for performance analysis"
persistent-flag --database type=string default="" usage="Run against a different server database for this invocation, without changing the project's configured database (proxied-server mode only)"
persistent-flag --db type=string default="" usage="Database path (default: auto-discover .beads/*.db). In proxied-server mode, a value that isn't an existing path is treated as a database name override (see --database)"
persistent-flag --directory -C type=string default="" usage="Change to this directory before running the command (like git -C)"
persistent-flag --dolt-auto-commit type=string default="" usage="Dolt auto-commit policy (off|on|batch). 'on': commit after each write. 'batch': defer commits to bd dolt commit; uncommitted changes persist in the working set until then (a live batch-mode bd process also flushes on SIGTERM/SIGHUP, except in proxied-server mode, where bd dolt commit is the only flush point). In proxied-server mode the deferral covers the writes the CLI makes on that route, including config and version metadata; explicit commit points (bd batch, bd mol bond/pour/squash, bd mol wisp create, and the wisp half of bd mol burn) still commit, and a bd serve process on the same database is unaffected. Default: on. Override via config key dolt.auto-commit"
persistent-flag --format type=string default="" hidden usage="Output format (json). Alias for --json"
persistent-flag --global type=bool default="false" usage="Use the global shared-server database (beads_global)"
persistent-flag --ignore-schema-skew type=bool default="false" usage="Proceed despite forward schema drift (some queries may fail)"
persistent-flag --json type=bool default="false" usage="Output in JSON format"
persistent-flag --mem-profile type=string default="" usage="Write heap profile to FILE on exit (also respects BEADS_MEM_PROFILE)"
persistent-flag --no-color type=bool default="false" usage="Disable color output (also: NO_COLOR=1 or CLICOLOR=0)"
persistent-flag --quiet -q type=bool default="false" usage="Suppress non-essential output (errors only)"
persistent-flag --readonly type=bool default="false" usage="Read-only mode: block write operations (for worker sandboxes)"
persistent-flag --sandbox type=bool default="false" usage="Sandbox mode: disables Dolt auto-push"
persistent-flag --verbose -v type=bool default="false" usage="Enable verbose/debug output"
flag --version -V type=bool default="false" usage="Print version information"
bd admin
use: "admin"
short: "Administrative commands for database maintenance"
group: "advanced"
hidden: false
runnable: false
long:
| Administrative commands for beads database maintenance.
|
| These commands are for advanced users and should be used carefully:
| cleanup Delete closed issues (issue lifecycle)
| compact Compact old closed issues to save space (storage optimization)
| reset Remove all beads data and configuration (full reset)
|
| For routine maintenance, prefer 'bd doctor --fix' which handles common repairs
| automatically. Use these admin commands for targeted database operations.
bd admin cleanup
use: "cleanup"
short: "Delete closed issues to reduce database size"
hidden: false
runnable: true
long:
| Delete closed issues to reduce database size.
|
| This command permanently removes closed issues from the database.
|
| NOTE: This command only manages issue lifecycle (closed -> deleted). For general
| health checks and automatic repairs, use 'bd doctor --fix' instead.
|
| By default, deletes ALL closed issues. Use --older-than to only delete
| issues closed before a certain date.
|
| EXAMPLES:
| bd admin cleanup --force # Delete all closed issues
| bd admin cleanup --older-than 30 --force # Only issues closed 30+ days ago
| bd admin cleanup --ephemeral --force # Only closed wisps (transient molecules)
| bd admin cleanup --dry-run # Preview what would be deleted
|
| SAFETY:
| - Requires --force flag to actually delete (unless --dry-run)
| - Supports --cascade to delete dependents
| - Shows preview of what will be deleted
| - Use --json for programmatic output
|
| SEE ALSO:
| bd doctor --fix Automatic health checks and repairs (recommended for routine maintenance)
| bd admin compact Compact old closed issues to save space
flag --cascade type=bool default="false" usage="Recursively delete all dependent issues"
flag --dry-run type=bool default="false" usage="Preview what would be deleted without making changes"
flag --ephemeral type=bool default="false" usage="Only delete closed wisps (transient molecules)"
flag --force -f type=bool default="false" usage="Actually delete (without this flag, shows error)"
flag --older-than type=int default="0" usage="Only delete issues closed more than N days ago (0 = all closed issues)"
bd admin compact
use: "compact"
short: "Compact old closed issues to save space"
hidden: false
runnable: true
long:
| Compact old closed issues using semantic summarization.
|
| Compaction reduces database size by summarizing closed issues that are no longer
| actively referenced. This is permanent graceful decay - original content is discarded.
|
| Modes:
| - Analyze: Export candidates for agent review (no API key needed)
| - Apply: Accept agent-provided summary (no API key needed)
| - Auto: AI-powered compaction (requires ANTHROPIC_API_KEY, MINIMAX_API_KEY, or ai.api_key)
| - Dolt: Run Dolt garbage collection (for Dolt-backend repositories)
|
| Tiers:
| - Tier 1: Semantic compression (30 days closed, 70% reduction)
| - Tier 2: Ultra compression (90 days closed) - planned, not yet implemented
|
| Dolt Garbage Collection:
| With auto-commit per mutation, Dolt commit history grows over time. Use
| --dolt to run Dolt garbage collection and reclaim disk space.
|
| --dolt: Run Dolt GC on the active database to free disk space.
| This removes unreachable commits and compacts storage.
|
| Examples:
| # Dolt garbage collection
| bd compact --dolt # Run Dolt GC
| bd compact --dolt --dry-run # Preview without running GC
|
| # Agent-driven workflow (recommended)
| bd compact --analyze --json # Get candidates with full content
| bd compact --apply --id bd-42 --summary summary.txt
| bd compact --apply --id bd-42 --summary - < summary.txt
|
| # AI-powered workflow
| bd compact --auto --dry-run # Preview candidates
| bd compact --auto --all # Compact all eligible issues
| bd compact --auto --id bd-42 # Compact specific issue
| MINIMAX_API_KEY=... bd compact --auto --all
|
| # Statistics
| bd compact --stats # Show statistics
|
flag --actor type=string default="agent" usage="Actor name for audit trail"
flag --all type=bool default="false" usage="Process all candidates"
flag --analyze type=bool default="false" usage="Analyze mode: export candidates for agent review"
flag --apply type=bool default="false" usage="Apply mode: accept agent-provided summary"
flag --auto type=bool default="false" usage="Auto mode: AI-powered compaction"
flag --batch-size type=int default="10" usage="Issues per batch"
flag --dolt type=bool default="false" usage="Dolt mode: run Dolt garbage collection on the active database"
flag --dry-run type=bool default="false" usage="Preview without compacting"
flag --force type=bool default="false" usage="Force compact (bypass checks, requires --id)"
flag --id type=string default="" usage="Compact specific issue"
flag --limit type=int default="0" usage="Limit number of candidates (0 = no limit)"
flag --stats type=bool default="false" usage="Show compaction statistics"
flag --summary type=string default="" usage="Path to summary file (use '-' for stdin)"
flag --tier type=int default="1" usage="Compaction tier (only tier 1 is implemented)"
flag --workers type=int default="5" usage="Parallel workers"
bd admin reset
use: "reset"
short: "Remove all beads data and configuration"
hidden: false
runnable: true
long:
| Reset beads to an uninitialized state, removing all local data.
|
| This command removes:
| - The .beads directory (database, JSONL, config)
| - Git hooks installed by bd
| - Sync branch worktrees
|
| By default, shows what would be deleted (dry-run mode).
| Use --force to actually perform the reset.
|
| Examples:
| bd reset # Show what would be deleted
| bd reset --force # Actually delete everything
flag --force type=bool default="false" usage="Actually perform the reset (required)"
bd ado
use: "ado"
short: "Azure DevOps integration commands"
hidden: false
runnable: false
long:
| Commands for syncing issues between beads and Azure DevOps.
|
| Configuration can be set via 'bd config' or environment variables:
| ado.org / AZURE_DEVOPS_ORG - Organization name
| ado.project / AZURE_DEVOPS_PROJECT - Project name (single)
| ado.projects / AZURE_DEVOPS_PROJECTS - Project names (comma-separated)
| ado.pat / AZURE_DEVOPS_PAT - Personal access token
| ado.url / AZURE_DEVOPS_URL - Custom base URL (on-prem)
bd ado projects
use: "projects"
short: "List accessible Azure DevOps projects"
hidden: false
runnable: true
long:
| List Azure DevOps projects that the configured token has access to.
bd ado pull
use: "pull [refs...]"
short: "Pull specific items from Azure DevOps"
hidden: false
runnable: true
long:
| Pull one or more items from Azure DevOps.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd ado sync --pull-only --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
bd ado push
use: "push [bead-ids...]"
short: "Push specific beads to Azure DevOps"
hidden: false
runnable: true
long:
| Push one or more beads issues to Azure DevOps.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd ado sync --push-only --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd ado status
use: "status"
short: "Show Azure DevOps sync status"
hidden: false
runnable: true
long:
| Display current Azure DevOps configuration and sync status.
bd ado sync
use: "sync"
short: "Sync issues with Azure DevOps"
hidden: false
runnable: true
long:
| Synchronize issues between beads and Azure DevOps.
|
| By default, performs bidirectional sync:
| - Pulls new/updated work items from Azure DevOps to beads
| - Pushes local beads issues to Azure DevOps
|
| Use --pull-only or --push-only to limit direction.
|
| Filters (--area-path, --iteration-path, --types, --states) restrict
| which work items are synced. On pull, they limit the WIQL query. On push,
| --types and --states filter local beads before pushing to ADO. Use
| --no-create with push to skip creating new ADO work items (only update
| existing linked items). Filters can also be persisted via config:
| ado.filter.area_path, ado.filter.iteration_path,
| ado.filter.types, ado.filter.states
| CLI flags override config values when both are set.
flag --area-path type=string default="" usage="Filter to ADO area path (e.g., \"Project\\Team\")"
flag --bootstrap-match type=bool default="false" usage="Enable heuristic matching for first sync"
flag --dry-run type=bool default="false" usage="Show what would be synced without making changes"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --iteration-path type=string default="" usage="Filter to ADO iteration path (e.g., \"Project\\Sprint 1\")"
flag --no-create type=bool default="false" usage="Never create new items in either direction (pull or push)"
flag --parent type=string default="" usage="Limit push to this bead and its descendants (push only). Mutually exclusive with --issues."
flag --prefer-ado type=bool default="false" usage="On conflict, use Azure DevOps version"
flag --prefer-local type=bool default="false" usage="On conflict, keep local beads version"
flag --prefer-newer type=bool default="false" usage="On conflict, use most recent version (default)"
flag --project type=stringSlice default="[]" usage="Project name(s) to sync (overrides configured project/projects)"
flag --pull-only type=bool default="false" usage="Only pull issues from Azure DevOps"
flag --push-only type=bool default="false" usage="Only push issues to Azure DevOps"
flag --reconcile type=bool default="false" usage="Force reconciliation scan for deleted items"
flag --states type=string default="" usage="Filter to ADO states, comma-separated (e.g., \"New,Active,Resolved\")"
flag --types type=string default="" usage="Filter to work item types, comma-separated (e.g., \"Bug,Task,User Story\")"
bd assign
use: "assign <id> <name>"
short: "Assign an issue to someone"
group: "issues"
hidden: false
runnable: true
long:
| Assign an issue to someone.
|
| Shorthand for 'bd update <id> --assignee <name>'.
|
| Refuses to overwrite another actor's live in_progress claim without --force
| (bd-98s5c); issues assigned to a claim.pools alias are exempt, matching
| --claim. For a holder-aware transfer prefer
| 'bd update <id> --if-assignee <holder> -a <new>'.
|
| Examples:
| bd assign bd-123 alice
| bd assign bd-123 "" # unassign
flag --force type=bool default="false" usage="Allow overwriting another actor's live in_progress claim (use only for abandoned claims — crashed agent, expired lease; prefer bd reclaim)"
flag --if-revision type=string default="" usage="Apply the write only if the issue's current revision equals this value (the decimal int64 from `bd show --json`'s \"revision\" field). One id only: refused before any write when combined with more than one issue id. A mismatch writes nothing and exits 13 (vs 1 for other failures)."
bd audit
use: "audit"
short: "Record and label agent interactions (append-only JSONL)"
hidden: false
runnable: false
long:
| Record explicit agent/tool interaction audit entries in .beads/interactions.jsonl.
|
| This optional JSONL sidecar is disabled by default. Enable it with:
|
| bd config set audit.enabled true
|
| Issue history is always recorded in the database and is visible with
| bd history <id> --events. The JSONL sidecar is for explicit interaction capture:
| - auditing ("why did the agent do that?")
| - dataset generation (SFT/RL fine-tuning)
|
| Entries are append-only. Labeling creates a new "label" entry that references a parent entry.
bd audit label
use: "label <entry-id>"
short: "Append a label entry referencing an existing interaction"
hidden: false
runnable: true
flag --label type=string default="" usage="Label value (e.g. \"good\" or \"bad\")"
flag --reason type=string default="" usage="Reason for label"
bd audit record
use: "record"
short: "Append an audit interaction entry"
hidden: false
runnable: true
flag --error type=string default="" usage="Error string (llm_call/tool_call)"
flag --exit-code type=int default="-1" usage="Exit code (tool_call)"
flag --issue-id type=string default="" usage="Related issue id (bd-...)"
flag --kind type=string default="" usage="Entry kind (e.g. llm_call, tool_call, label)"
flag --model type=string default="" usage="Model name (llm_call)"
flag --prompt type=string default="" usage="Prompt text (llm_call)"
flag --response type=string default="" usage="Response text (llm_call)"
flag --stdin type=bool default="false" usage="Read a JSON object from stdin (must match audit.Entry schema)"
flag --tool-name type=string default="" usage="Tool name (tool_call)"
bd backup
use: "backup"
short: "Back up your beads database"
group: "sync"
hidden: false
runnable: false
long:
| Back up your beads database for off-machine recovery.
|
| This is a Dolt-native database backup. It preserves the database state,
| including tables, branches, commit history, and working-set data. This is
| different from 'bd export', which writes issue records to JSONL for migration
| and interoperability.
|
| Commands:
| bd backup init <path> Set up a backup destination (filesystem or DoltHub)
| bd backup sync Push to configured backup destination
| bd backup restore [path] Restore from a backup directory
| bd backup remove Remove backup destination
| bd backup status Show backup status
|
| DoltHub is recommended for cloud backup:
| bd backup init https://doltremoteapi.dolthub.com/<user>/<repo>
| Set DOLT_REMOTE_USER and DOLT_REMOTE_PASSWORD for authentication.
|
| Auto-backup default:
| When backup.enabled is unset, auto-backup turns ON in embedded mode if a
| git remote exists, and stays OFF in sql-server / shared-server mode. In
| server mode many bd clients share one Dolt server, and each would register
| a server-side backup remote under the same name pointing at its own local
| dir and full-sync the whole database — a self-amplifying storm. To back up
| a shared server, run 'bd backup' explicitly (or set backup.enabled=true and
| coordinate destinations). 'bd config get backup.enabled' shows the effective
| value and its source.
|
| A proxied-server workspace is server mode too: auto-backup is OFF by
| default and backup.enabled=true opts in. Both the opt-in and the five
| backup verbs above are honored only on a managed-local proxied server —
| one bd started itself; on a Dolt server bd does not own they are refused.
bd backup init
use: "init <path>"
aliases: ["add"]
short: "Set up a Dolt backup destination"
hidden: false
runnable: true
long:
| Configure a filesystem path or URL as a backup destination.
|
| The path can be a local directory (external drive, NAS, Dropbox folder) or a
| DoltHub remote URL. If the destination was previously configured, it is
| updated to the new path.
|
| Filesystem examples:
| bd backup add /mnt/usb/beads-backup
| bd backup add ~/Dropbox/beads-backup
|
| DoltHub (recommended for cloud backup):
| bd backup add https://doltremoteapi.dolthub.com/myuser/beads-backup
|
| After adding, run 'bd backup sync' to push your data.
bd backup remove
use: "remove"
aliases: ["rm"]
short: "Remove the configured backup destination"
hidden: false
runnable: true
long:
| Remove the configured backup destination.
|
| This unregisters the backup remote from Dolt and removes the local
| backup configuration. The backup data at the destination is not deleted.
bd backup restore
use: "restore [path]"
short: "Restore database from a Dolt backup"
hidden: false
runnable: true
long:
| Restore the beads database from a Dolt-native backup.
|
| By default, reads from .beads/backup/ (or the configured backup directory).
| Optionally specify a path to a directory containing a Dolt backup.
|
| This restores a full database backup created by 'bd backup sync' or an
| equivalent Dolt backup. JSONL files produced by 'bd export' are issue exports,
| not restore targets for this command.
|
| Use --force to overwrite an existing database with the backup contents.
|
| The database must already be initialized (run 'bd init' first if needed).
| To initialize and restore in one step, use: bd init && bd backup restore
flag --force type=bool default="false" usage="Overwrite existing database with backup contents"
bd backup status
use: "status"
short: "Show last backup status"
hidden: false
runnable: true
bd backup sync
use: "sync"
short: "Push database to configured Dolt backup"
hidden: false
runnable: true
long:
| Sync the current beads database to the configured Dolt backup destination.
|
| This pushes the entire database state (all branches, full history) to the
| backup location configured with 'bd backup init'.
|
| The backup is atomic — if the sync fails, the previous backup state is preserved.
|
| Run 'bd backup init <path>' first to configure a destination.
bd batch
use: "batch"
short: "Run multiple write operations in a single database transaction"
group: "maint"
hidden: false
runnable: true
long:
| Run multiple write operations in a single database transaction.
|
| Commands are read from stdin (one per line) or from a file via -f/--file.
| All operations execute inside a single dolt transaction: on any error the
| whole batch is rolled back, otherwise it is committed with one DOLT_COMMIT.
|
| This is intended for shell scripts that currently invoke 'bd' many times in
| a loop, which causes severe write amplification on a dolt sql-server backed
| by btrfs+compression. Batching collapses N invocations into one transaction
| and one dolt commit.
|
| Grammar (one command per line):
| close <id> [reason...]
| update <id> <key>=<value> [<key>=<value> ...]
| create <type> <priority> <title...>
| dep add <from-id> <to-id> [type]
| dep remove <from-id> <to-id>
| #comment (blank lines and '# ...' comments are ignored)
|
| Supported 'update' keys: status, priority, title, assignee, force
| Supported dependency types: see 'bd dep add --help' (default: blocks)
|
| 'force' is not a field. An update whose status moves the issue into closed
| (or a configured done status) is refused when it still has open children or
| a live blocker, the same as 'bd close'; 'force=true' overrides that refusal.
| Because the batch is one transaction, an unforced refusal rolls back EVERY
| operation in the batch, not just the offending line. Note the asymmetry with
| 'close <id>', which does not apply that policy at all.
|
| Tokens are whitespace-separated. Double-quoted strings ("like this") may
| contain spaces; use \" to embed a quote and \\ for a backslash.
|
| Examples:
| # From a pipe
| bd list --status stale -q | awk '{print "close",$1," stale"}' | bd batch
|
| # From a file
| bd batch -f operations.txt
|
| # Inline
| printf 'close bd-1 done\nupdate bd-2 status=in_progress\n' | bd batch
|
| On success, exits 0 and prints a summary (or JSON with --json). On any error,
| rolls back the entire transaction and exits non-zero with the failing line.
|
| NOTE: This is a narrow subset. Commands like 'show', 'list', 'ready', 'sync',
| complex create flows, or any flag not listed above are NOT accepted. Use
| normal 'bd' subcommands for interactive/read operations.
flag --dry-run type=bool default="false" usage="Parse input and echo commands without executing"
flag --file -f type=string default="" usage="Read commands from file instead of stdin"
flag --message -m type=string default="" usage="DOLT_COMMIT message (default: 'bd: batch N ops by <actor>')"
bd blocked
use: "blocked"
short: "Show blocked issues"
hidden: false
runnable: true
flag --exclude-label type=stringSlice default="[]" usage="Exclude issues that have ANY of these labels"
flag --flags type=bool default="false" usage="Print the blocked flag for each id read from stdin (one per line) instead of the listing; with --json, [{\"id\",\"is_blocked\"}]"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE). Can combine with --label"
flag --parent type=string default="" usage="Filter to descendants of this bead/epic"
flag --raw type=bool default="false" usage="With --flags: the stored blocked column itself, without the external-dependency policy (an unsatisfied external: blocker does not set it)"
bd bootstrap
use: "bootstrap"
short: "Non-destructive database setup for fresh clones and recovery"
group: "setup"
hidden: false
runnable: true
long:
| Bootstrap sets up the beads database without destroying existing data.
| Unlike 'bd init --force', bootstrap will never delete existing issues.
|
| Bootstrap auto-detects the right action:
| • If sync.remote is configured: clones from the remote
| • If git origin has Dolt data (refs/dolt/data): clones from git and wires origin for future push/pull
| • If .beads/backup/*.jsonl exists: restores from backup
| • If .beads/issues.jsonl exists: imports from git-tracked JSONL
| • If no database exists: creates a fresh one — unless the workspace was already
| initialized (metadata.json has a project_id) and its server-mode database is
| missing, in which case bootstrap refuses rather than strand the existing data
| • If database already exists: validates and reports status
|
| If sync.remote points at a git repository, bootstrap verifies refs/dolt/data
| before cloning. Bootstrap exits non-zero when it cannot set up a database.
|
| This is the recommended command for:
| • Setting up beads on a fresh clone
| • Recovering after moving to a new machine
| • Repairing a broken database configuration
|
| Non-interactive mode (--non-interactive, --yes/-y, or BD_NON_INTERACTIVE=1):
| Skips the confirmation prompt before executing the bootstrap plan.
| Also auto-detected when stdin is not a terminal or CI=true is set.
|
| Examples:
| bd bootstrap # Auto-detect and set up
| bd bootstrap --dry-run # Show what would be done
| bd bootstrap --json # Output plan as JSON
| bd bootstrap --yes # Skip confirmation prompt
|
flag --dry-run type=bool default="false" usage="Show what would be done without doing it"
flag --non-interactive type=bool default="false" usage="Alias for --yes"
flag --yes -y type=bool default="false" usage="Skip confirmation prompts (for CI/automation)"
bd branch
use: "branch [name]"
short: "List or create branches"
group: "sync"
hidden: false
runnable: true
long:
| List all branches or create a new branch.
|
| This command requires the Dolt storage backend. Without arguments,
| it lists all branches. With an argument, it creates a new branch.
|
| Examples:
| bd branch # List all branches
| bd branch feature-xyz # Create a new branch named feature-xyz
bd children
use: "children <parent-id>"
short: "List child beads of a parent"
group: "issues"
hidden: false
runnable: true
long:
| List all beads that are children of the specified parent bead.
|
| This is a convenience alias for 'bd list --parent <id> --status all'.
| Unlike plain 'bd list', children includes closed issues by default,
| since the primary use case is inspecting all work under a parent.
|
| Examples:
| bd children hq-abc123 # List all children of hq-abc123
| bd children hq-abc123 --json # List children in JSON format
| bd children hq-abc123 --pretty # Show children in tree format
flag --pretty type=bool default="false" usage="Show children in tree format"
bd close
use: "close [id...]"
aliases: ["done"]
short: "Close one or more issues"
group: "issues"
hidden: false
runnable: true
long:
| Close one or more issues.
|
| If no issue ID is provided, closes the last touched issue (from most recent
| create, update, show, or close operation). This fallback only applies in
| interactive sessions (stdin is a terminal); in scripts and agent sessions a
| missing ID is an error, so a command built from an empty variable cannot
| silently close an unrelated issue. Set BD_LAST_TOUCHED_FALLBACK=1 to allow
| the fallback anywhere, or =0 to disable it entirely.
|
| When closing multiple issues, provide one --reason for all IDs or repeat
| --reason once per ID. Reasons map positionally: the first --reason applies
| to the first ID, the second --reason to the second ID, regardless of where
| the flags appear in the command line.
|
| Closing a molecule's last open step also closes the molecule's root, with
| the reason "all steps complete", when the root is a poured molecule, a wisp,
| or an epic labeled "template"; any other epic stays open as close-eligible
| work. A root that would refuse its own close (an open blocker, a pin, another
| assignee) stays open with a warning, and the step's close stands. Under
| --json, the step's entry names the closed root (auto_closed_molecule) or the
| refusal (molecule_auto_close_refusal). --continue claims the next ready step
| in the molecule for you; add --no-auto to only show it.
flag --claim-next type=bool default="false" usage="Automatically claim the next highest priority available issue"
flag --comment type=string default="" hidden usage="Alias for --reason"
flag --continue type=bool default="false" usage="Auto-advance to next step in molecule"
flag --force -f type=bool default="false" usage="Force close pinned issues or unsatisfied gates"
flag --if-revision type=string default="" usage="Apply the write only if the issue's current revision equals this value (the decimal int64 from `bd show --json`'s \"revision\" field). One id only: refused before any write when combined with more than one issue id. A mismatch writes nothing and exits 13 (vs 1 for other failures)."
flag --message -m type=string default="" hidden usage="Alias for --reason (git commit convention)"
flag --no-auto type=bool default="false" usage="With --continue, show next step but don't claim it"
flag --reason -r type=string default="" usage="Reason for closing"
flag --reason-file type=string default="" usage="Read close reason from file (use - for stdin)"
flag --resolution type=string default="" hidden usage="Alias for --reason (Jira CLI convention)"
flag --session type=string default="" usage="Claude Code session ID (or set CLAUDE_SESSION_ID env var)"
flag --suggest-next type=bool default="false" usage="Show newly unblocked issues after closing"
bd codex-hook
use: "codex-hook <event>"
short: "Run an internal Codex lifecycle hook"
hidden: true
runnable: true
bd comment
use: "comment <id> [text...]"
short: "Add a comment to an issue"
group: "issues"
hidden: false
runnable: true
long:
| Add a comment to an issue.
|
| Shorthand for 'bd comments add <id> "text"'.
|
| Examples:
| bd comment bd-123 "Working on this now"
| bd comment bd-123 Working on this now
| echo "comment from pipe" | bd comment bd-123 --stdin
| bd comment bd-123 --file notes.txt
|
| Note: "comment" (singular) only adds a comment — it has no "list" subcommand.
| To list comments on an issue, use the plural form: bd comments <id>
flag --file type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin file"]} usage="Read comment text from file"
flag --stdin type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["stdin file"]} usage="Read comment text from stdin"
bd comments
use: "comments [issue-id]"
short: "View or manage comments on an issue"
group: "issues"
hidden: false
runnable: true
long:
| View or manage comments on an issue.
|
| Examples:
| # List all comments on an issue (issue id is required — there is no "comments list")
| bd comments bd-123
|
| # List comments in JSON format
| bd comments bd-123 --json
|
| # Add a comment
| bd comments add bd-123 "This is a comment"
|
| # Add a comment from a file
| bd comments add bd-123 -f notes.txt
flag --local-time type=bool default="false" usage="Show timestamps in local time instead of UTC"
bd comments add
use: "add [issue-id] [text...]"
short: "Add a comment to an issue"
hidden: false
runnable: true
long:
| Add a comment to an issue.
|
| Examples:
| # Add a comment
| bd comments add bd-123 "Working on this now"
|
| # Add a comment from a file
| bd comments add bd-123 -f notes.txt
flag --author -a type=string default="" usage="Add author to comment"
flag --file -f type=string default="" usage="Read comment text from file"
bd comments list
use: "list"
short: "Invalid — use bd comments <issue-id> to list comments"
hidden: false
runnable: true
bd compact
use: "compact"
short: "Squash old Dolt commits to reduce history size"
group: "maint"
hidden: false
runnable: true
long:
| Squash Dolt commits older than N days into a single commit.
|
| Recent commits (within the retention window) are preserved via cherry-pick.
| This reduces Dolt storage overhead from auto-commit history while keeping
| recent change tracking intact.
|
| For semantic issue compaction (summarizing closed issues), use 'bd admin compact'.
| For full history squash, use 'bd flatten'.
|
| How it works:
| 1. Identifies commits older than --days threshold
| 2. Creates a squashed base commit from all old history
| 3. Cherry-picks recent commits on top
| 4. Swaps main branch to the compacted version
| 5. Prunes remote-tracking refs (they would keep the old history alive;
| the next push or fetch re-creates them at the new tip)
| 6. Runs a full Dolt GC (all storage generations) to reclaim the old history
|
| The GC pass is a full collection: Dolt storage is generational, and a default
| GC never revisits data an earlier GC moved to the old generation. On any store
| that has been GC'd before (bd gc, or a previous flatten or compact), only a
| full collection reclaims the squashed history. A full GC can take minutes on
| multi-gigabyte stores.
|
| Examples:
| bd compact --dry-run # Preview: show commit breakdown
| bd compact --force # Squash commits older than 30 days
| bd compact --days 7 --force # Keep only last 7 days of history
| bd compact --days 90 --force # Conservative: squash 90+ day old commits
flag --days type=int default="30" usage="Keep commits newer than N days"
flag --dry-run type=bool default="false" usage="Preview without making changes"
flag --force -f type=bool default="false" usage="Confirm commit squash"
bd completion
use: "completion"
short: "Generate the autocompletion script for the specified shell"
hidden: false
runnable: false
long:
| Generate the autocompletion script for bd for the specified shell.
| See each sub-command's help for details on how to use the generated script.
|
bd completion bash
use: "bash"
short: "Generate the autocompletion script for bash"
hidden: false
runnable: true
long:
| Generate the autocompletion script for the bash shell.
|
| This script depends on the 'bash-completion' package.
| If it is not installed already, you can install it via your OS's package manager.
|
| To load completions in your current shell session:
|
| source <(bd completion bash)
|
| To load completions for every new session, execute once:
|
| #### Linux:
|
| bd completion bash > /etc/bash_completion.d/bd
|
| #### macOS:
|
| bd completion bash > $(brew --prefix)/etc/bash_completion.d/bd
|
| You will need to start a new shell for this setup to take effect.
|
flag --no-descriptions type=bool default="false" usage="disable completion descriptions"
bd completion fish
use: "fish"
short: "Generate the autocompletion script for fish"
hidden: false
runnable: true
long:
| Generate the autocompletion script for the fish shell.
|
| To load completions in your current shell session:
|
| bd completion fish | source
|
| To load completions for every new session, execute once:
|
| bd completion fish > ~/.config/fish/completions/bd.fish
|
| You will need to start a new shell for this setup to take effect.
|
flag --no-descriptions type=bool default="false" usage="disable completion descriptions"
bd completion powershell
use: "powershell"
short: "Generate the autocompletion script for powershell"
hidden: false
runnable: true
long:
| Generate the autocompletion script for powershell.
|
| To load completions in your current shell session:
|
| bd completion powershell | Out-String | Invoke-Expression
|
| To load completions for every new session, add the output of the above command
| to your powershell profile.
|
flag --no-descriptions type=bool default="false" usage="disable completion descriptions"
bd completion zsh
use: "zsh"
short: "Generate the autocompletion script for zsh"
hidden: false
runnable: true
long:
| Generate the autocompletion script for the zsh shell.
|
| If shell completion is not already enabled in your environment you will need
| to enable it. You can execute the following once:
|
| echo "autoload -U compinit; compinit" >> ~/.zshrc
|
| To load completions in your current shell session:
|
| source <(bd completion zsh)
|
| To load completions for every new session, execute once:
|
| #### Linux:
|
| bd completion zsh > "${fpath[1]}/_bd"
|
| #### macOS:
|
| bd completion zsh > $(brew --prefix)/share/zsh/site-functions/_bd
|
| You will need to start a new shell for this setup to take effect.
|
flag --no-descriptions type=bool default="false" usage="disable completion descriptions"
bd config
use: "config"
short: "Manage configuration settings"
group: "setup"
hidden: false
runnable: false
long:
| Manage configuration settings for external integrations and preferences.
|
| Configuration is stored per-project in the beads database and is version-control-friendly.
|
| Common namespaces:
| - export.* Auto-export settings (stored in config.yaml)
| - import.* JSONL import settings (stored in config.yaml)
| - jira.* Jira integration settings
| - linear.* Linear integration settings
| - github.* GitHub integration settings
| - gitlab.* GitLab integration settings
| - ado.* Azure DevOps integration settings
| - notion.* Notion integration settings
| - custom.* Custom integration settings
| - status.* Issue status configuration
| - claim.* Claim arbitration settings (pool-aware claiming)
| - doctor.suppress.* Suppress specific bd doctor warnings (GH#1095)
| - lint.* Additional per-type lint sections (stored in config.yaml)
|
| Auto-Export (config.yaml):
| Optional JSONL export to .beads/issues.jsonl after write commands (throttled).
| Useful for viewers (bv), interchange, and issue-level migration; not a backup.
| It is not cross-machine sync; use bd dolt push/pull with a Dolt remote.
| Disabled by default. Enable only for integrations that need fresh JSONL.
| Auto-staging is separate and disabled by default.
|
| Keys:
| export.auto Enable/disable auto-export (default: false)
| export.path Output filename relative to .beads/ (default: issues.jsonl)
| export.interval Minimum time between exports (default: 60s)
| export.git-add Auto-stage the export file (default: false)
|
| Auto-Import (config.yaml):
| Reads .beads/issues.jsonl by default when a JSONL import path is implied.
| Use a relative filename/path so the import stays within the project .beads/
| directory and remains portable across machines.
|
| Keys:
| import.path Input filename relative to .beads/ (default: issues.jsonl)
|
| Custom Status States:
| You can define custom status states for multi-step pipelines using the
| status.custom config key. Statuses should be comma-separated.
|
| Example:
| bd config set status.custom "awaiting_review,awaiting_testing,awaiting_docs"
|
| This enables issues to use statuses like 'awaiting_review' in addition to
| the built-in statuses (open, in_progress, blocked, deferred, closed).
|
| Claim Pools:
| A dispatcher can pre-assign issues to a pool pseudo-assignee (e.g.
| "fable-crew") and let any actor take them with --claim. List the pool
| aliases in the claim.pools config key, comma-separated:
|
| bd config set claim.pools "fable-crew,night-crew"
|
| Issues assigned to a real actor (or to an alias not in the list) keep
| their anti-steal protection. Pool takes carry the normal lease; note
| that if a taker's lease expires, bd reclaim returns the issue to the
| unassigned pool, not to the pool alias it was dispatched to.
|
| Suppressing Doctor Warnings:
| Suppress specific bd doctor warnings by check name slug:
| bd config set doctor.suppress.pending-migrations true
| bd config set doctor.suppress.git-hooks true
| Check names are converted to slugs: "Git Hooks" → "git-hooks".
| Only warnings are suppressed (errors and passing checks always show).
| To unsuppress: bd config unset doctor.suppress.<slug>
|
| Examples:
| bd config set export.auto true # Enable auto-export for viewer integrations
| bd config set export.path "beads.jsonl" # Custom export filename
| bd config set import.path "beads.jsonl" # Custom import filename
| bd config set export.git-add true # Also stage the export file
| bd config set jira.url "https://company.atlassian.net"
| bd config set jira.project "PROJ"
| bd config set status.custom "awaiting_review,awaiting_testing"
| bd config set claim.pools "fable-crew,night-crew" # Pool aliases claimable by any actor
| bd config set doctor.suppress.pending-migrations true
| bd config set dolt.debug true # Enable Dolt sql-server debug mode (loglevel=debug, --prof cpu)
| bd config set dolt.local-only true # Skip wiring a Dolt sync remote during bd init
| bd config set lint.sections.epic "Standards scorecard, Cost" # Extra sections bd lint requires for epics
| bd config get export.auto
| bd config list
| bd config unset jira.url
bd config apply
use: "apply"
short: "Reconcile system state to match configuration"
hidden: false
runnable: true
long:
| Reconcile actual system state to match declared configuration.
|
| Runs drift detection and then fixes any mismatches it finds:
|
| - hooks Reinstall git hooks if missing or outdated
| - remote Add/update Dolt origin remote to match federation.remote
| - server Start Dolt server if dolt.shared-server is enabled
|
| This command is idempotent — safe to run multiple times. Use --dry-run
| to preview what would change without making modifications.
|
| Examples:
| bd config apply
| bd config apply --dry-run
| bd config apply --json
flag --dry-run type=bool default="false" usage="Show what would change without making modifications"
bd config drift
use: "drift"
short: "Detect config-vs-reality inconsistencies"
hidden: false
runnable: true
long:
| Detect drift between declared configuration and actual system state.
|
| This is a read-only diagnostic that answers "is my environment consistent
| with my config?" — no mutations are performed.
|
| Checks:
| - hooks Git hooks installed and up-to-date
| - remote Dolt remote matches federation.remote config
| - server Server state matches dolt.shared-server config
|
| Exit codes:
| 0 No drift detected (all checks ok/info/skipped)
| 1 Drift detected (at least one check has status "drift")
|
| Examples:
| bd config drift
| bd config drift --json
bd config get
use: "get <key>"
short: "Get a configuration value"
hidden: false
runnable: true
bd config list
use: "list"
short: "List all configuration"
hidden: false
runnable: true
bd config set
use: "set <key> <value>"
short: "Set a configuration value"
hidden: false
runnable: true
flag --force-git-tracked type=bool default="false" usage="Allow writing secret keys to git-tracked config files (use with caution)"
bd config set-many
use: "set-many <key=value>..."
short: "Set multiple configuration values in one operation"
hidden: false
runnable: true
long:
| Set multiple configuration values at once with a single auto-commit and auto-push.
|
| Each argument must be in key=value format. All values are validated before
| any writes occur. This is faster and less noisy than separate 'bd config set'
| calls, especially in CI.
|
| Examples:
| bd config set-many ado.state_map.open=New ado.state_map.closed=Closed
| bd config set-many jira.url=https://example.atlassian.net jira.project=PROJ
flag --force-git-tracked type=bool default="false" usage="Allow writing secret keys to git-tracked config files (use with caution)"
bd config show
use: "show"
short: "Show all effective configuration with provenance"
hidden: false
runnable: true
long:
| Display a unified view of all effective configuration across all sources
| with annotations showing where each value comes from.
|
| Sources (by precedence for Viper-managed keys):
| - env Environment variable (BD_* or BEADS_*)
| - config.yaml Project config file (.beads/config.yaml)
| - default Built-in default value
|
| Additional sources:
| - metadata Connection settings from .beads/metadata.json
| - database Integration config stored in the Dolt database
| - git Git config (e.g., beads.role)
|
| Examples:
| bd config show
| bd config show --json
| bd config show --source config.yaml
flag --source type=string default="" usage="Filter by source (e.g., config.yaml, env, default, metadata, database, git)"
bd config unset
use: "unset <key>"
short: "Delete a configuration value"
hidden: false
runnable: true
bd config validate
use: "validate"
short: "Validate sync-related configuration"
hidden: false
runnable: true
long:
| Validate sync-related configuration settings.
|
| Checks:
| - federation.sovereignty is valid (T1, T2, T3, T4, or empty)
| - federation.remote is set for Dolt sync
| - Remote URL format is valid (dolthub://, gs://, s3://, az://, file://)
| - routing.mode is valid (auto, maintainer, contributor, explicit)
|
| Examples:
| bd config validate
| bd config validate --json
bd conflicts
use: "conflicts"
short: "Inspect and resolve live merge conflicts"
group: "sync"
hidden: false
runnable: false
long:
| Inspect and resolve the merge conflicts sitting in the working set.
|
| Conflicts appear when a pull or merge brought in changes that collide with
| local ones and could not be settled automatically. These commands present them
| per issue and per field, and resolve them without the raw dolt CLI.
|
| Examples:
| bd conflicts list # which tables and issues are conflicted
| bd conflicts show # every conflicted row, field by field
| bd conflicts show bd-1234 # one issue
| bd conflicts resolve bd-1234 --ours # keep our side of one issue
| bd conflicts resolve --all --theirs # take their side of everything
bd conflicts list
use: "list"
short: "List tables and issues with live merge conflicts"
hidden: false
runnable: true
bd conflicts resolve
use: "resolve [<issue-id>...]"
short: "Resolve merge conflicts with --ours or --theirs"
hidden: false
runnable: true
long:
| Resolve live merge conflicts, then conclude the merge with a commit.
|
| Named issue IDs are resolved row by row, leaving every other conflicted row
| alone. --all resolves whole tables at once (dolt's own table-level
| resolution). The merge is committed only once NO conflicts remain, so a
| partial resolution leaves the merge open for the next pass.
|
| Row-by-row resolution requires the row to exist on both sides: when one side
| deleted it, resolve that table wholesale or edit the row directly.
|
| Examples:
| bd conflicts resolve bd-1234 --ours # keep our side of one issue
| bd conflicts resolve bd-1234 bd-5678 --theirs # take their side of two
| bd conflicts resolve --all --ours # every conflicted table
| bd conflicts resolve --all --table config --theirs
| bd conflicts resolve --conclude # commit an already-resolved merge
flag --all type=bool default="false" usage="Resolve whole tables instead of named issues"
flag --conclude type=bool default="false" usage="Commit a merge whose conflicts are already resolved"
flag --no-commit type=bool default="false" usage="Resolve without committing the merge"
flag --ours type=bool default="false" usage="Keep our side"
flag --strategy type=string default="" usage="Resolution strategy: ours|theirs"
flag --table type=string default="" usage="Table to resolve (default: issues)"
flag --theirs type=bool default="false" usage="Take their side"
bd conflicts show
use: "show [<issue-id>]"
short: "Show conflicted rows field by field (base/ours/theirs)"
hidden: false
runnable: true
long:
| Show each conflicted row with its fields side by side.
|
| Only fields where our side and their side disagree are shown; --all-fields
| shows every column. Without an issue ID, every conflicted row of every
| conflicted table is shown.
flag --all-fields type=bool default="false" usage="Show every column, not just the fields that diverged"
flag --table type=string default="" usage="Restrict to one conflicted table (default: all)"
bd connect
use: "connect [url]"
short: "Attach this workspace to a remote bd serve over HTTP"
group: "setup"
hidden: false
runnable: true
annotations: {bd:skip_store="1"}
long:
| Attach this workspace to a remote bd serve over HTTP.
|
| bd connect verifies the server first (a handshake: api_version, wire
| revision, and — when --expect-project-id is given — workspace identity) and
| writes nothing until that succeeds. On success it writes the per-user
| activation sidecar (.beads/http_target.json, never git-tracked) and sets this
| workspace's metadata.json to backend "http".
|
| A credential, if the server requires one, is never read from a flag or
| recorded on disk by this command. It comes from the same ladder every http
| request does: the BEADS_HTTP_TOKEN environment variable, then
| BEADS_HTTP_TOKEN_COMMAND (a helper that prints a token), then the credentials
| file's [host:port] section, then no credential at all — which the tip OSS
| server's loopback-trust posture answers legitimately, not as a failure. Both
| variables name the server they are for, host[:port]=value (for example
| BEADS_HTTP_TOKEN=bd.example.com=<token>); a bare value is refused, since it
| would be sent to whatever server the workspace's http_target.json names.
|
| --allow-plaintext IS recorded on disk, in the sidecar alongside the server
| url: once granted here, a credential may cross this one server in the clear
| on every later command too, not only this one, without re-passing the flag
| or setting BEADS_HTTP_ALLOW_INSECURE=1 yourself. A later connect to a
| DIFFERENT url starts that grant over; it is never carried forward to a
| server it was not given for.
|
| Examples:
| bd connect http://127.0.0.1:8080 # loopback, no TLS needed
| bd connect https://bd.example.com --expect-project-id p1 # pin workspace identity
| bd connect https://bd.example.com --ca-file ./ca.pem # trust only this CA
| bd connect --clear # forget the server, restoring the previous backend
|
flag --allow-plaintext type=bool default="false" usage="allow a plain http connection to a non-loopback host; remembered in the sidecar for every later command against this server"
flag --ca-file type=string default="" usage="trust ONLY this PEM file for this server (resolved and recorded as an absolute path)"
flag --clear type=bool default="false" usage="remove this workspace's http activation sidecar and restore its previous backend selection in metadata.json"
flag --expect-project-id type=string default="" usage="pin the workspace identity the server must present at every handshake"
flag --force type=bool default="false" usage="allow switching a workspace that already selects a different backend"
bd context
use: "context"
short: "Show effective backend identity and repository context"
group: "setup"
hidden: false
runnable: true
long:
| Show the effective backend identity information including repository paths,
| backend configuration, and sync settings.
|
| This command reads directly from config files and does not require the
| database to be open, making it useful for diagnostics in degraded states.
|
| Examples:
| bd context # Show context information
| bd context --json # Output in JSON format
|
bd cook
use: "cook <formula-file>"
short: "Compile a formula into a proto (ephemeral by default)"
hidden: false
runnable: true
long:
| Cook transforms a .formula.json file into a proto.
|
| By default, cook outputs the resolved formula as JSON to stdout for
| ephemeral use. The output can be inspected, piped, or saved to a file.
|
| Two cooking modes are available:
|
| COMPILE-TIME (default, --mode=compile):
| Produces a proto with {{variable}} placeholders intact.
| Use for: modeling, estimation, contractor handoff, planning.
| Variables are NOT substituted - the output shows the template structure.
|
| RUNTIME (--mode=runtime or when --var flags provided):
| Produces a fully-resolved proto with variables substituted.
| Use for: final validation before pour, seeing exact output.
| Requires all variables to have values (via --var or defaults).
|
| Formulas are high-level workflow templates that support:
| - Variable definitions with defaults and validation
| - Step definitions that become issue hierarchies
| - Composition rules for bonding formulas together
| - Inheritance via extends
|
| The --persist flag enables the legacy behavior of writing the proto
| to the database. This is useful when you want to reuse the same
| proto multiple times without re-cooking.
|
| For most workflows, prefer ephemeral protos: pour and wisp commands
| accept formula names directly and cook inline.
|
| Examples:
| bd cook mol-feature.formula.json # Compile-time: keep {{vars}}
| bd cook mol-feature --var name=auth # Runtime: substitute vars
| bd cook mol-feature --mode=runtime --var name=auth # Explicit runtime mode
| bd cook mol-feature --dry-run # Preview steps
| bd cook mol-release.formula.json --persist # Write to database
| bd cook mol-release.formula.json --persist --force # Replace existing
|
| Output (default):
| JSON representation of the resolved formula with all steps.
|
| Output (--persist):
| Creates a proto bead in the database with:
| - ID matching the formula name (e.g., mol-feature)
| - The "template" label for proto identification
| - Child issues for each step
| - Dependencies matching depends_on relationships
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --force type=bool default="false" usage="Replace existing proto if it exists (requires --persist)"
flag --mode type=string default="" usage="Cooking mode: compile (keep placeholders) or runtime (substitute vars)"
flag --persist type=bool default="false" usage="Persist proto to database (legacy behavior)"
flag --prefix type=string default="" usage="Prefix to prepend to proto ID (e.g., 'gt-' creates 'gt-mol-feature')"
flag --search-path type=stringSlice default="[]" usage="Additional paths to search for formula inheritance"
flag --var type=stringArray default="[]" usage="Variable substitution (key=value), enables runtime mode"
bd count
use: "count"
short: "Count issues matching filters"
group: "views"
hidden: false
runnable: true
long:
| Count issues matching the specified filters.
|
| By default, returns the total count of issues matching the filters.
| Use --by-* flags to group counts by different attributes.
|
| Examples:
| bd count # Count all issues
| bd count --status open # Count open issues
| bd count --by-status # Group count by status
| bd count --by-priority # Group count by priority
| bd count --by-type # Group count by issue type
| bd count --by-assignee # Group count by assignee
| bd count --by-label # Group count by label
| bd count --assignee alice --by-status # Count alice's issues by status
| bd count --include-infra # Count issues + wisps tier (matches 'bd list --include-infra --all' cardinality)
| bd count --type task --include-ephemeral # Count tasks in the durable AND wisps tiers
|
flag --assignee -a type=string default="" usage="Filter by assignee"
flag --by-assignee type=bool default="false" usage="Group count by assignee"
flag --by-label type=bool default="false" usage="Group count by label"
flag --by-priority type=bool default="false" usage="Group count by priority"
flag --by-status type=bool default="false" usage="Group count by status"
flag --by-type type=bool default="false" usage="Group count by issue type"
flag --closed-after type=string default="" usage="Filter issues closed after date (YYYY-MM-DD or RFC3339)"
flag --closed-before type=string default="" usage="Filter issues closed before date (YYYY-MM-DD or RFC3339)"
flag --created-after type=string default="" usage="Filter issues created after date (YYYY-MM-DD or RFC3339)"
flag --created-before type=string default="" usage="Filter issues created before date (YYYY-MM-DD or RFC3339)"
flag --desc-contains type=string default="" usage="Filter by description substring"
flag --empty-description type=bool default="false" usage="Filter issues with empty description"
flag --exclude-status type=stringSlice default="[]" usage="Exclude statuses from the count (comma-separated or repeatable)"
flag --exclude-type type=stringSlice default="[]" usage="Exclude issue types from the count (comma-separated or repeatable)"
flag --has-metadata-key type=string default="" usage="Filter issues that have this metadata key set"
flag --id type=string default="" usage="Filter by specific issue IDs (comma-separated)"
flag --include-ephemeral type=bool default="false" usage="Include ephemeral wisp-plane rows in the count (normally hidden), without lifting type exclusions"
flag --include-infra type=bool default="false" usage="Include infrastructure beads and the wisps tier (matches 'bd list --include-infra --all' cardinality)"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL)"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE)"
flag --metadata-field type=stringArray default="[]" usage="Filter by metadata field (key=value, repeatable)"
flag --no-assignee type=bool default="false" usage="Filter issues with no assignee"
flag --no-labels type=bool default="false" usage="Filter issues with no labels"
flag --no-parent type=bool default="false" usage="Count only top-level issues (exclude child issues)"
flag --notes-contains type=string default="" usage="Filter by notes substring"
flag --parent type=string default="" usage="Filter by parent issue ID (count children of specified issue)"
flag --priority -p type=int default="0" usage="Filter by priority (0-4: 0=critical, 1=high, 2=medium, 3=low, 4=backlog)"
flag --priority-max type=int default="0" usage="Filter by maximum priority (inclusive)"
flag --priority-min type=int default="0" usage="Filter by minimum priority (inclusive)"
flag --status -s type=string default="" usage="Filter by stored status (open, in_progress, blocked, deferred, closed). Note: dependency-blocked issues use 'bd blocked'"
flag --title type=string default="" usage="Filter by title text (case-insensitive substring match)"
flag --title-contains type=string default="" usage="Filter by title substring"
flag --type -t type=string default="" usage="Filter by type (bug, feature, task, epic, chore, decision, merge-request, molecule, gate)"
flag --updated-after type=string default="" usage="Filter issues updated after date (YYYY-MM-DD or RFC3339)"
flag --updated-before type=string default="" usage="Filter issues updated before date (YYYY-MM-DD or RFC3339)"
bd create
use: "create [title]"
aliases: ["new"]
short: "Create a new issue (or batch from markdown/graph JSON)"
group: "issues"
hidden: false
runnable: true
flag --acceptance type=string default="" usage="Acceptance criteria"
flag --allow-empty-description type=bool default="false" usage="Allow empty description input from stdin or file"
flag --append-notes type=string default="" usage="Append to existing notes (with newline separator)"
flag --assignee -a type=string default="" usage="Assignee"
flag --body type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin body"]} usage="Alias for --description (GitHub CLI convention)"
flag --body-file type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin body-file"]} usage="Read description from file (use - for stdin)"
flag --context type=string default="" usage="Additional context for the issue"
flag --defer type=string default="" usage="Defer until date (issue hidden from bd ready until then). Same formats as --due"
flag --deps type=stringSlice default="[]" usage="Dependencies as 'type:id' or bare 'id'. Bare 'id', 'depends-on:id', and 'blocked-by:id' all make THIS issue depend on id; 'blocks:id' reverses direction (id depends on this issue). E.g. 'blocked-by:bd-20,discovered-from:bd-15'"
flag --description -d type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin description"]} usage="Issue description"
flag --description-file type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin description-file"]} usage="Alias for --body-file"
flag --design type=string default="" annotations={cobra_annotation_mutually_exclusive=["design design-file"]} usage="Design notes"
flag --design-file type=string default="" annotations={cobra_annotation_mutually_exclusive=["design design-file"]} usage="Read design from file (use - for stdin)"
flag --dry-run type=bool default="false" usage="Preview what would be created without actually creating"
flag --due type=string default="" usage="Due date/time. Formats: +6h, +1d, +2w, tomorrow, next monday, 2025-01-15"
flag --ephemeral type=bool default="false" usage="Create as ephemeral (short-lived, subject to TTL compaction)"
flag --estimate -e type=int default="0" usage="Time estimate in minutes (e.g., 60 for 1 hour)"
flag --event-actor type=string default="" usage="Entity URI who caused this event (requires --type=event)"
flag --event-category type=string default="" usage="Event category (e.g., patrol.muted, agent.started) (requires --type=event)"
flag --event-payload type=string default="" usage="Event-specific JSON data (requires --type=event)"
flag --event-target type=string default="" usage="Entity URI or bead ID affected (requires --type=event)"
flag --external-ref type=string default="" usage="External reference (e.g., 'gh-9', 'jira-ABC', Linear URL)"
flag --file -f type=string default="" usage="Create one issue per ## heading (### fields attach to that issue); for title plus description-from-file, use --body-file"
flag --force type=bool default="false" usage="Force creation even if prefix doesn't match database prefix"
flag --graph type=string default="" usage="Create a graph of issues with dependencies from JSON plan file"
flag --id type=string default="" usage="Explicit issue ID (e.g., 'bd-42' for partitioning)"
flag --label type=stringSlice default="[]" hidden usage="Alias for --labels"
flag --labels -l type=stringSlice default="[]" usage="Labels (comma-separated)"
flag --message -m type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin message"]} usage="Alias for --description (git commit convention)"
flag --metadata type=string default="" usage="Set custom metadata (JSON object, or @file.json to read from file)"
flag --mol-type type=string default="" usage="Molecule type: swarm (multi-agent), patrol (recurring ops), work (default)"
flag --no-history type=bool default="false" usage="Skip Dolt commit history without making GC-eligible (for permanent agent beads)"
flag --no-inherit-labels type=bool default="false" usage="Don't inherit labels from parent issue"
flag --notes type=string default="" usage="Notes"
flag --parent type=string default="" usage="Parent issue ID for hierarchical child (e.g., 'bd-a3f8e9')"
flag --priority -p type=string default="2" usage="Priority (0-4 or P0-P4, 0=highest)"
flag --repo type=string default="" usage="Target repository for issue (overrides auto-routing)"
flag --silent type=bool default="false" usage="Output only the issue ID (for scripting)"
flag --skills type=string default="" usage="Required skills for this issue"
flag --spec-id type=string default="" usage="Link to specification document"
flag --status -s type=string default="" usage="Initial status"
flag --stdin type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["stdin body-file" "stdin description-file" "stdin description" "stdin body" "stdin message"]} usage="Read description from stdin (alias for --body-file -)"
flag --storage-class type=string default="" usage="Storage class: versioned, unversioned, or ephemeral (default: storage-class.<type> config, else versioned)"
flag --title type=string default="" usage="Issue title (alternative to positional argument)"
flag --type -t type=string default="task" usage="Issue type (bug|feature|task|epic|chore|decision|spike|story|milestone); custom types require types.custom config; aliases: enhancement/feat→feature, dec/adr→decision"
flag --validate type=bool default="false" usage="Validate description contains required sections for issue type"
flag --waits-for type=string default="" usage="Spawner issue ID to wait for (creates waits-for dependency for fanout gate)"
flag --waits-for-gate type=string default="all-children" usage="Gate type: all-children (wait for all) or any-children (wait for first)"
flag --wisp-type type=string default="" usage="Wisp type for TTL-based compaction: heartbeat, ping, patrol, gc_report, recovery, error, escalation"
bd create-form
use: "create-form"
short: "Create a new issue using an interactive form"
group: "issues"
hidden: false
runnable: true
long:
| Create a new issue using an interactive terminal form.
|
| This command provides a user-friendly form interface for creating issues,
| with fields for title, description, type, priority, labels, and more.
|
| Use --parent to create a sub-issue under an existing parent issue.
| The child will get an auto-generated hierarchical ID (e.g., parent-id.1).
|
| The form uses keyboard navigation:
| - Tab/Shift+Tab: Move between fields
| - Enter: Submit the form (on the last field or submit button)
| - Ctrl+C: Cancel and exit
| - Arrow keys: Navigate within select fields
flag --parent type=string default="" usage="Parent issue ID for creating a hierarchical child (e.g., 'bd-a3f8e9')"
bd cursor-hook
use: "cursor-hook <event>"
short: "Run an internal Cursor agent lifecycle hook"
hidden: true
runnable: true
bd db-proxy-child
use: "db-proxy-child"
short: "Internal: run as the database proxy child process"
hidden: true
runnable: true
long:
| db-proxy-child runs the long-lived per-rootDir TCP proxy that fronts a
| DatabaseServer. It is spawned by the parent bd process via fork+exec and is
| not intended to be invoked directly by users.
flag --backend type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="backend kind: external | local-server | local-shared-server"
flag --config type=string default="" usage="path to backend server config (e.g. dolt sql-server YAML)"
flag --database type=string default="" usage="database to select when running shutdown maintenance (local-server backend)"
flag --dolt-bin type=string default="" usage="path to the dolt executable"
flag --external-host type=string default="" usage="external backend: hostname or IP of the dolt sql-server"
flag --external-keep-alive type=duration default="0s" usage="external backend: TCP keepalive period (default 30s)"
flag --external-port type=int default="0" usage="external backend: TCP port of the dolt sql-server"
flag --external-socket-path type=string default="" usage="external backend: absolute path to a unix domain socket (overrides host/port)"
flag --idle-timeout type=duration default="0s" usage="idle timeout before shutdown (0 or negative = never shut down)"
flag --logpath type=string default="" usage="path the backend server should write its stdout/stderr to"
flag --port type=int default="0" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="port to listen on"
flag --root type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="root directory holding proxy.lock, proxy.pid, proxy.log"
flag --stop-epoch type=string default="" usage="stop epoch the parent observed at spawn; the proxy aborts before publishing if it advances"
bd defer
use: "defer [id...]"
short: "Defer one or more issues for later"
hidden: false
runnable: true
long:
| Defer issues to put them on ice for later.
|
| Deferred issues are deliberately set aside - not blocked by anything specific,
| just postponed for future consideration. Unlike blocked issues, there's no
| dependency keeping them from being worked. Unlike closed issues, they will
| be revisited.
|
| Deferred issues don't show in 'bd ready' but remain visible in 'bd list'.
|
| A defer WITH a date is a snooze: once --until passes, the next ready-front
| read returns the issue to open automatically (same shape as 'bd undefer').
| A defer WITHOUT a date is the indefinite icebox: it stays deferred until
| someone runs 'bd undefer'.
|
| Examples:
| bd defer bd-abc # Icebox indefinitely (until bd undefer)
| bd defer bd-abc --until=tomorrow # Snooze: auto-wakes once the date passes
| bd defer bd-abc --reason="waiting on API access"
| bd defer bd-abc bd-def # Defer multiple issues
flag --reason type=string default="" usage="Record why this issue is being deferred (appended to notes)"
flag --until type=string default="" usage="Defer until specific time (e.g., +1h, tomorrow, next monday)"
bd delete
use: "delete <issue-id> [issue-id...]"
short: "Delete one or more issues and clean up references"
group: "issues"
hidden: false
runnable: true
long:
| Delete one or more issues and clean up all references to them.
| This command will:
| 1. Remove all dependency links (any type, both directions) involving the issues
| 2. Update text references to "[deleted:ID]" in directly connected issues
| 3. Permanently delete the issues from the database
|
| This is a destructive operation that cannot be undone. Use with caution.
|
| BATCH DELETION:
| Delete multiple issues at once:
| bd delete bd-1 bd-2 bd-3 --force
|
| Delete from file (one ID per line):
| bd delete --from-file deletions.txt --force
|
| Preview before deleting:
| bd delete --from-file deletions.txt --dry-run
|
| DEPENDENCY HANDLING (the same on a local database and against a team server):
| Default: Fails if any issue has dependents not in deletion set
| bd delete bd-1 bd-2
|
| Cascade: Recursively delete all dependents
| bd delete bd-1 --cascade --force
|
| Force: Delete and orphan dependents
| bd delete bd-1 --force
flag --cascade type=bool default="false" usage="Recursively delete all dependent issues"
flag --dry-run type=bool default="false" usage="Preview what would be deleted without making changes"
flag --force -f type=bool default="false" usage="Actually delete (without this flag, shows preview)"
flag --from-file type=string default="" usage="Read issue IDs from file (one per line)"
flag --if-revision type=string default="" usage="Apply the write only if the issue's current revision equals this value (the decimal int64 from `bd show --json`'s \"revision\" field). One id only: refused before any write when combined with more than one issue id. A mismatch writes nothing and exits 13 (vs 1 for other failures)."
bd dep
use: "dep [issue-id]"
short: "Manage dependencies"
group: "deps"
hidden: false
runnable: true
long:
| Manage dependencies between issues.
|
| When called with an issue ID and --blocks flag, creates a blocking dependency:
| bd dep <blocker-id> --blocks <blocked-id>
|
| This is equivalent to:
| bd dep add <blocked-id> <blocker-id>
|
| Examples:
| bd dep bd-xyz --blocks bd-abc # bd-xyz blocks bd-abc
| bd dep add bd-abc bd-xyz # Same as above (bd-abc depends on bd-xyz)
flag --blocks -b type=string default="" usage="Issue ID that this issue blocks (shorthand for: bd dep add <blocked> <blocker>)"
flag --no-cycle-check type=bool default="false" usage="Skip the post-add cycle warning (the per-edge cycle check still runs)"
bd dep add
use: "add [issue-id] [depends-on-id]"
short: "Add a dependency"
hidden: false
runnable: true
long:
| Add a dependency between two issues.
|
| The depends-on-id can be provided as:
| - A positional argument: bd dep add issue-123 issue-456
| - A flag: bd dep add issue-123 --blocked-by issue-456
| - A flag: bd dep add issue-123 --depends-on issue-456
|
| The --blocked-by and --depends-on flags are aliases and both mean "issue-123
| depends on (is blocked by) the specified issue."
|
| The depends-on-id can be:
| - A local issue ID (e.g., bd-xyz)
| - An external reference: external:<project>:<capability>
|
| For bulk wiring, pass newline-delimited JSON with --file. Each line must be an
| object with "from" and "to" fields, and may include "type". The aliases
| "issue_id" and "depends_on_id" are also accepted. Use --file - to read stdin.
|
| External references are stored as-is and resolved at query time using
| the external_projects config. They block the issue until the capability
| is "shipped" in the target project.
|
| With no -t/--type the edge is created as type=blocks, which excludes the
| dependent from bd ready. When stderr is an interactive terminal, an advisory
| note says so once per command; it is silent for scripted and agent callers
| (non-TTY stderr) and can be turned off with --quiet or BD_NO_DEP_TYPE_WARNING=1.
|
| Examples:
| bd dep add bd-42 bd-41 # Positional args
| bd dep add bd-42 --blocked-by bd-41 # Flag syntax (same effect)
| bd dep add bd-42 --depends-on bd-41 # Alias (same effect)
| bd dep add gt-xyz external:beads:mol-run-assignee # Cross-project dependency
| bd dep add bd-42 bd-41 --no-cycle-check # Skip the post-add cycle warning
| bd dep add --file deps.jsonl # Bulk JSONL: {"from":"bd-42","to":"bd-41"}
flag --blocked-by type=string default="" usage="Issue ID that blocks the first issue (alternative to positional arg)"
flag --depends-on type=string default="" usage="Issue ID that the first issue depends on (alias for --blocked-by)"
flag --file type=string default="" usage="Read dependency edges from JSONL file, or '-' for stdin"
flag --no-cycle-check type=bool default="false" usage="On bulk --file adds, skip per-edge cycle checks and the post-add cycle warning (one final whole-graph check still runs before commit); on a single-edge add, skip only the post-add cycle warning"
flag --type -t type=string default="blocks" usage="Dependency type (blocks|tracks|related|parent-child|discovered-from|until|caused-by|validates|relates-to|supersedes); 'blocked-by' and 'depends-on' are accepted as aliases for 'blocks'"
bd dep cycles
use: "cycles"
short: "Detect dependency cycles"
hidden: false
runnable: true
flag --include-tracks type=bool default="false" usage="Also walk 'tracks' edges: reports every cycle the default walk finds plus cycles that close through a tracks edge, never a loop made only of tracks edges (diagnostic for molecule-root deadlocks hidden by tracks-only propagation)"
flag --limit type=int default="50" usage="Maximum cycles to print (0 = no limit); the reported total is always the whole count, and --json is never truncated"
bd dep list
use: "list [issue-id...]"
short: "List dependencies or dependents of one or more issues"
hidden: false
runnable: true
long:
| List dependencies or dependents of one or more issues with optional type filtering.
|
| By default shows dependencies (what issues depend on). Use --direction to control:
| - down: Show dependencies (what this issue depends on) - default
| - up: Show dependents (what depends on this issue)
|
| Multiple IDs can be provided for batch dep listing. With --json, the output
| is a flat array of dependency records across all requested issues.
|
| Use --type to filter by dependency type (e.g., tracks, blocks, parent-child).
|
| Examples:
| bd dep list gt-abc # Show what gt-abc depends on
| bd dep list gt-abc gt-def # Batch: deps for both issues
| bd dep list gt-abc --direction=up # Show what depends on gt-abc
| bd dep list gt-abc --direction=up -t tracks # Show what tracks gt-abc (convoy tracking)
flag --direction type=string default="down" usage="Direction: 'down' (dependencies), 'up' (dependents)"
flag --type -t type=string default="" usage="Filter by dependency type (e.g., tracks, blocks, parent-child)"
bd dep relate
use: "relate <id1> <id2>"
short: "Create a bidirectional relates_to link between issues"
hidden: false
runnable: true
long:
| Create a loose 'see also' relationship between two issues.
|
| The relates_to link is bidirectional - both issues will reference each other.
| This enables knowledge graph connections without blocking or hierarchy.
|
| Examples:
| bd relate bd-abc bd-xyz # Link two related issues
| bd relate bd-123 bd-456 # Create see-also connection
bd dep remove
use: "remove [issue-id] [depends-on-id]"
aliases: ["rm"]
short: "Remove a dependency"
hidden: false
runnable: true
bd dep tree
use: "tree [issue-id]"
short: "Show dependency tree"
hidden: false
runnable: true
long:
| Show dependency tree rooted at the given issue.
|
| By default, shows dependencies (what blocks this issue). Use --direction to control:
| - down: Show dependencies (what blocks this issue) - default
| - up: Show dependents (what this issue blocks)
| - both: Show full graph in both directions
|
| Examples:
| bd dep tree gt-0iqq # Show what blocks gt-0iqq
| bd dep tree gt-0iqq --direction=up # Show what gt-0iqq blocks
| bd dep tree gt-0iqq --status=open # Only show open issues
| bd dep tree gt-0iqq --depth=3 # Limit to 3 levels deep
|
| A node reached by two paths is shown ONCE, under the first path that got
| there, and a cycle simply ends the descent. --show-all-paths is a deprecated
| no-op; use 'bd dep cycles' to find circular dependencies.
|
| --max-rows / BEADS_MAX_ROWS caveat: the tree walk has no query filter to
| thread the cap through, so the full tree is always built first and the
| node count is checked afterward (post-hoc), not during the walk. The cap is
| honored on the --proxied-server route too, which it was not before.
flag --direction type=string default="" usage="Tree direction: 'down' (dependencies), 'up' (dependents), or 'both'"
flag --format type=string default="" usage="Output format: 'mermaid' for Mermaid.js flowchart"
flag --max-depth -d type=int default="50" usage="Maximum tree depth to display (safety limit)"
flag --max-rows type=int default="0" usage="Hard upper bound on rows returned. Returns a non-zero exit (code 2) and an error to stderr if exceeded. 0 disables (the default). Overrides BEADS_MAX_ROWS for this invocation. Useful in CI/agent rigs that want a circuit breaker against pathological queries. Honored on both the direct and the --proxied-server route."
flag --reverse type=bool default="false" usage="Show dependent tree (deprecated: use --direction=up)"
flag --show-all-paths type=bool default="false" usage="Deprecated no-op: accepted and ignored. A node reached by two paths is shown once, under the first."
flag --status type=string default="" usage="Filter to only show issues with this status (open, in_progress, blocked, deferred, closed)"
bd dep unrelate
use: "unrelate <id1> <id2>"
short: "Remove a relates_to link between issues"
hidden: false
runnable: true
long:
| Remove a relates_to relationship between two issues.
|
| Removes the link in both directions.
|
| Example:
| bd unrelate bd-abc bd-xyz
bd diff
use: "diff <from-ref> <to-ref>"
short: "Show changes between two commits or branches"
group: "views"
hidden: false
runnable: true
long:
| Show the differences in issues between two commits or branches.
|
| The refs can be:
| - Commit hashes (e.g., abc123def)
| - Branch names (e.g., main, feature-branch)
| - Special refs like HEAD, HEAD~1
|
| Examples:
| bd diff main feature-branch # Compare main to feature branch
| bd diff HEAD~5 HEAD # Show changes in last 5 commits
| bd diff abc123 def456 # Compare two specific commits
bd doctor
use: "doctor [path]"
short: "Check and fix beads installation health (start here)"
group: "maint"
hidden: false
runnable: true
annotations: {bd:skip_store="1"}
long:
| Sanity check the beads installation for the current directory or specified path.
|
| This command checks:
| - If .beads/ directory exists
| - Database version and migration status
| - Schema compatibility (all required tables and columns present)
| - Whether using hash-based vs sequential IDs
| - If CLI version is current (checks GitHub releases)
| - If Claude plugin is current (when running in Claude Code)
| - File permissions
| - Circular dependencies
| - Git hooks (pre-commit, post-merge, pre-push)
| - .beads/.gitignore up to date
| - Metadata.json version tracking (LastBdVersion field)
|
| Storage Availability:
| Full diagnostics, --perf, --deep, --server, --migration, and
| --check=validate currently require Dolt server mode. Embedded Dolt
| supports --check=artifacts, --check=conventions, and
| --check=pollution. --check-health has a limited hook-health fallback.
| Unsupported combinations return a notice without changing storage.
|
| Performance Mode (--perf):
| Run performance diagnostics on your database:
| - Times key operations (bd ready, bd list, bd show, etc.)
| - Collects system info (OS, arch, database stats)
| - Generates CPU profile for analysis
| - Outputs shareable report for bug reports
|
| Export Mode (--output):
| Save diagnostics to a JSON file for historical analysis and bug reporting.
| Includes timestamp and platform info for tracking intermittent issues.
|
| Specific Check Mode (--check):
| Run a specific check in detail. Available checks:
| - artifacts: Detect and optionally clean beads classic artifacts
| (stale JSONL, SQLite files, cruft .beads dirs). Use with --clean.
| - conventions: Check for convention drift (lint warnings, stale
| issues, orphaned issues). Advisory only - warns, never blocks.
| - pollution: Detect and optionally clean test issues from database
| - validate: Run focused data-integrity checks (duplicates, orphaned
| deps, test pollution, git conflicts). Use with --fix to auto-repair.
|
| Deep Validation Mode (--deep):
| Validate full graph integrity. May be slow on large databases.
| Additional checks:
| - Parent consistency: All parent-child deps point to existing issues
| - Dependency integrity: All deps reference valid issues
| - Epic completeness: Find epics ready to close (all children closed as
| completed work; duplicate/wontfix/superseded closes do not count)
| - Agent bead integrity: Agent beads have valid state values
| - Mail thread integrity: Thread IDs reference existing issues
| - Molecule integrity: Molecules have valid parent-child structures
|
| Server Mode (--server):
| Run health checks for Dolt server mode connections (bd-dolt.2.3):
| - Server reachable: Can connect to configured host:port?
| - Dolt version: Is it a Dolt server (not vanilla MySQL)?
| - Database exists: Does the 'beads' database exist?
| - Schema compatible: Can query beads tables?
| - Connection pool: Pool health metrics
|
| Legacy Dolt Migration Validation Mode (--migration):
| Retained for older SQLite-to-Dolt migration workflows and available only in
| Dolt server mode. It is not the migration path for removed backends
| (PostgreSQL, MySQL, SQLite); those fail closed with export/import guidance.
| Combine
| with --json for machine-parseable diagnostic output.
|
| Agent Mode (--agent):
| Output diagnostics designed for AI agent consumption. Instead of terse
| pass/fail messages, each issue includes:
| - Observed state: what the system actually looks like
| - Expected state: what it should look like
| - Explanation: full prose context about the issue and why it matters
| - Commands: exact remediation commands to run
| - Source files: where in the codebase to investigate further
| - Severity: blocking (prevents operation), degraded (partial function),
| or advisory (informational only)
| ZFC-compliant: Go observes and reports, the agent decides and acts.
| Combine with --json for structured agent-facing output.
|
| Suppressing Warnings:
| Suppress specific warnings by setting doctor.suppress.<check-slug> config:
| bd config set doctor.suppress.pending-migrations true
| bd config set doctor.suppress.git-hooks true
| Check names are converted to slugs: "Git Hooks" → "git-hooks".
| Only warnings are suppressed; errors and passing checks always show.
| To unsuppress: bd config unset doctor.suppress.<slug>
|
| Examples:
| bd doctor # Check current directory
| bd doctor /path/to/repo # Check specific repository
| bd doctor --json # Machine-readable output
| bd doctor --agent # Agent-facing diagnostic output
| bd doctor --agent --json # Structured agent diagnostics (JSON)
| bd doctor --fix # Automatically fix issues (with confirmation)
| bd doctor --fix --yes # Automatically fix issues (no confirmation)
| bd doctor --fix -i # Confirm each fix individually
| bd doctor --fix --fix-child-parent # Also fix child→parent deps (opt-in)
| bd doctor --fix --force # Force repair even when database can't be opened
| bd doctor --fix --source=jsonl # Rebuild database from a JSONL export
| bd doctor --dry-run # Preview what --fix would do without making changes
| bd doctor --perf # Performance diagnostics
| bd doctor --output diagnostics.json # Export diagnostics to file
| bd doctor --check=artifacts # Show classic artifacts (JSONL, SQLite, cruft dirs)
| bd doctor --check=artifacts --clean # Delete safe-to-delete artifacts (with confirmation)
| bd doctor --check=conventions # Convention drift check (lint, stale, orphans)
| bd doctor --check=pollution # Show potential test issues
| bd doctor --check=pollution --clean # Delete test issues (with confirmation)
| bd doctor --check=validate # Data-integrity checks only
| bd doctor --check=validate --fix # Auto-fix data-integrity issues
| bd doctor --deep # Full graph integrity validation
| bd doctor --server # Dolt server mode health checks
| bd doctor --migration=pre # Legacy Dolt-server migration diagnostic
| bd doctor --migration=post # Legacy Dolt-server completion diagnostic
| bd doctor --migration=pre --json # Machine-parseable legacy diagnostic
flag --agent type=bool default="false" usage="Agent-facing diagnostic mode: rich context for AI agents (ZFC-compliant)"
flag --check type=string default="" usage="Run specific check in detail (e.g., 'pollution')"
flag --check-health type=bool default="false" usage="Quick health check for git hooks (silent on success)"
flag --clean type=bool default="false" usage="For pollution check: delete detected test issues"
flag --deep type=bool default="false" usage="Validate full graph integrity"
flag --dry-run type=bool default="false" usage="Preview fixes without making changes"
flag --fix type=bool default="false" usage="Automatically fix issues where possible"
flag --fix-child-parent type=bool default="false" usage="Remove child→parent dependencies (opt-in)"
flag --interactive -i type=bool default="false" usage="Confirm each fix individually"
flag --migration type=string default="" usage="Run legacy Dolt-server migration diagnostics: 'pre' or 'post'"
flag --orchestrator type=bool default="false" usage="Running in orchestrator multi-workspace mode (routes.jsonl is expected, higher duplicate tolerance)"
flag --orchestrator-duplicates-threshold type=int default="1000" usage="Duplicate tolerance threshold for orchestrator mode (wisps are ephemeral)"
flag --output -o type=string default="" usage="Export diagnostics to JSON file"
flag --perf type=bool default="false" usage="Run performance diagnostics and generate CPU profile"
flag --server type=bool default="false" usage="Run Dolt server mode health checks (connectivity, version, schema)"
flag --verbose -v type=bool default="false" usage="Show all checks (default shows only warnings/errors)"
flag --yes -y type=bool default="false" usage="Skip confirmation prompt (for non-interactive use)"
bd dolt
use: "dolt"
short: "Configure Dolt database settings"
group: "setup"
hidden: false
runnable: false
long:
| Configure and manage Dolt database settings and server lifecycle.
|
| Beads runs Dolt embedded (in-process) by default: there is no sql-server and
| nothing is auto-started. A database only uses a dolt sql-server when it is
| configured for one: shared-server mode, an explicit server mode, or a
| non-localhost dolt_server_host. The server-only commands below fail with
| "not supported in embedded mode (no Dolt server)" on an embedded database.
|
| Server lifecycle (server mode only):
| bd dolt start Start the Dolt server for this project
| bd dolt stop Stop the Dolt server for this project
|
| Diagnostics (both modes):
| bd dolt status Show Dolt engine status (embedded: in-process, data dir)
| bd dolt show Show current Dolt configuration with connection test
|
| Configuration (server mode only):
| bd dolt set <k> <v> Set a configuration value
| bd dolt test Test server connection
|
| Version control:
| bd dolt commit Commit pending changes
| bd dolt push Push commits to Dolt remote
| bd dolt pull Pull commits from Dolt remote
|
| Remote management:
| bd dolt remote add <name> <url> Add a Dolt remote
| bd dolt remote list List configured remotes
| bd dolt remote remove <name> Remove a Dolt remote
|
| Configuration keys for 'bd dolt set':
| database Database name (default: issue prefix or "beads")
| host Server host (default: 127.0.0.1)
| port Server port (auto-detected; override with bd dolt set port <N>)
| user MySQL user (default: root)
| data-dir Custom dolt data directory (absolute path; default: .beads/dolt)
|
| Remote server authentication (password + TLS) is NOT stored via 'bd dolt set'
| (keeps secrets out of metadata.json). Configure them with:
|
| BEADS_DOLT_PASSWORD Server password (highest priority)
| BEADS_DOLT_SERVER_TLS Enable TLS (set to "1" or "true")
| BEADS_DOLT_SERVER_USER MySQL user override (else use 'bd dolt set user')
| BEADS_CREDENTIALS_FILE Optional path to credentials file
|
| Default credentials file: ~/.config/beads/credentials (Linux/macOS)
| %APPDATA%\beads\credentials (Windows)
| Format (INI, section = host:port of the resolved connection):
| [127.0.0.1:3307]
| password = secret
|
| Password resolution: BEADS_DOLT_PASSWORD → credentials [host:port] → empty.
| Full reference: docs/architecture/dolt.md (Environment Variables / Credentials).
|
| Flags for 'bd dolt set':
| --update-config Also write to config.yaml for team-wide defaults
|
| Examples:
| bd dolt set database myproject
| bd dolt set host 192.168.1.100 --update-config
| bd dolt set data-dir /home/user/.beads-dolt/myproject
| export BEADS_DOLT_PASSWORD=... BEADS_DOLT_SERVER_TLS=1
| bd dolt test
bd dolt clean-databases
use: "clean-databases"
short: "Drop stale test databases from the Dolt server"
hidden: false
runnable: true
long:
| Identify and drop leftover test and agent databases that accumulate
| on the shared Dolt server from interrupted test runs and terminated agents.
|
| Stale database prefixes: testdb_*, beads_test*, beads_pt*, beads_vr*, doctest_*, doctortest_*, benchdb_*
|
| These waste server memory and can degrade performance under concurrent load.
| Use --dry-run to see what would be dropped without actually dropping.
|
| DROP DATABASE only marks a database as dropped; Dolt keeps its directory
| under .dolt_dropped_databases/ so it can be restored with
| CALL DOLT_UNDROP(name) until an explicit purge — disk is not reclaimed
| until then. Pass --purge-dropped to run CALL DOLT_PURGE_DROPPED_DATABASES()
| after cleanup.
|
| --purge-dropped is SERVER-GLOBAL and IRREVERSIBLE. Dolt has no way to scope
| the purge to only the databases this run dropped: it permanently deletes
| every dropped-but-not-yet-purged database on the server, including ones
| dropped by something else entirely (e.g. an operator's accidental
| DROP DATABASE on an unrelated database that was still recoverable via
| DOLT_UNDROP). It also purges pre-existing residue from earlier
| clean-databases runs even if this run finds no stale databases to drop.
| Only pass it when nothing else on the server may be relying on DOLT_UNDROP
| recovery.
flag --dry-run type=bool default="false" usage="Show what would be dropped without dropping"
flag --purge-dropped type=bool default="false" usage="After dropping, also run CALL DOLT_PURGE_DROPPED_DATABASES() — server-global and irreversible, see --help"
bd dolt commit
use: "commit"
short: "Create a Dolt commit from pending changes"
hidden: false
runnable: true
long:
| Create a Dolt commit from any uncommitted changes in the working set.
|
| This is the primary commit point for batch mode. When auto-commit is set to
| "batch", changes accumulate in the working set across multiple bd commands and
| are committed together here with a descriptive summary message.
|
| Also useful before push operations that require a clean working set, or when
| auto-commit was off or changes were made externally.
|
| For more options (--stdin, custom messages), see: bd vc commit
flag --message -m type=string default="" usage="Commit message (default: auto-generated)"
bd dolt killall
use: "killall"
short: "Kill all orphan Dolt server processes"
hidden: false
runnable: true
long:
| Find and kill orphan dolt sql-server processes not tracked by the
| canonical PID file for the current repo's Dolt data directory.
|
| Under an orchestrator, the canonical server lives at $GT_ROOT/.beads/. Any other
| dolt sql-server processes using that shared data directory are considered
| orphans and will be killed.
|
| In standalone mode, only dolt sql-server processes using the current
| project's Dolt data directory are eligible for cleanup. Other projects'
| servers are preserved.
bd dolt pull
use: "pull"
short: "Pull commits from Dolt remote"
hidden: false
runnable: true
long:
| Pull commits from the configured Dolt remote into the local database.
|
| Requires a Dolt remote to be configured in the database directory.
| For Hosted Dolt, set DOLT_REMOTE_USER and DOLT_REMOTE_PASSWORD environment
| variables for authentication.
|
| Use --remote to pull from a specific named remote instead of the default.
| The remote must already exist (see 'bd dolt remote add').
|
| Use --strategy ours|theirs to resolve conflicts the auto-resolver declines
| (e.g. both sides edited the same issue since the last sync) instead of
| aborting the pull for manual resolution. Embedded storage only (#4992); on
| server-mode/sql-server storage use 'bd conflicts resolve' after a pull that
| reports conflicts.
flag --remote type=string default="" usage="Pull from a specific named remote instead of the default"
flag --strategy type=string default="" usage="Conflict resolution strategy for conflicts the auto-resolver declines: 'ours' or 'theirs' (embedded storage only, #4992)"
bd dolt push
use: "push"
short: "Push commits to Dolt remote"
hidden: false
runnable: true
long:
| Push local Dolt commits to the configured remote.
|
| Requires a Dolt remote to be configured in the database directory. With no
| remote configured, bd can adopt one derived from git origin — only with
| consent: interactively, or via --yes; --no-adopt or BD_NO_REMOTE_ADOPT=1
| disables adoption entirely.
| For Hosted Dolt, set DOLT_REMOTE_USER and DOLT_REMOTE_PASSWORD environment
| variables for authentication.
|
| Use --force to overwrite remote changes (e.g., when the remote has
| uncommitted changes in its working set).
|
| Use --remote to push to a specific named remote instead of the default.
| The remote must already exist (see 'bd dolt remote add').
flag --force type=bool default="false" usage="Force push (overwrite remote changes)"
flag --no-adopt type=bool default="false" usage="Never derive a Dolt remote from git origin (also BD_NO_REMOTE_ADOPT=1)"
flag --remote type=string default="" usage="Push to a specific named remote instead of the default"
flag --yes -y type=bool default="false" usage="Consent to adopting a Dolt remote derived from git origin when none is configured"
bd dolt remote
use: "remote"
short: "Manage Dolt remotes"
hidden: false
runnable: false
long:
| Manage Dolt remotes for push/pull replication.
|
| Subcommands:
| add <name> <url> Add a new remote
| list List all configured remotes
| remove <name> Remove a remote
| reset-data <name> Replace a remote's data plane after a history squash
bd dolt remote add
use: "add <name> <url>"
short: "Add a Dolt remote"
hidden: false
runnable: true
flag --allow-git-origin type=bool default="false" usage="Allow adding a Dolt remote whose URL matches the git origin (proceed with a warning instead of aborting)"
bd dolt remote list
use: "list"
short: "List configured Dolt remotes"
hidden: false
runnable: true
bd dolt remote remove
use: "remove <name>"
short: "Remove a Dolt remote"
hidden: false
runnable: true
bd dolt remote reset-data
use: "reset-data <name>"
short: "Replace a remote's data plane in place after a history squash"
hidden: false
runnable: true
long:
| Replace a Dolt remote's stored data with a fresh copy of local HEAD.
|
| After a history squash (see the History Bloat recovery runbook), a plain
| 'bd dolt push --force' re-points the remote's refs but deletes nothing:
| Dolt remotes accumulate chunks monotonically, so the remote keeps the full
| pre-squash store. This command rebuilds the remote's data plane so it holds
| only live chunks:
|
| - Git-backed remotes (issue data riding a git remote under refs/dolt/data):
| deletes the Dolt data refs on the git remote, then force-pushes to
| rebuild a fresh store. Code branches are untouched.
| - Native file remotes (file:// paths): clears the store directory, then
| force-pushes to rebuild it.
| - Cloud/hosted remotes (aws://, gs://, dolthub://, ...): bd cannot clear
| the stored data safely — replace the remote with a fresh URL or prefix:
| bd dolt remote remove <name>
| bd dolt remote add <name> <fresh-url>
| bd dolt push --force
|
| This rewrites the remote's data plane. Every other clone must re-clone from
| the reset remote (that is already true after the squash itself). Refuses to
| run with uncommitted working-set changes: the rebuilt remote holds exactly
| HEAD, and anything uncommitted would not be part of it.
|
| Examples:
| bd dolt remote reset-data origin # prompts for confirmation
| bd dolt remote reset-data origin --yes # no prompt (scripts, agents)
flag --yes -y type=bool default="false" usage="Skip the confirmation prompt (required in non-interactive use)"
bd dolt set
use: "set <key> <value>"
short: "Set a Dolt configuration value"
hidden: false
runnable: true
long:
| Set a Dolt configuration value in metadata.json.
|
| Keys:
| database Database name (default: issue prefix or "beads")
| host Server host (default: 127.0.0.1)
| port Server port (auto-detected; override with bd dolt set port <N>)
| user MySQL user (default: root)
| data-dir Custom dolt data directory (absolute path; default: .beads/dolt)
|
| There is no 'password' or 'tls' key here on purpose — secrets and TLS must
| not land in metadata.json. Use environment variables or the credentials file:
|
| BEADS_DOLT_PASSWORD Server password (highest priority)
| BEADS_DOLT_SERVER_TLS Enable TLS ("1" or "true")
| BEADS_CREDENTIALS_FILE Optional override path for credentials
|
| Default credentials file: ~/.config/beads/credentials
| Format:
| [host:port]
| password = secret
|
| See: bd dolt --help and docs/architecture/dolt.md
|
| Use --update-config to also write to config.yaml for team-wide defaults.
|
| Examples:
| bd dolt set database myproject
| bd dolt set host 192.168.1.100
| bd dolt set port 3307 --update-config
| bd dolt set data-dir /home/user/.beads-dolt/myproject
| export BEADS_DOLT_PASSWORD=... BEADS_DOLT_SERVER_TLS=1
flag --update-config type=bool default="false" usage="Also write to config.yaml for team-wide defaults"
bd dolt show
use: "show"
short: "Show current Dolt configuration with connection status"
hidden: false
runnable: true
bd dolt start
use: "start"
short: "Start the Dolt SQL server for this project"
hidden: false
runnable: true
long:
| Start a dolt sql-server for the current beads project.
|
| The server runs in the background on a per-project port derived from the
| project path. PID and logs are stored in .beads/.
|
| The server auto-starts transparently when needed, so manual start is rarely
| required. Use this command for explicit control or diagnostics.
|
| Not available in proxied-server mode: there the proxy owns its dolt backend's
| lifecycle and starts it on demand, so a server started here would be a second,
| unsupervised one over the same data directory. Use 'bd dolt status' to see what
| is running and 'bd dolt stop' to shut it down.
bd dolt status
use: "status"
short: "Show Dolt engine status"
hidden: false
runnable: true
long:
| Show the status of the Dolt engine for the current project.
|
| In embedded mode, reports that the Dolt engine runs in-process and shows
| the on-disk data directory. For beads-managed (local) servers, displays
| PID, port, and data directory from the local PID file. For externally-
| managed servers — a shared server (dolt.shared-server: true), a remote
| dolt_server_host, or a local server managed outside bd (dolt.auto-start:
| false, e.g. an orchestrator-shared sql-server) — pings the configured
| endpoint via SQL and reports reachability, server version, and database.
|
| In proxied-server mode, reports the proxy (the endpoint every bd command
| connects through) and the dolt backend behind it separately, read from the
| proxy's own process records. Reporting starts nothing: a quiesced workspace
| is shown as not running, and the next bd command launches it.
bd dolt stop
use: "stop"
short: "Stop the Dolt SQL server for this project"
hidden: false
runnable: true
long:
| Stop the dolt sql-server managed by beads for the current project.
|
| This sends a graceful shutdown signal. The server will restart automatically
| on the next bd command unless auto-start is disabled.
|
| For a managed proxied server, --force can recover unverifiable or legacy
| process records (both the proxy and its backend) only after each live process
| executable is matched to bd or dolt and its command line ties it to this
| workspace. In that recovery path, force still refuses to signal a process
| whose executable identity cannot be matched to bd or dolt, or whose workspace
| scope cannot be established.
flag --force type=bool default="false" usage="Force stop (proxied recovery still requires a bd/dolt executable match)"
bd dolt test
use: "test"
short: "Test connection to Dolt server"
hidden: false
runnable: true
long:
| Test the connection to the configured Dolt server.
|
| This verifies that:
| 1. The server is reachable at the configured host:port
| 2. The connection can be established
|
| Use this before switching to server mode to ensure the server is running.
bd duplicate
use: "duplicate <id> --of <canonical>"
short: "Mark an issue as a duplicate of another"
group: "deps"
hidden: false
runnable: true
long:
| Mark an issue as a duplicate of a canonical issue.
|
| The duplicate issue is automatically closed with a reference to the canonical.
| This is essential for large issue databases with many similar reports.
|
| Examples:
| bd duplicate bd-abc --of bd-xyz # Mark bd-abc as duplicate of bd-xyz
flag --of type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Canonical issue ID (required)"
bd duplicates
use: "duplicates"
short: "Find and optionally merge duplicate issues"
group: "deps"
hidden: false
runnable: true
long:
| Find issues with identical content (title, description, design, acceptance criteria).
| Groups issues by content hash and reports duplicates with suggested merge targets.
| The merge target is chosen by:
| 1. Reference count (most referenced issue wins)
| 2. Lexicographically smallest ID if reference counts are equal
| Only groups issues with matching status (open with open, closed with closed).
| Example:
| bd duplicates # Show all duplicate groups
| bd duplicates --auto-merge # Automatically merge all duplicates
| bd duplicates --dry-run # Show what would be merged
flag --auto-merge type=bool default="false" usage="Automatically merge all duplicates"
flag --dry-run type=bool default="false" usage="Show what would be merged without making changes"
bd edit
use: "edit [id]"
short: "Edit an issue field in $EDITOR"
group: "issues"
hidden: false
runnable: true
long:
| Edit an issue field using your configured $EDITOR.
|
| By default, edits the description. Use flags to edit other fields.
|
| Examples:
| bd edit bd-42 # Edit description
| bd edit bd-42 --title # Edit title
| bd edit bd-42 --design # Edit design notes
| bd edit bd-42 --notes # Edit notes
| bd edit bd-42 --acceptance # Edit acceptance criteria
flag --acceptance type=bool default="false" usage="Edit the acceptance criteria"
flag --description type=bool default="false" usage="Edit the description (default)"
flag --design type=bool default="false" usage="Edit the design notes"
flag --notes type=bool default="false" usage="Edit the notes"
flag --title type=bool default="false" usage="Edit the title"
bd epic
use: "epic"
short: "Epic management commands"
group: "deps"
hidden: false
runnable: false
bd epic close-eligible
use: "close-eligible"
short: "Close epics where all children are complete"
hidden: false
runnable: true
flag --dry-run type=bool default="false" usage="Preview what would be closed without making changes"
flag --reason -r type=string default="All children completed" usage="Close reason applied to every epic closed"
bd epic status
use: "status"
short: "Show epic completion status"
hidden: false
runnable: true
flag --eligible-only type=bool default="false" usage="Show only epics eligible for closure"
bd events
use: "events"
short: "Read and manage the durable events journal"
group: "maint"
hidden: false
runnable: false
long:
| Read and manage the durable events journal (bd_events_journal).
|
| The journal records every committed issue mutation as an ordered, replayable
| row. Enable it with 'bd config set events-journal true' (or
| BD_EVENTS_JOURNAL=1). Records are emitted only while it is enabled.
|
| Retention is automatic: an enabled journal is bounded to the retention floors
| (events-journal-retain-days / -rows, 7 days / 100k rows by default) without
| anyone running a command. Disable both floors for an unbounded ledger, or
| events-journal-auto-prune for manual control; 'bd events prune' remains for an
| earlier, on-demand cut below the floors.
|
| Coverage and scope:
| - Every mutation through bd's normal write paths (create, update, close,
| reopen, delete, claim, dependency add/remove, label add/remove, comment) is
| journaled in the same transaction as the change. Raw DML run through
| 'bd sql' bypasses those paths and is NOT journaled — a known non-coverage.
| - The journal is per-branch working-set state (dolt_ignored): it records the
| mutations committed on the writer's active branch. Rows arrive by direct
| write, not by merge, so a consumer must read the journal on the same branch
| the writer commits to; a branch checkout or merge does not carry journal
| rows across branches.
| - For the same reason the journal is per REPLICA. 'bd dolt pull' and the
| changes a merge settles into this clone are not journaled: those rows
| arrived as data, not as local mutations, and nothing on this clone wrote
| them through the mutation seam. A consumer that mirrors a synced workspace
| must re-baseline (a fresh export or a full re-read) after a sync, because
| the journal describes only what THIS clone mutated.
| Each replica also has its OWN seq space, counted from its own first
| mutation. A checkpoint taken against one replica is meaningless against
| another — the same seq names a different record, and a seq above the other
| replica's head reads as "caught up" and stalls forever. Track a checkpoint
| per replica, and re-baseline rather than carry one across.
| - A few writes that happen while a store is being OPENED are unjournaled by
| design: schema migrations and the version reconciliation that runs before
| the workspace's configuration has been applied to the store. They touch
| schema and clone-local metadata, never a bead, so a replaying consumer has
| nothing to apply them to.
| - Dependency records are not symmetric, in two ways.
| Count: a dep_add is emitted for every accepted add, INCLUDING an idempotent
| same-type re-add that only refreshes the edge's metadata. The audit 'events'
| table deduplicates that case and writes nothing; the journal does not. Treat
| dep_add as an upsert of the edge, not as proof the edge is new. A dep_remove
| naming an edge that is already gone emits nothing at all.
| Payload: dep.metadata differs in provenance between the two ops. On dep_add
| it is the value being written, as the caller supplied it; on dep_remove it is
| the raw stored column read back just before the delete. The two can differ
| byte for byte while meaning the same thing, so compare parsed values.
|
| Structural dependency edits — the ones bd wires up itself rather than a 'bd dep'
| verb — write no audit event but DO journal, by design: a replaying consumer
| needs the edge either way.
bd events export
use: "export"
short: "Print the entire journal from the beginning (JSON lines)"
hidden: false
runnable: true
long:
| Print every events journal record from seq 1, in order, as JSON lines.
|
| Equivalent to 'bd events tail --since 0'. Like tail, it FAILS rather than
| present a pruned journal's surviving suffix as a complete history.
flag --limit type=int default="0" usage="maximum number of records to return (0 = no limit)"
bd events prune
use: "prune"
short: "Delete journal records below a sequence number (retention)"
hidden: false
runnable: true
long:
| Delete events journal records with seq less than --before.
|
| Retention is already enforced automatically: after a mutating command commits,
| and on a timer in 'bd serve', bd deletes everything the floors below do not
| protect. This command is for an EARLIER, on-demand cut BELOW the floors — after
| a consumer has durably processed a span you do not want to wait out. It cannot
| cut deeper than the floors: shrinking the retained window itself means lowering
| them. The journal is clone-local operational state, so pruning never affects
| issue data.
|
| Two retention floors compose onto --before and can only reduce what a prune
| removes. They bound the automatic prune and this one identically:
| events-journal-retain-days keep every row younger than N days (default 7)
| events-journal-retain-rows always keep the newest N rows (default 100000)
|
| Set BOTH floors to 0 for an unbounded ledger: automatic pruning then does
| nothing, and this command becomes the only thing that deletes a record. To keep
| the floors but own deletion yourself, set events-journal-auto-prune false.
|
| Note the floors are time-based and count-based — they are NOT a consumer
| watermark. They protect only the recent window; a consumer that has fallen
| further behind than both floors allow will be pruned past and lose records.
| Consumers are responsible for tracking their own watermark (the highest seq they
| have durably processed) and for sizing the floors to the longest outage they
| intend to survive. Pruned history cannot be recovered from the workspace — the
| journal is the only local copy. Pruning frees rows, not disk: pair it with
| 'dolt gc' to reclaim the space, since the table is working-set (dolt_ignored)
| state that ordinary Dolt commits never garbage-collect.
flag --before type=int64 default="0" usage="delete records with seq less than this value"
bd events tail
use: "tail"
short: "Print journal records after a sequence number (JSON lines)"
hidden: false
runnable: true
long:
| Print events journal records with seq greater than --since, in order.
|
| Each line is a JSON record:
| {"seq":N,"ts":"...","op":"create|update|close|delete|dep_add|dep_remove|comment",
| "issue_id":"...","actor":"...","issue":{...|null},"dep":{"kind":..,"target":..,"metadata":..},"comment":{...}}
|
| Record contract (stable for external consumers):
| seq int64 counter-assigned inside the mutation's transaction; gapless,
| strictly increasing in commit order, never reused or reset
| ts string UTC insert time, stamped inside the committing transaction
| op string one of the seven ops above
| issue_id string the mutated issue's id
| actor string the acting identity that performed the mutation, as resolved
| for the audit-events table (on a comment row: the comment's
| author). A delete — and the dep_remove rows a cascading
| delete produces — carries the identity that REQUESTED it.
| Empty (omitted) only when the path genuinely has no actor:
| derived maintenance, system cleanup with no request behind
| it, and rows older than the column. Never user attribution
| when empty.
| issue object full issue state AFTER the mutation; null on delete
| dep object {"kind","target","metadata"} for dep_add / dep_remove; omitted otherwise
| comment object {"id","author","text","created_at","source"} for comment; omitted otherwise
|
| Poll with the highest seq seen to consume new mutations incrementally, or pass
| --follow to keep printing new records as they are committed (Ctrl-C to stop).
|
| Retention boundary: if --since is below the oldest retained record — the prefix
| you asked for was pruned — the read FAILS instead of silently skipping ahead or
| returning an empty success. With --json the failure carries
| {"code":"events_journal_truncated","since":N,"floor":F,"head":H}: floor is the
| oldest seq still retained, head the highest ever assigned. Resume from floor-1
| to continue with a known gap, or rebuild from a full export.
flag --follow type=bool default="false" usage="keep printing new records as they are committed (Ctrl-C to stop)"
flag --limit type=int default="0" usage="maximum number of records to return (0 = no limit)"
flag --since type=int64 default="0" usage="return records with seq greater than this value"
bd export
use: "export"
short: "Export issues to JSONL format"
group: "sync"
hidden: false
runnable: true
long:
| Export all issues to JSONL (newline-delimited JSON) format.
|
| Each line is a complete JSON object representing one issue, including its
| labels, dependencies, and comments.
|
| This command is for issue export, migration, and interoperability. It exports
| records from the issues table; it is not a full database backup and does not
| capture Dolt branches, commit history, working-set state, or non-issue tables.
| For supported full backup/restore flows, use 'bd backup init', 'bd backup sync',
| and 'bd backup restore'.
|
| By default, exports only regular issues (excluding infrastructure beads
| like agents, roles, and messages). Use --all to include everything.
|
| Memories (from 'bd remember') are excluded by default because they may
| contain sensitive agent context. Use --include-memories or --all to
| include them.
|
| EXAMPLES:
| bd export # Export issues to stdout
| bd export -o issues.jsonl # Export issues to file
| bd export --include-memories # Export issues + memories
| bd export --all -o full.jsonl # Include infra + templates + gates + memories
| bd export --scrub -o clean.jsonl # Exclude test/pollution records
flag --all type=bool default="false" usage="Include all records (infra, templates, gates, memories)"
flag --exclude-owner type=stringArray default="[]" usage="Exclude issues created by this identity (repeatable; also reads export.exclude_owners config)"
flag --include-infra type=bool default="false" usage="Include infrastructure beads (agents, roles, messages)"
flag --include-memories type=bool default="false" usage="Include persistent memories (from 'bd remember') in the export"
flag --no-memories type=bool default="false" hidden usage="Exclude persistent memories (deprecated: now the default)"
flag --output -o type=string default="" usage="Output file path (default: stdout)"
flag --scrub type=bool default="false" usage="Exclude test/pollution records"
flag --verbose type=bool default="false" usage="Print filtered issue count when owners are excluded"
bd federation
use: "federation"
short: "Manage peer-to-peer federation with other workspaces"
group: "sync"
hidden: false
runnable: false
long:
| Manage peer-to-peer federation between Dolt-backed beads databases.
|
| Federation enables synchronized issue tracking across multiple workspaces,
| each maintaining their own Dolt database while sharing updates via remotes.
|
| Requires the Dolt storage backend.
bd federation add-peer
use: "add-peer <name> <url>"
short: "Add a federation peer with optional SQL credentials"
hidden: false
runnable: true
long:
| Add a new federation peer remote with optional SQL user authentication.
|
| The URL can be:
| - dolthub://org/repo DoltHub hosted repository
| - host:port/database Direct dolt sql-server connection
| - file:///path/to/repo Local file path (for testing)
|
| Credentials are encrypted and stored locally. They are used automatically
| when syncing with the peer. If --user is provided without --password,
| you will be prompted for the password interactively.
|
| Examples:
| bd federation add-peer town-beta dolthub://acme/town-beta-beads
| bd federation add-peer town-gamma 192.168.1.100:3306/beads --user sync-bot
| bd federation add-peer partner https://partner.example.com/beads --user admin --password secret
flag --password -p type=string default="" usage="SQL password (prompted if --user set without --password)"
flag --sovereignty type=string default="" usage="Sovereignty tier (T1, T2, T3, T4)"
flag --user -u type=string default="" usage="SQL username for authentication"
bd federation list-peers
use: "list-peers"
short: "List configured federation peers"
hidden: false
runnable: true
bd federation remove-peer
use: "remove-peer <name>"
short: "Remove a federation peer"
hidden: false
runnable: true
bd federation status
use: "status [--peer name]"
short: "Show federation sync status"
hidden: false
runnable: true
long:
| Show synchronization status with peer towns.
|
| Displays:
| - Configured peers and their URLs
| - Commits ahead/behind each peer
| - Whether there are unresolved conflicts
|
| Examples:
| bd federation status # Status for all peers
| bd federation status --peer town-beta # Status for specific peer
flag --peer type=string default="" usage="Specific peer to check"
bd federation sync
use: "sync [--peer name]"
short: "Synchronize with a peer town"
hidden: false
runnable: true
long:
| Pull from and push to peer towns.
|
| Without --peer, syncs with all configured peers.
| With --peer, syncs only with the specified peer.
|
| Handles merge conflicts using the configured strategy:
| --strategy ours Keep local changes on conflict
| --strategy theirs Accept remote changes on conflict
|
| If no strategy is specified and conflicts occur, the sync will pause
| and report which tables have conflicts for manual resolution.
|
| Examples:
| bd federation sync # Sync with all peers
| bd federation sync --peer town-beta # Sync with specific peer
| bd federation sync --strategy theirs # Auto-resolve using remote values
flag --peer type=string default="" usage="Specific peer to sync with"
flag --strategy type=string default="" usage="Conflict resolution strategy (ours|theirs)"
bd find-duplicates
use: "find-duplicates"
aliases: ["find-dups"]
short: "Find semantically similar issues using text analysis or AI"
group: "views"
hidden: false
runnable: true
long:
| Find issues that are semantically similar but not exact duplicates.
|
| Unlike 'bd duplicates' which finds exact content matches, find-duplicates
| uses text similarity or AI to find issues that discuss the same topic
| with different wording.
|
| Approaches:
| mechanical Token-based text similarity (default, no API key needed)
| ai LLM-based semantic comparison (requires ANTHROPIC_API_KEY, MINIMAX_API_KEY, or ai.api_key)
|
| The mechanical approach tokenizes titles and descriptions, then computes
| Jaccard similarity between all issue pairs. It's fast and free but may
| miss semantically similar issues with very different wording.
|
| The AI approach sends candidate pairs to an Anthropic-compatible model for semantic comparison.
| It first uses mechanical pre-filtering to reduce the number of API calls,
| then asks the LLM to judge whether the remaining pairs are true duplicates.
|
| Examples:
| bd find-duplicates # Mechanical similarity (default)
| bd find-duplicates --threshold 0.4 # Lower threshold = more results
| bd find-duplicates --method ai # Use AI for semantic comparison
| bd find-duplicates --status open # Only check open issues
| bd find-duplicates --limit 20 # Show top 20 pairs
| bd find-duplicates --json # JSON output
flag --limit -n type=int default="50" usage="Maximum number of pairs to show"
flag --max-rows type=int default="0" usage="Hard upper bound on rows fetched from storage. Returns a non-zero exit (code 2) and an error to stderr if exceeded. 0 disables (the default). Overrides BEADS_MAX_ROWS for this invocation. Useful in CI/agent rigs that want a circuit breaker against pathological queries. Not supported under --proxied-server: an explicit --max-rows or BEADS_MAX_ROWS cap errors out rather than silently going unenforced."
flag --method type=string default="mechanical" usage="Detection method: mechanical, ai"
flag --model type=string default="" usage="AI model to use (only with --method ai; default from config ai.model)"
flag --status -s type=string default="" usage="Filter by status (default: non-closed)"
flag --threshold type=float64 default="0.5" usage="Similarity threshold (0.0-1.0, lower = more results)"
bd flatten
use: "flatten"
short: "Squash all Dolt history into a single commit"
group: "maint"
hidden: false
runnable: true
long:
| Nuclear option: squash ALL Dolt commit history into a single commit.
|
| This uses the Tim Sehn recipe:
| 1. Create a new branch from the current state
| 2. Soft-reset to the initial commit (preserving all data)
| 3. Commit everything as a single snapshot
| 4. Swap main branch to the new flattened branch
| 5. Prune remote-tracking refs (they would keep the old history alive;
| the next push or fetch re-creates them at the new tip)
| 6. Run a full Dolt GC (all storage generations) to reclaim the old history
|
| The GC pass is a full collection: Dolt storage is generational, and a default
| GC never revisits data an earlier GC moved to the old generation. On any store
| that has been GC'd before (bd gc, or a previous flatten or compact), only a
| full collection reclaims the squashed history. A full GC can take minutes on
| multi-gigabyte stores.
|
| This is irreversible — all commit history is lost. The resulting database
| has exactly one commit containing all current data.
|
| Use this when:
| - Your active database has grown very large
| - You don't need commit-level history (time travel)
| - You want to start fresh with minimal storage
|
| Examples:
| bd flatten --dry-run # Preview: show commit count and disk usage
| bd flatten --force # Actually squash all history
| bd flatten --force --json # JSON output
flag --dry-run type=bool default="false" usage="Preview without making changes"
flag --force -f type=bool default="false" usage="Confirm irreversible history squash"
bd forget
use: "forget <key>"
short: "Remove a persistent memory"
group: "setup"
hidden: false
runnable: true
long:
| Remove a memory by its key.
|
| Use 'bd memories' to see available keys.
|
| Examples:
| bd forget dolt-phantoms
| bd forget auth-jwt
bd formula
use: "formula"
short: "Manage workflow formulas"
hidden: false
runnable: false
long:
| Manage workflow formulas - the source layer for molecule templates.
|
| Formulas are TOML/JSON files that define workflows with composition rules.
| Define formulas, cook them into protos, then pour or wisp them into work.
|
| Search paths (in order):
| 1. <resolved-beads-dir>/formulas/ (active project)
| 2. <checkout-root>/.beads/formulas/ (repo-local formulas)
| 3. ~/.beads/formulas/ (user)
| 4. $GT_ROOT/.beads/formulas/ (shared workspace root, if GT_ROOT set)
|
| Commands:
| list List available formulas from all search paths
| show Show formula details, steps, and composition rules
| schema Show the formula schema index (alias: primitives)
|
| Discovering primitives:
| bd formula schema # list every declared formula struct
| bd formula schema loop # show LoopSpec fields, types, and tags
| bd formula primitives gate # alias; same handler as 'schema'
| examples/formulas/primitives/ # curated, smoke-tested wired fixtures
| docs/workflows/formulas.md # narrative reference
bd formula convert
use: "convert <formula-name|path> [--all]"
short: "Convert formula from JSON to TOML"
hidden: false
runnable: true
long:
| Convert formula files from JSON to TOML format.
|
| TOML format provides better ergonomics:
| - Multi-line strings without \n escaping
| - Human-readable diffs
| - Comments allowed
|
| The convert command reads a .formula.json file and outputs .formula.toml.
| The original JSON file is preserved (use --delete to remove it).
|
| Examples:
| bd formula convert shiny # Convert shiny.formula.json to .toml
| bd formula convert ./my.formula.json # Convert specific file
| bd formula convert --all # Convert all JSON formulas
| bd formula convert shiny --delete # Convert and remove JSON file
| bd formula convert shiny --stdout # Print TOML to stdout
flag --all type=bool default="false" usage="Convert all JSON formulas"
flag --delete type=bool default="false" usage="Delete JSON file after conversion"
flag --stdout type=bool default="false" usage="Print TOML to stdout instead of file"
bd formula list
use: "list"
short: "List available formulas"
hidden: false
runnable: true
long:
| List all formulas from search paths.
|
| Search paths (in order of priority):
| 1. <resolved-beads-dir>/formulas/ (active project - highest priority)
| 2. <checkout-root>/.beads/formulas/ (repo-local formulas)
| 3. ~/.beads/formulas/ (user)
| 4. $GT_ROOT/.beads/formulas/ (shared workspace root, if GT_ROOT set)
|
| Formulas in earlier paths shadow those with the same name in later paths.
|
| To list the declared formula schema structs an agent can write inside a .formula.toml,
| use 'bd formula schema' (alias: 'bd formula primitives').
|
| Examples:
| bd formula list
| bd formula list --json
| bd formula list --type workflow
| bd formula list --type convoy
flag --type type=string default="" usage="Filter by type (workflow, expansion, aspect, convoy)"
bd formula schema
use: "schema [primitive]"
aliases: ["primitives"]
short: "Show the formula schema index (every exported struct in types.go)"
hidden: false
runnable: true
long:
| Show the formula schema index: every exported struct declared
| in a .formula.toml/.formula.json, with field names, types, and tags.
|
| The index is generated from internal/formula/types.go via go:generate; the
| struct definitions are the source of truth, so this list cannot drift. It is
| structural reference, not proof that every declared runtime behavior is wired.
|
| Examples:
| bd formula schema # list every declared schema struct
| bd formula schema loop # show LoopSpec fields
| bd formula primitives gate # alias; shows Gate fields
| bd formula schema --json # machine-readable index
|
| Curated smoke-tested fixtures for wired primitives live in
| examples/formulas/primitives/ (with a smoke harness that proves they work).
bd formula show
use: "show <formula-name>"
short: "Show formula details"
hidden: false
runnable: true
long:
| Show detailed information about a formula.
|
| Displays:
| - Formula metadata (name, type, description)
| - Variables with defaults and constraints
| - Steps with dependencies
| - Composition rules (extends, aspects, expansions)
| - Bond points for external composition
|
| To inspect the structure of an individual primitive (e.g. LoopSpec, Gate)
| rather than a user-authored formula, use 'bd formula schema <primitive>'.
|
| Examples:
| bd formula show shiny
| bd formula show rule-of-five
| bd formula show security-audit --json
bd gate
use: "gate"
short: "Manage async coordination gates"
group: "issues"
hidden: false
runnable: false
long:
| Gates are async wait conditions that block workflow steps.
|
| Gates are created automatically when a formula step has a gate field.
| They must be closed (manually or via watchers) for the blocked step to proceed.
|
| Gate types:
| human - Requires manual bd close (Phase 1)
| timer - Expires after timeout (Phase 2)
| gh:run - Waits for GitHub workflow (Phase 3)
| gh:pr - Waits for PR merge (Phase 3)
| bead - Waits for another bead to close (Phase 4)
|
| For bead gates, await_id may be a bead ID in this rig's database (e.g.,
| "bd-abc123") or the historical cross-rig form <rig>:<bead-id>. Cross-rig
| targets resolve through the bead ID's prefix route in routes.jsonl.
|
| Examples:
| bd gate list # Show all open gates
| bd gate list --all # Show all gates including closed
| bd gate check # Evaluate all open gates
| bd gate check --type=bead # Evaluate only bead gates
| bd gate resolve <id> # Close a gate manually
bd gate add-waiter
use: "add-waiter <gate-id> <waiter>"
short: "Add a waiter to a gate"
hidden: false
runnable: true
long:
| Register an agent as a waiter on a gate bead.
|
| When the gate closes, the waiter will receive a wake notification via 'bd gate wake'.
| The waiter is typically the worker's address (e.g., "my-project/workers/agent-1").
|
| This is used by 'bd done --phase-complete' to register for gate wake notifications.
bd gate check
use: "check"
short: "Evaluate gates and close resolved ones"
hidden: false
runnable: true
long:
| Evaluate gate conditions and automatically close resolved gates.
|
| By default, checks all open gates. Use --type to filter by gate type.
|
| Gate types:
| gh - Check all GitHub gates (gh:run and gh:pr)
| gh:run - Check GitHub Actions workflow runs
| gh:pr - Check pull request merge status
| timer - Check timer gates (auto-expire based on timeout)
| bead - Check bead gates
| all - Check all gate types
|
| GitHub gates use the 'gh' CLI to query status:
| - gh:run checks 'gh run view <id> --json status,conclusion'
| - gh:pr checks 'gh pr view <id> --json state,title'
|
| A gate is resolved when:
| - gh:run: status=completed AND conclusion=success
| - gh:pr: state=MERGED
| - timer: current time > created_at + timeout
| - bead: target bead status=closed, or a bead an earlier check saw in
| this rig no longer exists
|
| A gate is escalated when:
| - gh:run: status=completed AND conclusion in (failure, canceled)
| - gh:pr: state=CLOSED
|
| Examples:
| bd gate check # Check all gates
| bd gate check --type=gh # Check only GitHub gates
| bd gate check --type=gh:run # Check only workflow run gates
| bd gate check --type=timer # Check only timer gates
| bd gate check --type=bead # Check only bead gates
| bd gate check --dry-run # Show what would happen without changes
| bd gate check --escalate # Escalate expired/failed gates
flag --dry-run type=bool default="false" usage="Show what would happen without making changes"
flag --escalate -e type=bool default="false" usage="Escalate failed/expired gates"
flag --limit -l type=int default="100" usage="Limit results (default 100)"
flag --type -t type=string default="" usage="Gate type to check (gh, gh:run, gh:pr, timer, bead, all)"
bd gate create
use: "create"
short: "Create a gate that blocks an issue"
hidden: false
runnable: true
long:
| Create an ad-hoc gate issue that blocks another issue until resolved.
|
| The blocked issue will not appear in 'bd ready' until the gate is resolved
| via 'bd gate resolve'.
|
| Gate types:
| human - Requires manual 'bd gate resolve' (default)
| timer - Auto-resolves after --timeout duration
| gh:run - Waits for GitHub Actions workflow
| gh:pr - Waits for PR merge
|
| gh:run and gh:pr gates are checked in the current Git repository unless
| --repo names another, or the blocked issue carries a metadata.repo value.
|
| Examples:
| bd gate create --blocks bd-abc
| bd gate create --type=human --blocks bd-abc --reason="Need design review"
| bd gate create --type=timer --blocks bd-abc --timeout=2h
| bd gate create --type=gh:pr --blocks bd-abc --await-id=42
| bd gate create --type=gh:pr --blocks bd-abc --await-id=42 --repo=owner/other-repo
| bd gate create --blocks bd-abc --title="Gate: awaiting owner sign-off"
flag --await-id type=string default="" usage="Condition identifier (run ID, PR number, etc.)"
flag --blocks type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Issue ID to block (required)"
flag --reason -r type=string default="" usage="Reason for the gate"
flag --repo type=string default="" usage="GitHub repository the gh:run/gh:pr condition is checked in (OWNER/REPO or HOST/OWNER/REPO); default: the blocked issue's metadata.repo, else the current repository"
flag --timeout type=string default="" usage="Timeout duration (e.g., 2h, 30m)"
flag --title type=string default="" usage="Custom gate title (default: \"Gate: <type>\")"
flag --type -t type=string default="human" usage="Gate type (human, timer, gh:run, gh:pr)"
bd gate discover
use: "discover"
short: "Discover await_id for gh:run gates"
hidden: false
runnable: true
long:
| Discovers GitHub workflow run IDs for gates awaiting CI/CD completion.
|
| This command finds open gates with await_type="gh:run" that don't have an await_id,
| queries recent GitHub workflow runs, and matches them using heuristics:
| - Branch name matching
| - Commit SHA matching
| - Time proximity (runs within 5 minutes of gate creation)
|
| Once matched, the gate's await_id is updated with the GitHub run ID, enabling
| subsequent polling to check the run's status.
|
| A gate whose metadata.repo targets another repository is only matched
| against runs queried from that repository, never against the current
| repository's runs of a same-named workflow.
|
| Examples:
| bd gate discover # Auto-discover run IDs for all matching gates
| bd gate discover --dry-run # Preview what would be matched (no updates)
| bd gate discover --branch main --limit 10 # Only match runs on 'main' branch
flag --branch -b type=string default="" usage="Filter runs by branch (default: current branch)"
flag --dry-run -n type=bool default="false" usage="Preview mode: show matches without updating"
flag --limit -l type=int default="10" usage="Max runs to query from GitHub"
flag --max-age -a type=duration default="30m0s" usage="Max age for gate/run matching"
bd gate list
use: "list [issue-id]"
short: "List gate issues"
hidden: false
runnable: true
long:
| List gate issues.
|
| With no argument, lists all gate issues in the current beads database.
| With an [issue-id] argument, lists ONLY the gates that block that issue
| (its own dependency gates) — not every gate in the database.
|
| By default, shows only open gates. Use --all to include closed gates.
flag --all -a type=bool default="false" usage="Show all gates including closed"
flag --limit -n type=int default="50" usage="Limit results (default 50)"
bd gate resolve
use: "resolve <gate-id>"
short: "Manually resolve (close) a gate"
hidden: false
runnable: true
long:
| Close a gate issue to unblock the step waiting on it.
|
| This is equivalent to 'bd close <gate-id>' but with a more explicit name.
| Use --reason to provide context for why the gate was resolved.
flag --reason -r type=string default="" usage="Reason for resolving the gate"
bd gate show
use: "show <gate-id>"
short: "Show a gate issue"
hidden: false
runnable: true
long:
| Display details of a gate issue including its waiters.
|
| This is similar to 'bd show' but validates that the issue is a gate.
bd gc
use: "gc"
short: "Garbage collect: decay old issues, compact Dolt commits, run Dolt GC"
group: "maint"
hidden: false
runnable: true
long:
| Full lifecycle garbage collection for standalone Beads databases.
|
| Runs three phases in sequence:
| 1. DECAY — Delete closed issues older than N days (default 90)
| 2. COMPACT — Squash old Dolt commits into fewer commits (bd compact)
| 3. GC — Run Dolt garbage collection to reclaim disk space
|
| Each phase can be skipped individually. Use --dry-run to preview all phases
| without making changes.
|
| Phase 3 runs Dolt's default, generational GC: it only examines data written
| since the last GC. Data that survived an earlier GC lives in the old generation
| and is never revisited, so on a long-lived store the space freed by decay may
| not be reclaimed. Use --full to collect all generations (slower on large
| stores).
|
| Examples:
| bd gc # Full GC with defaults (90 day decay)
| bd gc --dry-run # Preview what would happen
| bd gc --older-than 30 # Decay issues closed 30+ days ago
| bd gc --skip-decay # Skip issue deletion, just compact+GC
| bd gc --skip-dolt # Skip Dolt GC, just decay+compact
| bd gc --full # Collect all storage generations
| bd gc --force # Skip confirmation prompt
flag --dry-run type=bool default="false" usage="Preview without making changes"
flag --force -f type=bool default="false" usage="Skip confirmation prompts"
flag --full type=bool default="false" usage="Run a full Dolt GC (all generations; slower, reclaims space default passes cannot)"
flag --older-than type=int default="90" usage="Delete closed issues older than N days"
flag --skip-decay type=bool default="false" usage="Skip issue deletion phase"
flag --skip-dolt type=bool default="false" usage="Skip Dolt garbage collection phase"
bd github
use: "github"
short: "GitHub integration commands"
hidden: false
runnable: false
long:
| Commands for syncing issues between beads and GitHub.
|
| Configuration can be set via 'bd config' or environment variables:
| github.token / GITHUB_TOKEN - Personal access token
| github.owner / GITHUB_OWNER - Repository owner
| github.repo / GITHUB_REPO - Repository name
| github.repository / GITHUB_REPOSITORY - Combined "owner/repo" format
| github.url / GITHUB_API_URL - Custom API URL (GitHub Enterprise)
bd github pull
use: "pull [refs...]"
short: "Pull specific items from GitHub"
hidden: false
runnable: true
long:
| Pull one or more items from GitHub.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd github sync --pull-only --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
bd github push
use: "push [bead-ids...]"
short: "Push specific beads to GitHub"
hidden: false
runnable: true
long:
| Push one or more beads issues to GitHub.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd github sync --push-only --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd github repos
use: "repos"
short: "List accessible GitHub repositories"
hidden: false
runnable: true
long:
| List GitHub repositories that the configured token has access to.
bd github status
use: "status"
short: "Show GitHub sync status"
hidden: false
runnable: true
long:
| Display current GitHub configuration and sync status.
bd github sync
use: "sync"
short: "Sync issues with GitHub"
hidden: false
runnable: true
long:
| Synchronize issues between beads and GitHub.
|
| By default, performs bidirectional sync:
| - Pulls new/updated issues from GitHub to beads
| - Pushes local beads issues to GitHub
|
| Use --pull-only or --push-only to limit direction.
flag --dry-run type=bool default="false" usage="Show what would be synced without making changes"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --parent type=string default="" usage="Limit push to this bead and its descendants (push only). Mutually exclusive with --issues."
flag --prefer-github type=bool default="false" usage="On conflict, use GitHub version"
flag --prefer-local type=bool default="false" usage="On conflict, keep local beads version"
flag --prefer-newer type=bool default="false" usage="On conflict, use most recent version (default)"
flag --pull-only type=bool default="false" usage="Only pull issues from GitHub"
flag --push-only type=bool default="false" usage="Only push issues to GitHub"
bd gitlab
use: "gitlab"
short: "GitLab integration commands"
hidden: false
runnable: false
long:
| Commands for syncing issues between beads and GitLab.
|
| Configuration can be set via 'bd config' or environment variables:
| gitlab.url / GITLAB_URL - GitLab instance URL
| gitlab.token / GITLAB_TOKEN - Personal access token
| gitlab.project_id / GITLAB_PROJECT_ID - Project ID or path
| gitlab.group_id / GITLAB_GROUP_ID - Group ID for group-level sync
| gitlab.default_project_id / GITLAB_DEFAULT_PROJECT_ID - Project for creating issues in group mode
bd gitlab projects
use: "projects"
short: "List accessible GitLab projects"
hidden: false
runnable: true
long:
| List GitLab projects that the configured token has access to.
bd gitlab pull
use: "pull [refs...]"
short: "Pull specific items from GitLab"
hidden: false
runnable: true
long:
| Pull one or more items from GitLab.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd gitlab sync --pull-only --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
bd gitlab push
use: "push [bead-ids...]"
short: "Push specific beads to GitLab"
hidden: false
runnable: true
long:
| Push one or more beads issues to GitLab.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd gitlab sync --push-only --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd gitlab status
use: "status"
short: "Show GitLab sync status"
hidden: false
runnable: true
long:
| Display current GitLab configuration and sync status.
bd gitlab sync
use: "sync"
short: "Sync issues with GitLab"
hidden: false
runnable: true
long:
| Synchronize issues between beads and GitLab.
|
| By default, performs bidirectional sync:
| - Pulls new/updated issues from GitLab to beads
| - Pushes local beads issues to GitLab
|
| Use --pull-only or --push-only to limit direction.
flag --assignee type=string default="" usage="Filter by assignee username"
flag --dry-run type=bool default="false" usage="Show what would be synced without making changes"
flag --exclude-type type=string default="" usage="Exclude these issue types from sync (comma-separated)"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --label type=string default="" usage="Filter by labels (comma-separated, AND logic)"
flag --milestone type=string default="" usage="Filter by milestone title"
flag --no-ephemeral type=bool default="true" usage="Exclude ephemeral/wisp issues from push (default: true)"
flag --parent type=string default="" usage="Limit push to this bead and its descendants (push only). Mutually exclusive with --issues."
flag --prefer-gitlab type=bool default="false" usage="On conflict, use GitLab version"
flag --prefer-local type=bool default="false" usage="On conflict, keep local beads version"
flag --prefer-newer type=bool default="false" usage="On conflict, use most recent version (default)"
flag --project type=string default="" usage="Filter to issues from this project ID (group mode)"
flag --pull-only type=bool default="false" usage="Only pull issues from GitLab"
flag --push-only type=bool default="false" usage="Only push issues to GitLab"
flag --type type=string default="" usage="Only sync these issue types (comma-separated, e.g. 'epic,feature,task')"
bd graph
use: "graph [issue-id]"
short: "Display issue dependency graph"
group: "deps"
hidden: false
runnable: true
long:
| Display a visualization of an issue's dependency graph.
|
| For epics, shows all children and their dependencies.
| For regular issues, shows the issue and its direct dependencies.
|
| With --all, shows all open issues grouped by connected component.
| With --open, filters to only open/actionable issues (compact layer format).
|
| Display formats:
| (default) DAG with columns and box-drawing edges (terminal-native)
| --box ASCII boxes showing layers, more detailed
| --compact Tree format, one line per issue, more scannable
| --dot Graphviz DOT format (pipe to dot -Tsvg > graph.svg)
| --html Self-contained interactive HTML with D3.js visualization
| --open Open issues only, compact layers (LLM-friendly)
|
| The graph shows execution order:
| - Layer 0 / leftmost = no dependencies (can start immediately)
| - Higher layers depend on lower layers
| - Nodes in the same layer can run in parallel
|
| Status icons: ○ open ◐ in_progress ● blocked ✓ closed ❄ deferred
|
| Examples:
| bd graph issue-id # Terminal DAG visualization (default)
| bd graph --box issue-id # ASCII boxes with layer grouping
| bd graph --dot issue-id | dot -Tsvg > graph.svg # SVG via Graphviz
| bd graph --dot issue-id | dot -Tpng > graph.png # PNG via Graphviz
| bd graph --html issue-id > graph.html # Interactive browser view
| bd graph --all --html > all.html # All issues, interactive
| bd graph --open issue-id # Open issues only, layered by blocking order
| bd graph --all --open # All open issues, compact layers
|
| --max-rows / BEADS_MAX_ROWS caveat: the cap is checked differently per mode.
| Single-issue graphs (no --all) check the connected-component node count
| after the BFS traversal completes — the whole subgraph is always walked
| first, then rejected if it's over cap. --all checks each status
| (open/in_progress/blocked) independently, so up to 3x the cap can be loaded
| in total before any individual status trips it.
flag --all type=bool default="false" usage="Show graph for all open issues"
flag --box type=bool default="false" usage="ASCII boxes showing layers"
flag --compact type=bool default="false" usage="Tree format, one line per issue, more scannable"
flag --dot type=bool default="false" usage="Output Graphviz DOT format (pipe to: dot -Tsvg > graph.svg)"
flag --html type=bool default="false" usage="Output self-contained interactive HTML (redirect to file)"
flag --max-rows type=int default="0" usage="Hard upper bound on rows fetched from storage. Returns a non-zero exit (code 2) and an error to stderr if exceeded. 0 disables (the default). Overrides BEADS_MAX_ROWS for this invocation. Useful in CI/agent rigs that want a circuit breaker against pathological queries. Not supported under --proxied-server: an explicit --max-rows or BEADS_MAX_ROWS cap errors out rather than silently going unenforced."
flag --open type=bool default="false" usage="Show only open issues (filters out closed/deferred), forces compact layer format"
bd graph check
use: "check"
short: "Check dependency graph integrity"
hidden: false
runnable: true
long:
| Check the dependency graph for cycles, orphans, and other integrity issues.
|
| Returns exit code 0 if the graph is clean, 1 if issues are found.
bd heartbeat
use: "heartbeat <id>"
aliases: ["hb"]
short: "Refresh the lease on an issue you hold in_progress"
group: "issues"
hidden: false
runnable: true
long:
| Refresh the lease on an issue you currently hold in_progress.
|
| A claim carries a lease that expires after a TTL. A worker keeps its claim alive
| by heartbeating faster than the TTL; once it stops (because it died), the lease
| goes stale and 'bd reclaim' reverts the issue to ready so another worker can pick
| it up. Heartbeat pushes lease_expires_at forward and stamps heartbeat_at = now.
|
| Only the current owner may heartbeat. If the lease has already been reclaimed or
| the issue closed, heartbeat fails so the worker learns to stop.
|
| Leases live in an ephemeral, node-local table: a heartbeat that refreshes your
| lease writes no Dolt commit and no history, so any cadence comfortably below
| the TTL is fine. Only a re-arm (the first heartbeat of a claim that has no
| lease, such as one set by a plain update) is recorded as a change to the issue
| and committed, once. Leases are only enforceable on the node that granted them;
| cross-machine claim visibility rides the issue's status and assignee, which do
| commit.
|
| Examples:
| bd heartbeat bd-123
| bd hb bd-123
bd help
use: "help [command]"
short: "Help about any command"
hidden: false
runnable: true
long:
| Help provides help for any command in the application.
| Simply type bd help [path to command] for full details.
flag --all type=bool default="false" usage="Show help for all commands in a single document"
flag --doc type=string default="" usage="Generate markdown docs for a single command"
flag --docs-root type=string default="" usage="Generate repository CLI docs under this root"
flag --list type=bool default="false" usage="List all available commands"
bd history
use: "history <id>"
short: "Show version history for an issue"
group: "views"
hidden: false
runnable: true
long:
| Show the complete version history of an issue, including all commits
| where the issue was modified.
|
| Examples:
| bd history bd-123 # Show all history for issue bd-123
| bd history bd-123 --limit 5 # Show last 5 changes
| bd history bd-123 --events # Show database audit events
flag --events type=bool default="false" usage="Show database audit events instead of commit snapshots"
flag --limit type=int default="0" usage="Limit number of history entries (0 = all)"
bd hooks
use: "hooks"
short: "Manage git hooks for beads integration"
group: "setup"
hidden: false
runnable: false
long:
| Install, uninstall, or list git hooks for beads integration.
|
| The hooks provide:
| - pre-commit: Run chained hooks before commit
| - post-merge: Run chained hooks after pull/merge
| - pre-push: Run chained hooks before push
| - post-checkout: Run chained hooks after branch checkout
| - prepare-commit-msg: Add agent identity trailers for forensics
bd hooks install
use: "install"
short: "Install bd git hooks"
hidden: false
runnable: true
long:
| Install git hooks for beads integration.
|
| By default, hooks are installed to .git/hooks/ in the current repository.
| Use --beads to install to .beads/hooks/ (recommended for Dolt backend).
| Use --shared to install to a versioned directory (.beads-hooks/) that can be
| committed to git and shared with team members.
|
| Hooks use section markers to coexist with existing hooks — any user content
| outside the markers is preserved across installs and upgrades.
|
| Installed hooks:
| - pre-commit: Run chained hooks before commit
| - post-merge: Run chained hooks after pull/merge
| - pre-push: Run chained hooks before push
| - post-checkout: Run chained hooks after branch checkout
| - prepare-commit-msg: Add agent identity trailers (for orchestrator agents)
flag --beads type=bool default="false" usage="Install hooks to .beads/hooks/ (recommended for Dolt backend)"
flag --chain type=bool default="false" usage="No-op, kept for compatibility (existing hook content always runs alongside the bd section)"
flag --force type=bool default="false" usage="No-op, kept for compatibility (section markers always preserve non-bd content)"
flag --shared type=bool default="false" usage="Install hooks to .beads-hooks/ (versioned) instead of .git/hooks/"
bd hooks list
use: "list"
short: "List installed git hooks status"
hidden: false
runnable: true
long:
| Show the status of bd git hooks (installed, outdated, missing).
bd hooks run
use: "run <hook-name> [args...]"
short: "Execute a git hook (called by thin shims)"
hidden: false
runnable: true
long:
| Execute the logic for a git hook. This command is typically called by
| thin shim scripts installed in .git/hooks/.
|
| Supported hooks:
| - pre-commit: Run chained hooks before commit
| - post-merge: Run chained hooks after pull/merge
| - pre-push: Run chained hooks before push
| - post-checkout: Run chained hooks after branch checkout
| - prepare-commit-msg: Add agent identity trailers for forensics
|
| The thin shim keeps delegated hook logic in sync with the installed bd
| version. Upgrading bd updates that delegated behavior. To adopt changes to the
| shim's generated shell policy, refresh it with 'bd hooks install'.
bd hooks uninstall
use: "uninstall"
short: "Uninstall bd git hooks"
hidden: false
runnable: true
long:
| Remove bd git hooks from .git/hooks/ directory.
bd human
use: "human"
short: "Show essential commands for human users"
group: "setup"
hidden: false
runnable: true
long:
| Display a focused help menu showing only the most common commands.
|
| bd has 70+ commands - many for AI agents, integrations, and advanced workflows.
| This command shows the ~15 essential commands that human users need most often.
|
| For the full command list, run: bd --help
|
| SUBCOMMANDS:
| human list List human-needed beads (issues with 'human' label; hides closed by default)
| human respond <id> Respond to a human-needed bead (adds comment and closes)
| human dismiss <id> Dismiss a human-needed bead permanently
| human stats Show summary statistics for human-needed beads
bd human dismiss
use: "dismiss <issue-id> [reason...]"
short: "Dismiss a human-needed bead"
hidden: false
runnable: true
long:
| Dismiss a human-needed bead permanently without responding.
|
| The issue is closed with a "Dismissed" reason and optional note.
| The reason can be given as positional arguments or --reason.
|
| Examples:
| bd human dismiss bd-123
| bd human dismiss bd-123 "No longer applicable"
| bd human dismiss bd-123 --reason "No longer applicable"
flag --reason type=string default="" usage="Reason for dismissal (optional)"
bd human list
use: "list"
short: "List human-needed beads"
hidden: false
runnable: true
long:
| List issues labeled with 'human' tag.
|
| These are issues that require human intervention or input. Every
| human-labeled bead shows regardless of type (including gates and wisps).
| By default closed, pinned, and other done/frozen beads are hidden; use
| --status to select specific statuses, or --status=all to include every
| status.
|
| Examples:
| bd human list
| bd human list --status=closed
| bd human list --status=all
| bd human list --json
flag --status -s type=string default="" usage="Filter by status (open, closed, etc.; comma-separated for multiple, 'all' for every status)"
bd human respond
use: "respond <issue-id> [response...]"
short: "Respond to a human-needed bead"
hidden: false
runnable: true
long:
| Respond to a human-needed bead by adding a comment and closing it.
|
| The response is added as a comment and the issue is closed with reason "Responded".
| The response text can be given as positional arguments, --response, --file, or --stdin.
|
| Examples:
| bd human respond bd-123 "Use OAuth2 for authentication"
| bd human respond bd-123 -r "Approved, proceed with implementation"
| bd human respond bd-123 --file response.md
| echo "Approved" | bd human respond bd-123 --stdin
flag --file type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin file response"]} usage="Read response text from file"
flag --response -r type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin file response"]} usage="Response text"
flag --stdin type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["stdin file response"]} usage="Read response text from stdin"
bd human stats
use: "stats"
short: "Show summary statistics for human-needed beads"
hidden: false
runnable: true
long:
| Display summary statistics for human-needed beads.
|
| Shows counts for total, pending (open), responded (closed without dismiss),
| and dismissed beads.
|
| Example:
| bd human stats
bd import
use: "import [file|-]"
short: "Import issues from a JSONL file or stdin into the database"
group: "sync"
hidden: false
runnable: true
long:
| Import issues from a JSONL file (newline-delimited JSON) into the database.
|
| If no file is specified, imports from the configured import.path under .beads/
| (default: issues.jsonl). Use "-" to read from stdin; redirecting stdin without
| "-" or a file argument is an error, so a typo'd 'bd import < file' cannot
| silently import the default file instead. This is the incremental counterpart to
| 'bd export': new issues are created and existing issues are updated (upsert
| semantics).
|
| Memory records (lines with "_type":"memory") are automatically detected and
| imported as persistent memories (equivalent to 'bd remember'). This makes
| 'bd export | bd import' a full round-trip for both issues and memories.
|
| Each JSONL line should map to an issue. The importer accepts every field
| 'bd export' emits — see 'bd export' output for the canonical schema. Only
| "title" is required; everything else is optional.
|
| Common fields:
| title Required. Short summary.
| description Long-form body.
| design, notes, Additional content sections.
| acceptance_criteria
| issue_type bug | feature | task | epic | chore | ...
| priority 0-4 (0 = critical). 0 is preserved (no omitempty).
| status open | in_progress | blocked | closed | ...
| (rows with status "tombstone" are skipped)
| assignee, owner, Ownership metadata.
| created_by
| labels Array of strings.
| dependencies Array of {issue_id, depends_on_id, type, ...}.
| comments Array of comment objects.
| external_ref, Cross-system identifiers (e.g. "gh-9").
| source_system
| due_at, defer_until RFC3339 timestamps for scheduling.
| metadata Arbitrary JSON object preserved verbatim.
|
| Timestamps (created_at, updated_at, started_at, closed_at) are preserved
| when present in the JSONL and otherwise filled in by the importer. The
| legacy "wisp" boolean is accepted as an alias for "ephemeral".
|
| By default a row only rewrites an existing local issue when its
| updated_at is strictly newer. Older rows are skipped (reported as
| stale_skipped_ids) and rows with the same updated_at keep every local
| column — updated_at has second granularity, so a timestamp tie can be
| two distinct same-second updates, and the local row wins the tie
| (reported as tie_kept_local_ids; the row's labels/comments/dependencies
| still merge). The guard is also enforced inside the upsert itself, so a
| local update that lands while the import is running is preserved rather
| than overwritten. Existing issues that the import did rewrite are listed
| with a field-level summary (updated_issues), so local state changed by
| an import is visible. To deliberately restore an older snapshot, pass
| --allow-stale, which imports every row even when it overwrites newer
| local state.
|
| The staleness guard is import's ONLY overwrite guard: the per-field
| fences that bd update enforces (notes overwrite, live-claim reassign,
| close policy) do not apply to imported rows. Import replaces rows
| wholesale by design — a restore must not fail field-by-field — so
| --allow-stale is the single deliberate-overwrite opt-in, and
| updated_issues is where to look for what an import rewrote.
|
| Large imports are written in bounded transactions (a few hundred issues
| each, with a short pause between commits) with progress on stderr, so
| concurrent bd commands keep working while the import runs instead of
| stalling on one batch-wide write lock. Rows land in dependency order
| with their blocking edges in the same transaction, so a half-finished
| import never shows a blocked issue as ready. If an import fails partway,
| the already-committed chunks are durable and the command exits nonzero;
| re-running the same import is safe and converges (rows upsert,
| labels/comments/dependencies deduplicate).
|
| EXAMPLES:
| bd import # Import from configured import.path
| bd import backup.jsonl # Import from a specific file
| bd import -i backup.jsonl # Legacy alias for a specific file
| bd import - # Read JSONL from stdin
| cat issues.jsonl | bd import - # Pipe JSONL from another tool
| bd import --dry-run # Show what would be imported
| bd import --dedup # Skip issues with duplicate titles
| bd import --allow-stale old.jsonl # Restore an older snapshot (overwrites newer local rows)
| bd import --json # Structured output with created and skipped IDs
flag --allow-stale type=bool default="false" usage="Import rows even when older than the local issue (required to restore an older snapshot)"
flag --dedup type=bool default="false" usage="Skip lines whose title matches an existing open issue"
flag --dry-run type=bool default="false" usage="Show what would be imported without importing"
flag --input -i type=string default="" usage="Read JSONL from a specific file"
bd info
use: "info"
short: "Show database information"
group: "setup"
hidden: false
runnable: true
long:
| Display information about the current database.
|
| This command helps debug issues where bd is using an unexpected database. It shows:
| - The absolute path to the database file
| - Database statistics (issue count)
| - Schema information (with --schema flag)
| - What's new in recent versions (with --whats-new flag)
|
| Examples:
| bd info
| bd info --json
| bd info --schema --json
| bd info --whats-new
| bd info --whats-new --json
| bd info --thanks
flag --schema type=bool default="false" usage="Include schema information in output"
flag --thanks type=bool default="false" usage="Show thank you page for contributors"
flag --whats-new type=bool default="false" usage="Show agent-relevant changes from recent versions"
bd init
use: "init"
short: "Initialize bd in the current directory"
group: "setup"
hidden: false
runnable: true
long:
| Initialize bd in the current directory by creating a .beads/ directory
| and its storage (a Dolt database by default). Optionally specify a custom issue prefix.
|
| Dolt is the default and only supported storage backend, with full version
| control (history, branching, sync).
|
| Use --database to specify an existing server database name, overriding the
| default prefix-based naming. This is useful when an external tool (e.g. an orchestrator)
| has already created the database.
|
| With --stealth: configures per-repository git settings for invisible beads usage:
| • .git/info/exclude to prevent beads files from being committed
| Perfect for personal use without affecting repo collaborators.
| To set up a specific AI tool, run: bd setup <claude|cursor|aider|...> --stealth
|
| By default, beads uses an embedded Dolt engine (no external server needed).
| Pass --server to use an external dolt sql-server instead. In server mode,
| set connection details with --server-host, --server-port, and --server-user.
| Password should be set via BEADS_DOLT_PASSWORD environment variable.
|
| Auto-export is optional. When enabled, bd exports issues to
| .beads/issues.jsonl after write commands (throttled to once per 60s). This is
| for viewers (bv), interchange, and issue-level migration; not backup.
| Cross-machine sync and backups use Dolt remotes/backups, not JSONL import/export.
| To enable: bd config set export.auto true
|
| Non-interactive mode (--non-interactive or BD_NON_INTERACTIVE=1):
| Skips all interactive prompts, using sensible defaults:
| • Role defaults to "maintainer" (override with --role)
| • Fork exclude auto-configured when fork detected
| • Auto-export left at default (disabled)
| • --contributor and --team flags are rejected (wizards require interaction)
| Also auto-detected when stdin is not a terminal or CI=true is set.
flag --agents-file type=string default="" usage="Custom filename for agent instructions (default: AGENTS.md)"
flag --agents-profile type=string default="" usage="AGENTS.md profile: 'minimal' (default, pointer to bd prime) or 'full' (complete command reference)"
flag --agents-template type=string default="" usage="Path to custom AGENTS.md template (overrides embedded default)"
flag --backend type=string default="" usage="Storage backend: dolt (default). Removed backends (postgres, mysql, sqlite) print migration guidance."
flag --contributor type=bool default="false" usage="Run OSS contributor setup wizard"
flag --debug type=bool default="false" usage="Run the managed Dolt sql-server with --loglevel=debug and CPU profiling (--prof cpu). Persisted to config.yaml as dolt.debug. No effect on externally-managed servers."
flag --destroy-token type=string default="" usage="Explicit confirmation token for destructive re-init in non-interactive mode (format: 'DESTROY-<prefix>')"
flag --discard-remote type=bool default="false" usage="Authorize discarding the configured remote's Dolt history when re-initializing. Requires --destroy-token in non-interactive mode; see 'bd help init-safety'."
flag --external type=bool default="false" usage="Server is externally managed (skip server startup); use with --shared-server or --server"
flag --force type=bool default="false" usage="Deprecated alias for --reinit-local. Bypasses only the LOCAL data-safety guard; does NOT authorize remote divergence or recreating a missing server-mode database (see 'bd help init-safety')."
flag --from-jsonl type=bool default="false" usage="Import issues from configured import.path; refuses remote history unless --discard-remote authorizes replacement"
flag --init-if-missing type=bool default="false" usage="If the workspace is already initialized, skip init and exit 0 instead of failing (idempotent init for scaffolds)"
flag --mysql-database type=string default="" hidden usage="Legacy MySQL database (removed backend compatibility only)"
flag --mysql-url type=string default="" hidden usage="Legacy MySQL connection URL (removed backend compatibility only)"
flag --non-interactive type=bool default="false" usage="Skip all interactive prompts (auto-detected in CI or non-TTY environments)"
flag --pg-schema type=string default="" hidden usage="Legacy PostgreSQL schema (removed backend compatibility only)"
flag --pg-url type=string default="" hidden usage="Legacy PostgreSQL connection URL (removed backend compatibility only)"
flag --prefix -p type=string default="" usage="Issue prefix (default: current directory name)"
flag --proxied-server type=bool default="false" usage="[EXPERIMENTAL] Use a per-workspace proxied dolt sql-server (proxy + child dolt) rooted at .beads/dolt"
flag --proxied-server-config-path type=string default="" usage="[EXPERIMENTAL] Absolute path to an existing dolt sql-server YAML config (proxied-server mode only). When set, bd uses this file instead of auto-generating one. Relative paths are rejected. Managed mode requires listener.host to be a numeric loopback IP (hostnames including localhost, non-loopback addresses, listener.socket, remotesapi, and cluster config are rejected); the same policy applies to BEADS_PROXIED_SERVER_CONFIG."
flag --proxied-server-external-host type=string default="" usage="[EXPERIMENTAL] Hostname or IP of an externally-managed dolt sql-server the proxy should front (proxied-server mode only). Mutually exclusive with --proxied-server-external-socket-path."
flag --proxied-server-external-keep-alive type=duration default="0s" usage="[EXPERIMENTAL] TCP keepalive period for the proxy→external connection. Zero uses the package default (30s)."
flag --proxied-server-external-port type=int default="0" usage="[EXPERIMENTAL] TCP port of the externally-managed dolt sql-server (proxied-server mode only). Required when --proxied-server-external-host is set."
flag --proxied-server-external-socket-path type=string default="" usage="[EXPERIMENTAL] Absolute unix socket path of the externally-managed dolt sql-server (proxied-server mode only). Mutually exclusive with --proxied-server-external-host. Relative paths are rejected."
flag --proxied-server-external-tls type=bool default="false" usage="[EXPERIMENTAL] Require TLS when connecting to the externally-managed dolt sql-server (proxied-server mode only)."
flag --proxied-server-external-tls-ca-cert-path type=string default="" usage="[EXPERIMENTAL] Absolute path to a CA certificate (PEM) used to verify the externally-managed dolt sql-server. Empty uses the system trust store. Relative paths are rejected."
flag --proxied-server-external-tls-cert-path type=string default="" usage="[EXPERIMENTAL] Absolute path to a client TLS certificate (for mTLS to the externally-managed dolt sql-server). Must be paired with --proxied-server-external-tls-key-path. Relative paths are rejected."
flag --proxied-server-external-tls-key-path type=string default="" usage="[EXPERIMENTAL] Absolute path to the client TLS private key (for mTLS to the externally-managed dolt sql-server). Must be paired with --proxied-server-external-tls-cert-path. Relative paths are rejected."
flag --proxied-server-external-tls-server-name type=string default="" usage="[EXPERIMENTAL] Server name to verify in the external dolt sql-server's TLS certificate. Defaults to the external host. Required with a unix socket unless --proxied-server-external-tls-skip-verify is set."
flag --proxied-server-external-tls-skip-verify type=bool default="false" usage="[EXPERIMENTAL] Skip TLS certificate verification for the external dolt sql-server. Insecure; testing only."
flag --proxied-server-external-user type=string default="" usage="[EXPERIMENTAL] MySQL user for the externally-managed dolt sql-server (proxied-server mode only). Defaults to \"root\" when empty. Password is read at runtime from $BEADS_PROXIED_SERVER_EXTERNAL_PASSWORD and is never persisted to disk."
flag --proxied-server-idle-timeout type=duration default="0s" usage="[EXPERIMENTAL] Idle duration after which the proxy shuts down its loopback listener and backend (proxied-server mode only). Omit for the built-in default (30s); 0 keeps the proxy and backend alive indefinitely; a positive value sets the window."
flag --proxied-server-log-path type=string default="" usage="[EXPERIMENTAL] Absolute path to the proxied dolt sql-server log file (proxied-server mode only). Default: <beadsDir>/dolt/server.log. Relative paths are rejected."
flag --proxied-server-port type=int default="0" usage="[EXPERIMENTAL] Fixed TCP port for the proxy's loopback listener (proxied-server mode only). Default 0 = an OS-assigned free port. Startup fails if the port is already in use."
flag --proxied-server-root-path type=string default="" usage="[EXPERIMENTAL] Absolute directory holding the proxied dolt sql-server's lockfiles, pidfiles, and child .dolt repository (proxied-server mode only). Default: <beadsDir>/dolt. May not exist yet — bd will create it. Relative paths are rejected."
flag --quiet -q type=bool default="false" usage="Suppress output (quiet mode)"
flag --recreate-missing type=bool default="false" usage="Explicitly authorize creating a fresh, empty database when this project's configured server-mode database is missing or unreachable. Opt-in per invocation only; never implied by --force, config, or env (see 'bd help init-safety')."
flag --reinit-local type=bool default="false" usage="Re-initialize local .beads/ over existing local data. Does NOT authorize remote divergence (see --discard-remote) or recreating a missing server-mode database (see --recreate-missing)."
flag --remote type=string default="" usage="Dolt remote URL to clone from and persist as sync.remote"
flag --role type=string default="" usage="Set beads role without prompting: \"maintainer\" or \"contributor\""
flag --server type=bool default="false" usage="Use external dolt sql-server instead of embedded engine"
flag --server-host type=string default="" usage="Dolt server host (default: 127.0.0.1)"
flag --server-port type=int default="0" usage="Dolt server port (default: 3307)"
flag --server-socket type=string default="" usage="Unix domain socket path (overrides host/port; pass '' to ignore an ambient BEADS_DOLT_SERVER_SOCKET and use TCP)"
flag --server-tls type=bool default="false" usage="Require TLS for the init-time Dolt server connection (overrides BEADS_DOLT_SERVER_TLS for this run; not persisted - set the env var or credentials file for later commands)"
flag --server-user type=string default="" usage="Dolt server MySQL user (default: root)"
flag --setup-exclude type=bool default="false" usage="Configure .git/info/exclude to keep beads files local (for forks)"
flag --shared-server type=bool default="false" usage="Enable shared Dolt server mode (all projects share one server at ~/.beads/shared-server/)"
flag --skip-agents type=bool default="false" usage="Skip AGENTS.md and Claude/Codex/Cursor setup generation"
flag --skip-hooks type=bool default="false" usage="Skip git hooks installation"
flag --sqlite-path type=string default="" hidden usage="Legacy SQLite database file (removed backend compatibility only)"
flag --stealth type=bool default="false" usage="Enable stealth mode: keep beads files out of git via .git/info/exclude (sets no-git-ops)"
flag --team type=bool default="false" usage="Run team workflow setup wizard"
flag --team-server type=bool default="false" usage="[EXPERIMENTAL] The shared database's schema is managed by beads-team-server (bts): bd never creates the database or runs schema migrations, only verifies the schema version (proxied-server mode only). Not related to --team."
bd init-safety
use: "init-safety"
short: "Explain bd init flag semantics and the destroy-token format"
hidden: false
runnable: true
long:
| bd init flag safety contract.
|
| Every bd init invocation resolves project_id from exactly one explicitly
| named source (local reinit, remote adoption, or a fresh mint). When the
| source is ambiguous, bd init refuses.
|
| FLAG SURFACE
|
| bd init Mint a new identity. Bootstraps from
| origin if it has refs/dolt/data.
|
| bd init --reinit-local Re-initialize local .beads/ over existing
| local data. Does NOT authorize discarding
| remote history. If origin has Dolt data
| this will refuse — pair with
| --discard-remote to override. Nor does it
| authorize recreating a missing server-mode
| database; that takes --recreate-missing.
|
| bd init --reinit-local \ Discard the remote's Dolt history and
| --discard-remote replace it with the local reinit. First
| bd dolt push after this will be a
| history-replacing force-push.
|
| bd init --force Deprecated alias for --reinit-local, with
| the same limits. Kept working for ≥2
| releases.
|
| bd init --recreate-missing Authorize creating a fresh, empty database
| when this project's configured server-mode
| database is missing or unreachable. Opt-in
| per invocation only: never implied by
| --force/--reinit-local, config, or env.
| Without it, bd init REFUSES rather than
| silently recreating a lost database as
| empty (be-5up5). First rule out a stopped
| server or a wrong port or data dir, and
| restore if you can; the playbook is
| init-missing-server-db in
| docs/recovery/init-safety.md. Only when
| nothing is recoverable:
|
| bd init --recreate-missing --prefix <prefix>
|
| bd init --from-jsonl Import from configured import.path. If
| origin has Dolt data, this refuses unless
| --discard-remote authorizes replacing that
| remote history.
|
| ADOPTING A REMOTE
|
| If you want to use the remote's existing history, use:
|
| bd bootstrap
|
| bd init will automatically suggest this when a remote is detected.
|
| DESTROY-TOKEN (non-interactive only)
|
| When running with no TTY (CI, agents, piped input), a destructive
| re-init requires an explicit --destroy-token value. That covers both
| --discard-remote and --reinit-local over existing issues. The token
| format is:
|
| DESTROY-<issue-prefix>
|
| For example, if your issue prefix is "bd", the token is "DESTROY-bd":
|
| bd init --reinit-local --discard-remote --destroy-token=DESTROY-bd
|
| In interactive (TTY) mode you confirm via a typed prompt instead. The
| token is not echoed by bd's runtime error messages — this is a
| deliberate guard against pattern-matched one-liners (see
| engdocs/adr/0002-init-safety-invariants.md).
|
| EXIT CODES
|
| 10 refused: remote has Dolt history and you selected local history
| without --discard-remote
| 11 refused: existing local data and you declined the destroy confirm
| (interactive mode only)
| 12 refused: destructive re-init (--discard-remote, or --reinit-local
| over existing issues) without a valid --destroy-token
| (non-interactive mode); also returned when the interactive
| --discard-remote typed-token confirmation is declined
| 15 refused: run directly in your home directory, which is not itself
| a git repository, with no BEADS_DIR named by the caller
|
| RECOVERY
|
| If you hit a refusal, see docs/recovery/init-safety.md for step-by-step recovery
| playbooks for each exit code.
|
| RE-CLONE GOTCHAS
|
| Setting a damaged or superseded database directory aside by hand, or
| relying on a fresh clone right away? Two gotchas from live recovery:
|
| Crash-loop: a set-aside store left INSIDE data_dir makes the sql-server
| treat it as a database and crash-loop with "root hash doesn't exist:
| <hash>". Move it OUTSIDE data_dir instead.
|
| Missing tables: a fresh clone lacks clone-local tables (leases, wisps,
| events, ...) until you run "bd migrate schema" (no --force). You'll see
| "table not found: leases" until then; "Schema already at v<N>" after
| running it is expected, not an error.
|
| See docs/recovery/init-safety.md#re-clone-gotchas for full detail.
|
bd jira
use: "jira"
short: "Jira integration commands"
group: "advanced"
hidden: false
runnable: false
long:
| Synchronize issues between beads and Jira.
|
| Configuration:
| bd config set jira.url "https://company.atlassian.net"
| bd config set jira.project "PROJ"
| bd config set jira.projects "PROJ1,PROJ2" # Multiple projects
| bd config set jira.api_token "YOUR_TOKEN"
| bd config set jira.username "your_email@company.com" # For Jira Cloud
| bd config set jira.push_prefix "hippo" # Only push hippo-* issues to Jira
| bd config set jira.push_prefix "proj1,proj2" # Multiple prefixes (comma-separated)
|
| Environment variables (alternative to config):
| JIRA_API_TOKEN - Jira API token
| JIRA_USERNAME - Jira username/email
| JIRA_PROJECTS - Comma-separated project keys
|
| Examples:
| bd jira sync --pull # Import issues from Jira
| bd jira sync --push # Export issues to Jira
| bd jira sync # Bidirectional sync (pull then push)
| bd jira sync --dry-run # Preview sync without changes
| bd jira status # Show sync status
bd jira pull
use: "pull [refs...]"
short: "Pull specific items from Jira"
hidden: false
runnable: true
long:
| Pull one or more items from Jira.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd jira sync --pull --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
bd jira push
use: "push [bead-ids...]"
short: "Push specific beads to Jira"
hidden: false
runnable: true
long:
| Push one or more beads issues to Jira.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd jira sync --push --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd jira status
use: "status"
short: "Show Jira sync status"
hidden: false
runnable: true
long:
| Show the current Jira sync status, including:
| - Last sync timestamp
| - Configuration status
| - Number of issues with Jira links
| - Issues pending push (no external_ref)
bd jira sync
use: "sync"
short: "Synchronize issues with Jira"
hidden: false
runnable: true
long:
| Synchronize issues between beads and Jira.
|
| Modes:
| --pull Import issues from Jira into beads
| --push Export issues from beads to Jira
| (no flags) Bidirectional sync: pull then push, with conflict resolution
|
| Conflict Resolution:
| By default, newer timestamp wins. Override with:
| --prefer-local Always prefer local beads version
| --prefer-jira Always prefer Jira version
|
| Examples:
| bd jira sync --pull # Import from Jira
| bd jira sync --push --create-only # Push new issues only
| bd jira sync --dry-run # Preview without changes
| bd jira sync --prefer-local # Bidirectional, local wins
flag --create-only type=bool default="false" usage="Only create new issues, don't update existing"
flag --dry-run type=bool default="false" usage="Preview sync without making changes"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --parent type=string default="" usage="Limit push to this bead and its descendants (push only). Mutually exclusive with --issues."
flag --prefer-jira type=bool default="false" usage="Prefer Jira version on conflicts"
flag --prefer-local type=bool default="false" usage="Prefer local version on conflicts"
flag --project type=stringSlice default="[]" usage="Project key(s) to sync (overrides configured project/projects)"
flag --pull type=bool default="false" usage="Pull issues from Jira"
flag --push type=bool default="false" usage="Push issues to Jira"
flag --state type=string default="all" usage="Issue state to sync: open, closed, all"
bd kv
use: "kv"
short: "Key-value store commands"
group: "setup"
hidden: false
runnable: false
long:
| Commands for working with the beads key-value store.
|
| The key-value store is useful for storing flags, environment variables,
| or other user-defined data that persists across sessions.
|
| Examples:
| bd kv set mykey myvalue # Set a value
| bd kv get mykey # Get a value
| bd kv clear mykey # Delete a key
| bd kv list # List all key-value pairs
bd kv clear
use: "clear <key>"
short: "Delete a key-value pair"
hidden: false
runnable: true
long:
| Delete a key from the beads key-value store.
|
| Examples:
| bd kv clear feature_flag
| bd kv clear api_endpoint
bd kv get
use: "get <key>"
short: "Get a value by key"
hidden: false
runnable: true
long:
| Get a value from the beads key-value store.
|
| Examples:
| bd kv get feature_flag
| bd kv get api_endpoint
bd kv list
use: "list"
short: "List all key-value pairs"
hidden: false
runnable: true
long:
| List all key-value pairs in the beads key-value store.
|
| With --prefix, list only the keys starting with that prefix. The filter is
| pushed into SQL on stores that support it, so a scoped read of a large kv
| store does not serialize the whole table.
|
| Examples:
| bd kv list
| bd kv list --json
| bd kv list --prefix mail.dog. --json
flag --prefix type=string default="" usage="list only keys starting with this prefix (filtered in SQL where supported)"
bd kv set
use: "set <key> <value>"
short: "Set a key-value pair"
hidden: false
runnable: true
long:
| Set a key-value pair in the beads key-value store.
|
| This is useful for storing flags, environment variables, or other
| user-defined data that persists across sessions.
|
| Examples:
| bd kv set feature_flag true
| bd kv set api_endpoint https://api.example.com
| bd kv set max_retries 3
bd label
use: "label"
short: "Manage issue labels"
group: "issues"
hidden: false
runnable: false
bd label add
use: "add [issue-id...] [label[,label...]]"
short: "Add one or more labels to one or more issues"
hidden: false
runnable: true
long:
| Add labels to issues. Issue IDs come first; the final argument is the label. Pass multiple labels comma-separated: bd label add bd-123 label1,label2
bd label list
use: "list [issue-id]"
short: "List labels for an issue"
hidden: false
runnable: true
bd label list-all
use: "list-all"
short: "List all unique labels in the database"
hidden: false
runnable: true
bd label propagate
use: "propagate [parent-id] [label]"
short: "Propagate a label from a parent issue to all its children"
hidden: false
runnable: true
long:
| Push a label from a parent down to all direct children that don't already have it. Useful for applying branch: labels across an epic's subtasks.
bd label remove
use: "remove [issue-id...] [label[,label...]]"
short: "Remove one or more labels from one or more issues"
hidden: false
runnable: true
long:
| Remove labels from issues. Issue IDs come first; the final argument is the label. Pass multiple labels comma-separated: bd label remove bd-123 label1,label2
|
| With --prefix, no label argument is needed: every label on the given issue(s) starting with the prefix is removed, e.g. bd label remove bd-123 --prefix pool:refused:
flag --prefix type=string default="" usage="Remove every label matching this prefix instead of an exact label (e.g., 'pool:refused:' removes all pool:refused:* labels). No label positional argument is needed when set. CAUTION: a short prefix removes every match on an issue in a single edit, including labels you may not have meant to touch (e.g. --prefix t removes both 'tier:opus' and 'test-needed') — check `bd label list <issue-id>` first if unsure. State-dimension labels (e.g. 'launch:', 'scalegate:') should move via `bd set-state` instead, which this flag bypasses without its event-bead audit trail."
bd label rename
use: "rename <old-label> <new-label>"
short: "Rename a label across every issue and wisp that carries it"
hidden: false
runnable: true
long:
| Rename a label everywhere it appears. An issue that already carries the new label keeps it and drops the old one instead of erroring - a merge, reported honestly (the write path measures merged from what the insert actually affected, never from a snapshot check, so its count is correct under concurrent writes). Pass --dry-run to preview the blast radius (a count and the first issues) without writing anything; the preview's merged count is a plain snapshot intersection of two separate reads, so treat it as an estimate, not the number the rename itself will report.
flag --dry-run type=bool default="false" usage="Preview the blast radius without renaming anything (merged count is a snapshot intersection, not authoritative - see --help)"
bd linear
use: "linear"
short: "Linear integration commands"
group: "advanced"
hidden: false
runnable: false
long:
| Synchronize issues between beads and Linear.
|
| Configuration:
| bd config set linear.api_key "YOUR_API_KEY"
| bd config set linear.team_id "TEAM_ID"
| bd config set linear.team_ids "TEAM_ID1,TEAM_ID2" # Multiple teams (comma-separated)
| bd config set linear.project_id "PROJECT_ID" # Optional: sync only this project
|
| Environment variables (alternative to config):
| LINEAR_API_KEY - Linear API key (for individual developers)
| LINEAR_TEAM_ID - Linear team ID (UUID, singular)
| LINEAR_TEAM_IDS - Linear team IDs (comma-separated UUIDs)
|
| OAuth (for CI workers / automated sync):
| LINEAR_OAUTH_CLIENT_ID - OAuth app client ID
| LINEAR_OAUTH_CLIENT_SECRET - OAuth app client secret
|
| When both OAuth env vars are set, OAuth client_credentials flow is used
| instead of the API key. This allows CI workers to authenticate as an
| application (actor=application) rather than impersonating a user.
| Precedence: OAuth > LINEAR_API_KEY > config file.
|
| Data Mapping (optional, sensible defaults provided):
| Priority mapping (Linear 0-4 to Beads 0-4):
| bd config set linear.priority_map.0 4 # No priority -> Backlog
| bd config set linear.priority_map.1 0 # Urgent -> Critical
| bd config set linear.priority_map.2 1 # High -> High
| bd config set linear.priority_map.3 2 # Medium -> Medium
| bd config set linear.priority_map.4 3 # Low -> Low
|
| State mapping (Linear state type to Beads status):
| bd config set linear.state_map.backlog open
| bd config set linear.state_map.unstarted open
| bd config set linear.state_map.started in_progress
| bd config set linear.state_map.completed closed
| bd config set linear.state_map.canceled closed
| bd config set linear.state_map.my_custom_state in_progress # Custom state names
|
| Label to issue type mapping:
| bd config set linear.label_type_map.bug bug
| bd config set linear.label_type_map.feature feature
| bd config set linear.label_type_map.epic epic
|
| Relation type mapping (Linear relations to Beads dependencies):
| bd config set linear.relation_map.blocks blocks
| bd config set linear.relation_map.blockedBy blocks
| bd config set linear.relation_map.duplicate duplicates
| bd config set linear.relation_map.related related
|
| ID generation (optional, hash IDs to match bd/Jira hash mode):
| bd config set linear.id_mode "hash" # hash (default)
| bd config set linear.hash_length "6" # hash length 3-8 (default: 6)
|
| Examples:
| bd linear sync --pull # Import issues from Linear
| bd linear sync --push # Export issues to Linear
| bd linear sync # Bidirectional sync (pull then push)
| bd linear sync --dry-run # Preview sync without changes
| bd create "Fix login" --external-ref https://linear.app/team/issue/TEAM-123
| # Link a local issue to an existing Linear issue
| bd linear status # Show sync status
bd linear pull
use: "pull [refs...]"
short: "Pull specific items from Linear"
hidden: false
runnable: true
long:
| Pull one or more items from Linear.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd linear sync --pull --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
flag --relations type=bool default="false" usage="Import Linear relations as bd dependencies when pulling"
bd linear push
use: "push [bead-ids...]"
short: "Push specific beads to Linear"
hidden: false
runnable: true
long:
| Push one or more beads issues to Linear.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd linear sync --push --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd linear status
use: "status"
short: "Show Linear sync status"
hidden: false
runnable: true
long:
| Show the current Linear sync status, including:
| - Last sync timestamp
| - Configuration status
| - Number of issues with Linear links
| - Issues pending push (no external_ref)
bd linear sync
use: "sync"
short: "Synchronize issues with Linear"
hidden: false
runnable: true
long:
| Synchronize issues between beads and Linear.
|
| Modes:
| --pull Import issues from Linear into beads
| --push Export issues from beads to Linear
| --pull-if-stale Pull only if data is stale (skip if fresh)
| (no flags) Bidirectional sync: pull then push, with conflict resolution
|
| Staleness (--pull-if-stale):
| --threshold 20m How old data must be before pulling (default 20m)
| A 5-minute debounce prevents agent loops: if a pull completed within 5 minutes,
| data is always treated as fresh regardless of the threshold.
|
| Team Selection:
| --team ID1,ID2 Override configured team IDs for this sync
| Multiple teams can be configured via linear.team_ids (comma-separated).
| Falls back to linear.team_id for backward compatibility.
| Push requires explicit --team when multiple teams are configured.
|
| Pull Options:
| --milestones Reconstruct Linear project milestones as local epic parents
|
| Type Filtering (--push only):
| --type task,feature Only sync issues of these types
| --exclude-type wisp Exclude issues of these types
| --include-ephemeral Include ephemeral issues (wisps, etc.); default is to exclude
| --parent TICKET Only push this ticket and its descendants
| --relations Import Linear relations as bd dependencies on pull
|
| Persistent push-direction ID filters (workflow artifacts, sandbox beads, etc.):
| bd config set linear.exclude_id_prefix "hw-mol-"
| bd config set linear.exclude_id_patterns "-wisp-,sandbox-,scratch-"
|
| exclude_id_prefix is a single case-sensitive prefix on the bead ID.
| exclude_id_patterns is a comma-separated list of case-sensitive substrings
| (matched anywhere in the ID). Both are combined as a union: a bead
| matching either rule is skipped from push (no create, no update). Beads
| with an existing external_ref that NOW match are silently skipped on
| future syncs; the Linear-side issue persists — archive/delete it manually
| if desired.
|
| Conflict Resolution:
| By default, newer timestamp wins. Override with:
| --prefer-local Always prefer local beads version
| --prefer-linear Always prefer Linear version
|
| Examples:
| bd linear sync --pull # Import from Linear
| bd linear sync --pull-if-stale # Pull only if data is stale
| bd linear sync --pull-if-stale --threshold 5m # Pull if older than 5 minutes
| bd linear sync --pull --relations # Import Linear blocking relations as bd deps
| bd linear sync --push --create-only # Push new issues only
| bd linear sync --push --type=task,feature # Push only tasks and features
| bd linear sync --push --exclude-type=wisp # Push all except wisps
| bd linear sync --push --parent=bd-abc123 # Push one ticket tree
| bd linear sync --dry-run # Preview without changes
| bd linear sync --prefer-local # Bidirectional, local wins
flag --create-only type=bool default="false" usage="Only create new issues, don't update existing"
flag --dry-run type=bool default="false" usage="Preview sync without making changes"
flag --exclude-type type=stringSlice default="[]" usage="Exclude issues of these types (can be repeated)"
flag --include-ephemeral type=bool default="false" usage="Include ephemeral issues (wisps, etc.) when pushing to Linear"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --milestones type=bool default="false" usage="Reconstruct Linear project milestones as local epic parents when pulling"
flag --no-wait type=bool default="false" usage="Fail immediately if another sync is running instead of waiting"
flag --parent type=string default="" usage="Limit push to this beads ticket and its descendants"
flag --prefer-linear type=bool default="false" usage="Prefer Linear version on conflicts"
flag --prefer-local type=bool default="false" usage="Prefer local version on conflicts"
flag --pull type=bool default="false" usage="Pull issues from Linear"
flag --pull-if-stale type=bool default="false" usage="Pull only if Linear data is stale (skip if fresh)"
flag --push type=bool default="false" usage="Push issues to Linear"
flag --relations type=bool default="false" usage="Import Linear relations as bd dependencies when pulling"
flag --state type=string default="all" usage="Issue state to sync: open, closed, all"
flag --team type=stringSlice default="[]" usage="Team ID(s) to sync (overrides configured team_id/team_ids)"
flag --threshold type=duration default="20m0s" usage="Staleness threshold for --pull-if-stale (default 20m)"
flag --type type=stringSlice default="[]" usage="Only sync issues of these types (can be repeated)"
flag --update-refs type=bool default="true" usage="Update external_ref after creating Linear issues"
bd linear teams
use: "teams"
short: "List available Linear teams"
hidden: false
runnable: true
long:
| List all teams accessible with your Linear API key.
|
| Use this to find the team ID (UUID) needed for configuration.
|
| Example:
| bd linear teams
| bd config set linear.team_id "12345678-1234-1234-1234-123456789abc"
bd link
use: "link <id1> <id2>"
short: "Link two issues with a dependency"
group: "issues"
hidden: false
runnable: true
long:
| Link two issues with a dependency.
|
| Shorthand for 'bd dep add <id1> <id2>'. By default creates a "blocks"
| dependency (id2 blocks id1). Use --type to specify a different relationship.
|
| Examples:
| bd link bd-123 bd-456 # bd-456 blocks bd-123
| bd link bd-123 bd-456 --type related # bd-123 related to bd-456
| bd link bd-123 bd-456 --type parent-child
flag --type -t type=string default="blocks" usage="Dependency type (blocks|tracks|related|parent-child|discovered-from)"
bd lint
use: "lint [issue-id...]"
short: "Check issues for missing template sections"
group: "views"
hidden: false
runnable: true
long:
| Check issues for missing recommended sections based on issue type.
|
| By default, lints all open issues. Specify issue IDs to lint specific issues.
|
| Section requirements by type:
| bug: Steps to Reproduce, Acceptance Criteria
| task: Acceptance Criteria
| feature: Acceptance Criteria
| epic: Success Criteria (or Acceptance Criteria)
| chore: (none)
|
| Additional per-type sections can be required via config; they are ADDITIVE
| to the built-ins above (built-in requirements are never relaxed):
|
| bd config set lint.sections.epic "Standards scorecard, Cost"
|
| Examples:
| bd lint # Lint all open issues
| bd lint bd-abc # Lint specific issue
| bd lint bd-abc bd-def # Lint multiple issues
| bd lint --type bug # Lint only bugs
| bd lint --status all # Lint all issues (including closed)
|
flag --status -s type=string default="" usage="Filter by status (default: open, use 'all' for all)"
flag --type -t type=string default="" usage="Filter by issue type (bug, task, feature, epic, decision, spike, story, chore, milestone)"
bd list
use: "list"
short: "List issues"
group: "issues"
hidden: false
runnable: true
flag --all type=bool default="false" usage="Show all issues including closed (overrides default filter)"
flag --assignee -a type=string default="" usage="Filter by assignee"
flag --brief type=bool default="false" usage="Omit the free-form text (description, design, acceptance criteria, notes, payload, waiters) from each row. Filters that read those fields, such as --desc-contains, still select on them. An omitted field is indistinguishable from an empty one in --json; fetch a whole issue with bd show."
flag --closed-after type=string default="" usage="Filter issues closed after date (YYYY-MM-DD or RFC3339)"
flag --closed-before type=string default="" usage="Filter issues closed before date (YYYY-MM-DD or RFC3339)"
flag --created-after type=string default="" usage="Filter issues created after date (YYYY-MM-DD or RFC3339)"
flag --created-before type=string default="" usage="Filter issues created before date (YYYY-MM-DD or RFC3339)"
flag --defer-after type=string default="" usage="Filter issues deferred after date (supports relative: +6h, tomorrow)"
flag --defer-before type=string default="" usage="Filter issues deferred before date (supports relative: +6h, tomorrow)"
flag --deferred type=bool default="false" usage="Show only issues with defer_until set"
flag --deps type=string default="" no-opt-default="scheduling" usage="Annotate tree with dependency edges and order siblings by them: 'scheduling' (bare --deps) or 'all'"
flag --desc-contains type=string default="" usage="Filter by description substring (case-insensitive)"
flag --due-after type=string default="" usage="Filter issues due after date (supports relative: +6h, tomorrow)"
flag --due-before type=string default="" usage="Filter issues due before date (supports relative: +6h, tomorrow)"
flag --empty-description type=bool default="false" usage="Filter issues with empty or missing description"
flag --exclude-label type=stringSlice default="[]" usage="Exclude issues that have ANY of these labels"
flag --exclude-type type=stringSlice default="[]" usage="Exclude issue types from results (comma-separated or repeatable, e.g., --exclude-type=convoy,epic)"
flag --external-contains type=string default="" usage="Filter by external ref substring (case-insensitive)"
flag --external-ref type=string default="" usage="Filter by exact external_ref value"
flag --filter-parent type=string default="" hidden usage="Alias for --parent"
flag --flat type=bool default="false" usage="Disable tree format and use legacy flat list output"
flag --format type=string default="" usage="Export the dependency graph of the listed issues: 'digraph' (edge list for golang.org/x/tools/cmd/digraph), 'dot' (Graphviz), or a Go template rendered once per edge over .IssueID, .DependsOnID, .Type, .Issue, .Dependency. 'json' is the exception and does not export the graph: it is equivalent to --json, which also wins when both flags are given. 'digraph' and templates print nothing when no listed issue depends on another; 'dot' still prints the nodes"
flag --has-metadata-key type=string default="" usage="Filter issues that have this metadata key set"
flag --id type=string default="" usage="Filter by specific issue IDs (comma-separated or repeated, e.g., bd-1,bd-5,bd-10)"
flag --include-comments type=bool default="false" usage="Populate each row's comments field with full comment bodies in JSON output (--json only; costs one query per row that has comments). Without it, a row with comments carries comments_omitted=true, so an absent comments field is never mistaken for having none. Text output is unaffected either way."
flag --include-ephemeral type=bool default="false" usage="Include ephemeral wisp-plane rows in output (normally hidden)"
flag --include-gates type=bool default="false" usage="Include gate issues in output (normally hidden)"
flag --include-infra type=bool default="false" usage="Include infrastructure beads (agent/role/message) in output"
flag --include-templates type=bool default="false" usage="Include template molecules in output"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE). Can combine with --label"
flag --label-pattern type=string default="" usage="Filter by label glob pattern (e.g., 'tech-*' matches tech-debt, tech-legacy)"
flag --label-regex type=string default="" usage="Filter by label regex pattern (e.g., 'tech-(debt|legacy)')"
flag --limit -n type=int default="50" usage="Limit results (an explicit --limit always wins, 0 meaning unlimited; otherwise --all is unlimited; otherwise a configured list.limit applies; otherwise unlimited when piped, else 20 in agent mode at a terminal, else 50)"
flag --long type=bool default="false" usage="Show detailed multi-line output for each issue"
flag --max-rows type=int default="0" usage="Hard upper bound on rows returned. Returns a non-zero exit (code 2) and an error to stderr if exceeded. 0 disables (the default). Overrides BEADS_MAX_ROWS for this invocation. Useful in CI/agent rigs that want a circuit breaker against pathological queries. Honored on both the direct and the --proxied-server route."
flag --metadata-field type=stringArray default="[]" usage="Filter by metadata field (key=value, repeatable)"
flag --mol-type type=string default="" usage="Filter by molecule type: swarm, patrol, or work"
flag --no-assignee type=bool default="false" usage="Filter issues with no assignee"
flag --no-labels type=bool default="false" usage="Filter issues with no labels"
flag --no-pager type=bool default="false" usage="Disable pager output"
flag --no-parent type=bool default="false" usage="Exclude child issues (show only top-level issues)"
flag --no-pinned type=bool default="false" usage="Exclude pinned issues"
flag --notes-contains type=string default="" usage="Filter by notes substring (case-insensitive)"
flag --offset type=int default="0" usage="Skip the first N matching results (0-based). Only supported under --proxied-server."
flag --overdue type=bool default="false" usage="Show only issues with due_at in the past (not closed)"
flag --parent type=string default="" usage="Filter by parent issue ID (shows children of specified issue)"
flag --pinned type=bool default="false" usage="Show only pinned issues"
flag --pretty type=bool default="false" usage="Display issues in a tree format with status/priority symbols"
flag --priority -p type=string default="" usage="Priority (0-4 or P0-P4, 0=highest)"
flag --priority-max type=string default="" usage="Filter by maximum priority (inclusive, 0-4 or P0-P4)"
flag --priority-min type=string default="" usage="Filter by minimum priority (inclusive, 0-4 or P0-P4)"
flag --ready type=bool default="false" usage="Show only ready issues (no active blockers, same semantics as bd ready)"
flag --reverse -r type=bool default="false" usage="Invert the sort field's default direction (created/updated/closed default to newest-first, so --sort updated --reverse is oldest-first)"
flag --skip-labels type=bool default="false" usage="Skip label hydration. The labels field in output will be empty regardless of actual labels. Use only when the caller does not depend on label data. Cannot combine with --label, --label-any, --label-pattern, --label-regex, --exclude-label, or --no-labels."
flag --sort type=string default="" usage="Sort by field: priority, created, updated, closed, status, id, title, type, assignee"
flag --spec type=string default="" usage="Filter by spec_id prefix"
flag --state type=string default="" hidden usage="Alias for --status"
flag --status -s type=string default="" usage="Filter by stored status (open, in_progress, blocked, deferred, closed). Comma-separated or repeated for multiple: --status open,in_progress"
flag --title type=string default="" usage="Filter by title text (case-insensitive substring match)"
flag --title-contains type=string default="" usage="Filter by title substring (case-insensitive)"
flag --tree type=bool default="true" usage="Hierarchical tree format (default: true; use --flat to disable)"
flag --type -t type=string default="" usage="Filter by type (bug, feature, task, epic, chore, decision, merge-request, molecule, gate, convoy). Aliases: mr→merge-request, feat→feature, mol→molecule, dec/adr→decision"
flag --updated-after type=string default="" usage="Filter issues updated after date (YYYY-MM-DD or RFC3339)"
flag --updated-before type=string default="" usage="Filter issues updated before date (YYYY-MM-DD or RFC3339)"
flag --watch -w type=bool default="false" usage="Watch for changes and auto-update display (implies --pretty)"
flag --wisp-type type=string default="" usage="Filter by wisp type: heartbeat, ping, patrol, gc_report, recovery, error, escalation"
bd mail
use: "mail [subcommand] [args...]"
short: "Delegate to mail provider (e.g., gt mail)"
hidden: false
runnable: true
disable-flag-parsing: true
long:
| Delegates mail operations to an external mail provider.
|
| Agents often type 'bd mail' when working with beads, but mail functionality
| is typically provided by the orchestrator. This command bridges that gap
| by delegating to the configured mail provider.
|
| Configuration (checked in order):
| 1. BEADS_MAIL_DELEGATE or BD_MAIL_DELEGATE environment variable
| 2. 'mail.delegate' config setting (bd config set mail.delegate "gt mail")
|
| Examples:
| # Configure delegation (one-time setup)
| export BEADS_MAIL_DELEGATE="gt mail"
| # or
| bd config set mail.delegate "gt mail"
|
| # Then use bd mail as if it were gt mail
| bd mail inbox # Lists inbox
| bd mail send mayor/ -s "Hi" # Sends mail
| bd mail read msg-123 # Reads a message
bd memories
use: "memories [search]"
short: "List or search persistent memories"
group: "setup"
hidden: false
runnable: true
long:
| List all memories, or search by keyword.
|
| Examples:
| bd memories # list all memories
| bd memories dolt # search for memories about dolt
| bd memories "race flag" # search for a phrase
bd merge-slot
use: "merge-slot"
short: "Manage merge-slot gates for serialized conflict resolution"
group: "issues"
hidden: false
runnable: false
long:
| Merge-slot gates serialize conflict resolution in the merge queue.
|
| A merge slot is an exclusive access primitive: only one agent can hold it at a time.
| This prevents "monkey knife fights" where multiple polecats race to resolve conflicts
| and create cascading conflicts.
|
| Each rig has one merge slot bead: <prefix>-merge-slot (labeled gt:slot).
| The slot uses:
| - status=open: slot is available
| - status=in_progress: slot is held
| - metadata.holder: who currently holds the slot
| - metadata.waiters: priority-ordered queue of waiters
|
| Examples:
| bd merge-slot create # Create merge slot for current rig
| bd merge-slot check # Check if slot is available
| bd merge-slot acquire # Try to acquire the slot
| bd merge-slot release # Release the slot
bd merge-slot acquire
use: "acquire"
short: "Acquire the merge slot"
hidden: false
runnable: true
long:
| Attempt to acquire the merge slot for exclusive access.
|
| If the slot is available (status=open), it will be acquired:
| - status set to in_progress
| - holder set to the requester
|
| If the slot is held (status=in_progress), the command fails unless
| --wait is passed, which adds the requester to the waiters queue.
|
| Use --holder to specify who is acquiring (default: BEADS_ACTOR env var).
flag --holder type=string default="" usage="Who is acquiring the slot (default: BEADS_ACTOR)"
flag --wait type=bool default="false" usage="Add to waiters list if slot is held"
bd merge-slot check
use: "check"
short: "Check merge slot availability"
hidden: false
runnable: true
long:
| Check if the merge slot is available or held.
|
| Returns:
| - available: slot can be acquired
| - held by <holder>: slot is currently held
| - not found: no merge slot exists for this rig
bd merge-slot create
use: "create"
short: "Create a merge slot bead for the current rig"
hidden: false
runnable: true
long:
| Create a merge slot bead for serialized conflict resolution.
|
| The slot ID is automatically generated based on the beads prefix (e.g., gt-merge-slot).
| The slot is created with status=open (available).
bd merge-slot release
use: "release"
short: "Release the merge slot"
hidden: false
runnable: true
long:
| Release the merge slot after conflict resolution is complete.
|
| Sets status back to open and clears the holder field.
| If there are waiters, the highest-priority waiter should then acquire.
flag --holder type=string default="" usage="Who is releasing the slot (for verification)"
bd metrics
use: "metrics"
short: "Show or change anonymous usage-metrics settings"
hidden: false
runnable: true
long:
| Show whether anonymous usage metrics are on, see exactly what is sent, and
| turn them on or off.
|
| bd shares anonymous usage metrics to learn how people actually use it — just
| which commands get run, plus the bd version and OS platform. That's how we decide
| what to polish next. We never collect your issues, paths, remotes, identity, or
| any user-supplied text.
|
| bd metrics show the current status and what is collected
| bd metrics on turn metrics on
| bd metrics off turn metrics off
| bd metrics example show real examples of the events bd sends
bd metrics example
use: "example"
short: "Show real examples of the anonymous metrics bd sends"
hidden: false
runnable: true
bd metrics off
use: "off"
short: "Turn anonymous usage metrics off"
hidden: false
runnable: true
bd metrics on
use: "on"
short: "Turn anonymous usage metrics on"
hidden: false
runnable: true
bd migrate
use: "migrate"
short: "Database migration commands"
group: "maint"
hidden: false
runnable: true
long:
| Database migration and data transformation commands.
|
| Without subcommand, checks and updates database metadata to current version.
|
| Subcommands:
| hooks Plan git hook migration to marker-managed format
| issues Move issues between repositories
| schema Apply pending schema migrations (idempotent)
| sync Set up sync.branch workflow for multi-clone setups
| from-server-to-proxied-server [EXPERIMENTAL] Switch server mode to proxied-server mode
| from-proxied-server-to-server [EXPERIMENTAL] Switch proxied-server mode to server mode
| from-shared-server-to-proxied-server [EXPERIMENTAL] Switch shared-server mode to proxied-server mode
| from-proxied-server-to-shared-server [EXPERIMENTAL] Switch proxied-server mode to shared-server mode
|
| On a remote-backed database with pending schema migrations bd refuses to
| migrate in place (#4259): migrating two clones independently forks the schema
| so bd dolt pull can no longer merge — the break is silent and unrecoverable.
| Use --force to confirm you are the single designated migrator, after which you
| should publish the migrated schema with 'bd dolt push'. The env-var equivalent
| BD_ALLOW_REMOTE_MIGRATE=1 remains supported for scripted/CI use.
|
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
flag --force type=bool default="false" usage="Bypass the remote-migrate gate as the single designated migrator (equivalent to BD_ALLOW_REMOTE_MIGRATE=1)"
flag --inspect type=bool default="false" usage="Show migration plan and database state for AI agent analysis"
flag --update-repo-id type=bool default="false" usage="Update repository ID (use after changing git remote)"
flag --yes type=bool default="false" usage="Auto-confirm prompts"
bd migrate from-proxied-server-to-server
use: "from-proxied-server-to-server"
short: "[EXPERIMENTAL] Switch a proxied-server repo to server mode"
hidden: false
runnable: true
long:
| Switch a repo from proxied-server mode to server mode (bd init --server).
|
| Both modes root their dolt sql-server at the same .beads/dolt directory, so this
| only rewrites .beads/metadata.json (dolt_mode) and removes the proxied-server
| sidecar — no Dolt data is copied or moved. Stop the running proxy first with
| 'bd dolt stop'.
|
| Note: dolt_mode lives in the committed metadata.json, so this change propagates
| to clones on the next push.
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
bd migrate from-proxied-server-to-shared-server
use: "from-proxied-server-to-shared-server"
short: "[EXPERIMENTAL] Switch a proxied-server repo back to shared-server mode"
hidden: false
runnable: true
long:
| Switch a repo from proxied-server mode back to shared-server mode.
|
| Only applies to a proxied-server repo rooted at the shared dolt directory
| (~/.beads/shared-server/dolt) — the reverse of from-shared-server-to-proxied-server.
| This rewrites .beads/metadata.json (dolt_mode), re-enables dolt.shared-server, and
| removes the proxied-server sidecar; no Dolt data is copied or moved. Stop the
| running proxy first with 'bd dolt stop'.
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
bd migrate from-server-to-proxied-server
use: "from-server-to-proxied-server"
short: "[EXPERIMENTAL] Switch a server-mode repo to proxied-server mode"
hidden: false
runnable: true
long:
| Switch a repo from server mode (bd init --server) to proxied-server mode.
|
| Both modes root their dolt sql-server at the same .beads/dolt directory, so this
| only rewrites .beads/metadata.json (dolt_mode) and writes the proxied-server
| sidecar — no Dolt data is copied or moved. Stop the running server first with
| 'bd dolt stop'.
|
| Note: dolt_mode lives in the committed metadata.json, so this change propagates
| to clones on the next push.
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
flag --idle-timeout type=duration default="0s" usage="Proxy idle timeout; omit for the 30s default, 0 for indefinite uptime"
bd migrate from-shared-server-to-proxied-server
use: "from-shared-server-to-proxied-server"
short: "[EXPERIMENTAL] Switch a shared-server repo to proxied-server mode"
hidden: false
runnable: true
long:
| Switch a repo from shared-server mode to proxied-server mode.
|
| The proxied server is rooted at the shared dolt directory
| (~/.beads/shared-server/dolt), so no Dolt data is copied or moved; this rewrites
| .beads/metadata.json (dolt_mode), turns off dolt.shared-server for this repo, and
| writes the proxied-server sidecar. Stop the running shared server first with
| 'bd dolt stop' — note that stops it for every project sharing it.
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
flag --idle-timeout type=duration default="0s" usage="Proxy idle timeout; omit for the 30s default, 0 for indefinite uptime"
bd migrate hooks
use: "hooks [path]"
short: "Plan or apply git hook migration to marker-managed format"
hidden: false
runnable: true
long:
| Analyze git hook files and sidecar artifacts for migration to marker-managed format.
|
| Modes:
| --dry-run Preview migration operations without changing files
| --apply Apply migration operations
|
| Examples:
| bd migrate hooks --dry-run
| bd migrate hooks --apply
| bd migrate hooks --apply --yes
| bd migrate hooks --dry-run --json
flag --apply type=bool default="false" usage="Apply planned hook migration changes"
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
flag --yes type=bool default="false" usage="Skip confirmation prompt for --apply"
bd migrate issues
use: "issues"
short: "Move issues between repositories"
hidden: false
runnable: true
long:
| Move issues from one source repository to another with filtering and dependency preservation.
|
| This command updates the source_repo field for selected issues, allowing you to:
| - Move contributor planning issues to upstream repository
| - Reorganize issues across multi-phase repositories
| - Consolidate issues from multiple repos
|
| Examples:
| # Preview migration from planning repo to current repo
| bd migrate-issues --from ~/.beads-planning --to . --dry-run
|
| # Move all open P1 bugs
| bd migrate-issues --from ~/repo1 --to ~/repo2 --priority 1 --type bug --status open
|
| # Move specific issues with their dependencies
| bd migrate-issues --from . --to ~/archive --id bd-abc --id bd-xyz --include closure
|
| # Move issues with label filter
| bd migrate-issues --from . --to ~/feature-work --label frontend --label urgent
flag --dry-run type=bool default="false" usage="Show plan without making changes"
flag --from type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Source repository (required)"
flag --id type=stringSlice default="[]" usage="Specific issue IDs to migrate (can specify multiple)"
flag --ids-file type=string default="" usage="File containing issue IDs (one per line)"
flag --include type=string default="none" usage="Include dependencies: none/upstream/downstream/closure"
flag --label type=stringSlice default="[]" usage="Filter by labels (can specify multiple)"
flag --priority type=int default="-1" usage="Filter by priority (0-4)"
flag --status type=string default="" usage="Filter by status (open/closed/all)"
flag --strict type=bool default="false" usage="Fail on orphaned dependencies or missing repos"
flag --to type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Destination repository (required)"
flag --type type=string default="" usage="Filter by issue type (bug/feature/task/epic/chore/decision)"
flag --within-from-only type=bool default="true" usage="Only include dependencies from source repo"
flag --yes type=bool default="false" usage="Skip confirmation prompt"
bd migrate legacy-sqlite
use: "legacy-sqlite --source-db PATH --output PATH|-"
short: "Read an authenticated legacy SQLite database as JSONL"
hidden: false
runnable: true
annotations: {bd:skip_store="1"}
flag --output type=string default="" usage="JSONL output path, or - for stdout"
flag --source-db type=string default="" usage="Legacy SQLite database (read-only)"
bd migrate schema
use: "schema"
short: "Apply pending schema migrations (idempotent)"
hidden: false
runnable: true
long:
| Apply pending schema migrations idempotently.
|
| bd does not apply pending schema migrations to an existing database without
| the operator's consent, and running this command is that consent
| (BD_ALLOW_MIGRATE=1 is the scripted form). On a remote-backed database the
| remote-migrate gate still applies: --force confirms you are the single
| designated migrator. Migrating is one-way: bd releases built for an older
| schema refuse the migrated database.
|
| On an up-to-date database this is a no-op, so it is safe to run in CI,
| release gates, and recovery scenarios.
|
| Example:
| bd migrate schema
| bd migrate schema --json
flag --force type=bool default="false" usage="Bypass the remote-migrate gate as the single designated migrator (equivalent to BD_ALLOW_REMOTE_MIGRATE=1)"
bd migrate sync
use: "sync <branch>"
short: "Set up sync.branch workflow for multi-clone setups"
hidden: false
runnable: true
long:
| Configure separate branch workflow for multi-clone setups.
|
| This sets the sync.branch config value so that issue data is committed
| to a dedicated branch, keeping your main branch clean.
|
| Example:
| bd migrate sync beads-sync
flag --dry-run type=bool default="false" usage="Show what would be done without making changes"
bd migrate-issues
use: "migrate-issues"
short: "Move issues between repositories"
hidden: true
deprecated: "use 'bd migrate issues' instead (will be removed in v1.0.0)"
runnable: true
long:
| Move issues from one source repository to another with filtering and dependency preservation.
|
| This command updates the source_repo field for selected issues, allowing you to:
| - Move contributor planning issues to upstream repository
| - Reorganize issues across multi-phase repositories
| - Consolidate issues from multiple repos
|
| Examples:
| # Preview migration from planning repo to current repo
| bd migrate-issues --from ~/.beads-planning --to . --dry-run
|
| # Move all open P1 bugs
| bd migrate-issues --from ~/repo1 --to ~/repo2 --priority 1 --type bug --status open
|
| # Move specific issues with their dependencies
| bd migrate-issues --from . --to ~/archive --id bd-abc --id bd-xyz --include closure
|
| # Move issues with label filter
| bd migrate-issues --from . --to ~/feature-work --label frontend --label urgent
flag --dry-run type=bool default="false" usage="Show plan without making changes"
flag --from type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Source repository (required)"
flag --id type=stringSlice default="[]" usage="Specific issue IDs to migrate (can specify multiple)"
flag --ids-file type=string default="" usage="File containing issue IDs (one per line)"
flag --include type=string default="none" usage="Include dependencies: none/upstream/downstream/closure"
flag --label type=stringSlice default="[]" usage="Filter by labels (can specify multiple)"
flag --priority type=int default="-1" usage="Filter by priority (0-4)"
flag --status type=string default="" usage="Filter by status (open/closed/all)"
flag --strict type=bool default="false" usage="Fail on orphaned dependencies or missing repos"
flag --to type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Destination repository (required)"
flag --type type=string default="" usage="Filter by issue type (bug/feature/task/epic/chore/decision)"
flag --within-from-only type=bool default="true" usage="Only include dependencies from source repo"
flag --yes type=bool default="false" usage="Skip confirmation prompt"
bd migrate-personal
use: "migrate-personal"
short: "Move personal planning issues from the project database to your planning repo"
group: "setup"
hidden: false
runnable: true
long:
| Identify issues you created in the project database and move them to your
| personal planning repository (~/.beads-planning by default).
|
| This is a one-time migration for contributors who created personal planning
| issues before contributor routing was configured.
|
| The command:
| 1. Finds all issues in the project database created by your git identity
| 2. Shows you the list and asks for confirmation
| 3. Moves them to the planning repo configured in routing.contributor
|
| EXAMPLES:
| bd migrate-personal # Interactive: show list and prompt
| bd migrate-personal -y # Non-interactive: skip confirmation
flag --yes -y type=bool default="false" usage="Skip confirmation prompt"
bd mol
use: "mol"
aliases: ["protomolecule"]
short: "Molecule commands (work templates)"
hidden: false
runnable: false
long:
| Manage molecules - work templates for agent workflows.
|
| Protos are template epics with the "template" label. They define a DAG of work
| that can be spawned to create real issues (molecules).
|
| The molecule metaphor:
| - A proto is an uninstantiated template (reusable work pattern)
| - Spawning creates a molecule (real issues) from the proto
| - Variables ({{key}}) are substituted during spawning
| - Bonding combines protos or molecules into compounds
| - Distilling extracts a proto from an ad-hoc epic
|
| Commands:
| show Show proto/molecule structure and variables
| pour Instantiate proto as persistent mol (liquid phase)
| wisp Instantiate proto as ephemeral wisp (vapor phase)
| bond Polymorphic combine: proto+proto, proto+mol, mol+mol
| squash Condense molecule to digest
| burn Discard wisp
| distill Extract proto from ad-hoc epic
|
| Use "bd formula list" to list available formulas.
bd mol bond
use: "bond <A> <B>"
aliases: ["fart"]
short: "Bond two protos or molecules together"
hidden: false
runnable: true
long:
| Bond two protos or molecules to create a compound.
|
| The bond command is polymorphic - it handles different operand types:
|
| formula + formula → cook both, compound proto
| formula + proto → cook formula, compound proto
| formula + mol → cook formula, spawn and attach
| proto + proto → compound proto (reusable template)
| proto + mol → spawn proto, attach to molecule
| mol + proto → spawn proto, attach to molecule
| mol + mol → join into compound molecule
|
| Formula names (e.g., mol-polecat-arm) are cooked inline as ephemeral protos.
| This avoids needing pre-cooked proto beads in the database.
|
| Bond types:
| sequential (default) - B runs after A completes
| parallel - B runs alongside A
| conditional - B runs only if A fails
|
| With --ref, the spawned proto arm is nested inside the molecule operand
| rather than ordered against it - whichever side of the bond that is - so a
| sequential --ref arm carries no ordering: it is ready as soon as it is
| spawned. Ordering a nested arm against its own container is unsatisfiable
| in both directions (the arm waits for the molecule to close; the molecule
| cannot close while it holds an open arm). --ref is refused with --type
| conditional, which has no safe degradation - omit --ref to bond a
| conditional arm as a sibling.
|
| Phase control:
| By default, spawned protos follow the target's phase:
| - Attaching to mol (Ephemeral=false) → spawns as persistent (Ephemeral=false)
| - Attaching to ephemeral issue (Ephemeral=true) → spawns as ephemeral (Ephemeral=true)
|
| Override with:
| --pour Force spawn as liquid (persistent, Ephemeral=false)
| --ephemeral Force spawn as vapor (ephemeral, Ephemeral=true, excluded from Dolt sync via dolt_ignore)
|
| Dynamic bonding (Christmas Ornament pattern):
| Use --ref to specify a custom child reference with variable substitution.
| This creates IDs like "parent.child-ref" instead of random hashes.
|
| Example:
| bd mol bond mol-worker-arm bd-patrol --ref arm-{{worker_name}} --var worker_name=ace
| # Creates: bd-patrol.arm-ace (and children like bd-patrol.arm-ace.capture)
|
| Use cases:
| - Found important bug during patrol? Use --pour to persist it
| - Need ephemeral diagnostic on persistent feature? Use --ephemeral
| - Spawning per-worker arms on a patrol? Use --ref for readable IDs
|
| Examples:
| bd mol bond mol-feature mol-deploy # Compound proto
| bd mol bond mol-feature mol-deploy --type parallel # Run in parallel
| bd mol bond mol-feature bd-abc123 # Attach proto to molecule
| bd mol bond bd-abc123 bd-def456 # Join two molecules
| bd mol bond mol-critical-bug wisp-patrol --pour # Persist found bug
| bd mol bond mol-temp-check bd-feature --ephemeral # Ephemeral diagnostic
| bd mol bond mol-arm bd-patrol --ref arm-{{name}} --var name=ace # Dynamic child ID
flag --as type=string default="" usage="Custom title for compound proto (proto+proto only)"
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --ephemeral type=bool default="false" usage="Force spawn as vapor (ephemeral, Ephemeral=true)"
flag --pour type=bool default="false" usage="Force spawn as liquid (persistent, Ephemeral=false)"
flag --ref type=string default="" usage="Custom child reference with {{var}} substitution (e.g., arm-{{polecat_name}})"
flag --type type=string default="sequential" usage="Bond type: sequential, parallel, or conditional"
flag --var type=stringArray default="[]" usage="Variable substitution for spawned protos (key=value)"
bd mol burn
use: "burn <molecule-id> [molecule-id...]"
short: "Delete a molecule without creating a digest"
hidden: false
runnable: true
long:
| Burn a molecule, deleting it without creating a digest.
|
| Unlike squash (which creates a permanent digest before deletion), burn
| completely removes the molecule with no trace. Use this for:
| - Abandoned patrol cycles
| - Crashed or failed workflows
| - Test/debug molecules you don't want to preserve
|
| The burn operation differs based on molecule phase:
| - Wisp (ephemeral): Direct delete
| - Mol (persistent): Cascade delete (syncs to remotes)
|
| CAUTION: This is a destructive operation. The molecule's data will be
| permanently lost. If you want to preserve a summary, use 'bd mol squash'.
|
| Example:
| bd mol burn bd-abc123 # Delete molecule with no trace
| bd mol burn bd-abc123 --dry-run # Preview what would be deleted
| bd mol burn bd-abc123 --force # Skip confirmation
| bd mol burn bd-a1 bd-b2 bd-c3 # Batch delete multiple wisps
flag --dry-run type=bool default="false" usage="Preview what would be deleted"
flag --force type=bool default="false" usage="Skip confirmation prompt"
flag --yes -y type=bool default="false" hidden usage="Alias for --force (skip confirmation)"
bd mol current
use: "current [molecule-id]"
short: "Show current position in molecule workflow"
hidden: false
runnable: true
long:
| Show where you are in a molecule workflow.
|
| If molecule-id is given, show status for that molecule.
| If not given, infer from in_progress issues assigned to current agent.
|
| The output shows all steps with status indicators:
| [done] - Step is complete (closed)
| [current] - Step is in_progress (you are here)
| [ready] - Step is ready to start (unblocked)
| [blocked] - Step is blocked by dependencies
| [pending] - Step is waiting
|
| For large molecules (>100 steps), a summary is shown instead.
| Use --limit or --range to view specific steps:
| bd mol current <id> --limit 50 # Show first 50 steps
| bd mol current <id> --range 100-150 # Show steps 100-150
flag --for type=string default="" usage="Show molecules for a specific agent/assignee"
flag --limit type=int default="0" usage="Maximum number of steps to display (0 = auto, use 'all' threshold)"
flag --range type=string default="" usage="Display specific step range (e.g., '1-50', '100-150')"
bd mol distill
use: "distill <epic-id> [formula-name]"
short: "Extract a formula from an existing epic"
hidden: false
runnable: true
long:
| Distill a molecule by extracting a reusable formula from an existing epic.
|
| This is the reverse of pour: instead of formula → molecule, it's molecule → formula.
|
| The distill command:
| 1. Loads the existing epic and all its children
| 2. Converts the structure to a .formula.json file
| 3. Replaces concrete values with {{variable}} placeholders (via --var flags)
|
| Use cases:
| - Team develops good workflow organically, wants to reuse it
| - Capture tribal knowledge as executable templates
| - Create starting point for similar future work
|
| Variable syntax (both work - we detect which side is the concrete value):
| --var branch=feature-auth Spawn-style: variable=value (recommended)
| --var feature-auth=branch Substitution-style: value=variable
|
| Output locations (first writable wins):
| 1. <resolved-beads-dir>/formulas/ (project-level, default)
| 2. <checkout-root>/.beads/formulas/ (repo-local formulas)
| 3. ~/.beads/formulas/ (user-level, if project not writable)
|
| Examples:
| bd mol distill bd-o5xe my-workflow
| bd mol distill bd-abc release-workflow --var feature_name=auth-refactor
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --output type=string default="" usage="Output directory for formula file"
flag --var type=stringArray default="[]" usage="Replace value with {{variable}} placeholder (variable=value)"
bd mol last-activity
use: "last-activity <molecule-id>"
short: "Show last activity timestamp for a molecule"
hidden: false
runnable: true
long:
| Show the most recent activity timestamp for a molecule.
|
| Returns the timestamp of the most recent change to any step in the molecule,
| making it easy to detect stale or stuck molecules.
|
| Activity sources:
| step_closed - A step was closed
| step_updated - A step was updated (claimed, edited, etc.)
| molecule_updated - The molecule root itself was updated
|
| Examples:
| bd mol last-activity hq-wisp-0laki
| bd mol last-activity hq-wisp-0laki --json
bd mol pour
use: "pour <proto-id>"
short: "Instantiate a proto as a persistent mol (solid -> liquid)"
hidden: false
runnable: true
long:
| Pour a proto into a persistent mol - like pouring molten metal into a mold.
|
| This is the chemistry-inspired command for creating PERSISTENT work from templates.
| The resulting mol is stored as persistent beads in the issue database and
| syncs like any other bead (bd dolt push / pull).
|
| Phase transition: Proto (solid) -> pour -> Mol (liquid)
|
| WHEN TO USE POUR vs WISP:
| pour (liquid): Persistent work that needs audit trail
| - Feature implementations spanning multiple sessions
| - Work you may need to reference later
| - Anything worth preserving in git history
|
| wisp (vapor): Ephemeral work that auto-cleans up
| - Release workflows (one-time execution)
| - Operational loops and recurring cycles
| - Health checks and diagnostics
| - Any operational workflow without audit value
|
| TIP: Formulas can specify phase:"vapor" to recommend wisp usage.
| If you pour a vapor-phase formula, you'll get a warning.
|
| Examples:
| bd mol pour mol-feature --var name=auth # Persistent feature work
| bd mol pour mol-review --var pr=123 # Persistent code review
flag --assignee type=string default="" usage="Assign the root issue to this agent/user"
flag --attach type=stringSlice default="[]" usage="Proto to attach after spawning (repeatable)"
flag --attach-type type=string default="sequential" usage="Bond type for attachments: sequential, parallel, or conditional"
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --var type=stringArray default="[]" usage="Variable substitution (key=value); a name the proto cannot consume is an error"
bd mol progress
use: "progress [molecule-id]"
short: "Show molecule progress summary"
hidden: false
runnable: true
long:
| Show efficient progress summary for a molecule.
|
| This command uses indexed queries to count progress without loading all steps,
| making it suitable for very large molecules (millions of steps).
|
| If no molecule-id is given, shows progress for any molecule you're working on.
|
| Output includes:
| - Progress: completed / total (percentage)
| - Current step: the in-progress step (if any)
| - Rate: steps/hour based on closure times
| - ETA: estimated time to completion
|
| Example:
| bd mol progress bd-hanoi-xyz
bd mol ready
use: "ready --gated"
short: "Find molecules ready for gate-resume dispatch"
hidden: false
runnable: true
long:
| Find molecules where a gate has closed and the workflow is ready to resume.
|
| This command discovers molecules waiting at a gate step where:
| 1. The molecule has a gate bead that blocks a step
| 2. The gate bead is now closed (condition satisfied)
| 3. The blocked step is now ready to proceed
| 4. No agent currently has this molecule hooked
|
| This enables discovery-based resume without explicit waiter tracking.
| The patrol system uses this to find and dispatch gate-ready molecules.
|
| Examples:
| bd mol ready --gated # Find all gate-ready molecules
| bd mol ready --gated --json # JSON output for automation
flag --gated type=bool default="false" usage="Find molecules ready for gate-resume dispatch (always on for this subcommand)"
bd mol seed
use: "seed <formula-name>"
short: "Verify formula accessibility"
hidden: false
runnable: true
long:
| Verify that a formula is accessible and can be cooked.
|
| The seed command checks formula search paths to ensure a formula exists
| and can be loaded. This is useful for verifying system health before
| attempting to spawn work from a formula.
|
| Formula search paths (checked in order):
| 1. <resolved-beads-dir>/formulas/ (active project)
| 2. <checkout-root>/.beads/formulas/ (repo-local formulas)
| 3. ~/.beads/formulas/ (user level)
| 4. $GT_ROOT/.beads/formulas/ (shared workspace root, if GT_ROOT set)
|
| Examples:
| bd mol seed mol-feature # Verify specific formula
| bd mol seed mol-review --var name=test # Verify with variable substitution
flag --var type=stringArray default="[]" usage="Variable substitution for condition filtering (key=value)"
bd mol show
use: "show <molecule-id>"
short: "Show molecule details"
hidden: false
runnable: true
long:
| Show molecule structure and details.
|
| A molecule's steps are the issues linked to its root by parent-child
| dependencies (bd create --parent, bd mol pour); an id that merely looks
| hierarchical, like bd-xyz.4, does not make an issue a step.
|
| The --parallel flag highlights parallelizable steps:
| - Steps with no blocking dependencies can run in parallel
| - Shows which steps are ready to start now
| - Identifies parallel groups (steps that can run concurrently)
|
| Example:
| bd mol show bd-patrol --parallel
flag --parallel -p type=bool default="false" usage="Show parallel step analysis"
bd mol squash
use: "squash <molecule-id>"
short: "Compress molecule execution into a digest"
hidden: false
runnable: true
long:
| Squash a molecule's ephemeral children into a single digest issue.
|
| This command collects all ephemeral child issues of a molecule (Ephemeral=true),
| generates a summary digest, and promotes the wisps to persistent by
| clearing their Wisp flag (or optionally deletes them).
|
| The squash operation:
| 1. Loads the molecule and all its children
| 2. Filters to only wisps (ephemeral issues with Ephemeral=true)
| 3. Generates a digest (summary of work done)
| 4. Creates a permanent digest issue (Ephemeral=false)
| 5. Clears Wisp flag on children (promotes to persistent)
| OR keeps them with --keep-children (default: delete)
|
| AGENT INTEGRATION:
| Use --summary to provide an AI-generated summary. This keeps bd as a pure
| tool - the calling agent (orchestrator worker, Claude Code, etc.) is responsible
| for generating intelligent summaries. Without --summary, a basic concatenation
| of child issue content is used.
|
| This is part of the wisp workflow: spawn creates wisps,
| execution happens, squash compresses the trace into an outcome (digest).
|
| Example:
| bd mol squash bd-abc123 # Squash and promote children
| bd mol squash bd-abc123 --dry-run # Preview what would be squashed
| bd mol squash bd-abc123 --keep-children # Keep wisps after digest
| bd mol squash bd-abc123 --summary "Agent-generated summary of work done"
flag --dry-run type=bool default="false" usage="Preview what would be squashed"
flag --keep-children type=bool default="false" usage="Don't delete ephemeral children after squash"
flag --summary type=string default="" usage="Agent-provided summary (bypasses auto-generation)"
bd mol stale
use: "stale"
short: "Detect molecules with all children closed but root still open"
hidden: false
runnable: true
long:
| Detect molecules (epics with children) whose children are all closed
| with completing reasons, but the root is still open.
|
| A molecule is considered stale if:
| 1. Every child is closed with a completing reason (not duplicate/wontfix/superseded)
| 2. Root issue is still open
| 3. Not assigned to anyone (optional, use --unassigned)
| 4. Is blocking other work (optional, use --blocking)
|
| Review whether epic scope is actually finished before closing — child
| closure alone does not prove the epic's stated work is done (GH#5026).
|
| Examples:
| bd mol stale # List all stale molecules
| bd mol stale --json # Machine-readable output
| bd mol stale --blocking # Only show those blocking other work
| bd mol stale --unassigned # Only show unassigned molecules
| bd mol stale --all # Include molecules with 0 children
flag --all type=bool default="false" usage="Include molecules with 0 children"
flag --blocking type=bool default="false" usage="Only show molecules blocking other work"
flag --unassigned type=bool default="false" usage="Only show unassigned molecules"
bd mol wisp
use: "wisp [proto-id]"
short: "Create or manage wisps (ephemeral molecules)"
hidden: false
runnable: true
long:
| Create or manage wisps - EPHEMERAL molecules for operational workflows.
|
| When called with a proto-id argument, creates a wisp from that proto.
| When called with a subcommand (list, gc), manages existing wisps.
|
| Wisps are issues with Ephemeral=true in the main database. They're stored
| locally but NOT synced via git.
|
| WHEN TO USE WISP vs POUR:
| wisp (vapor): Ephemeral work that auto-cleans up
| - Release workflows (one-time execution)
| - Operational loops and recurring cycles
| - Health checks and diagnostics
| - Any operational workflow without audit value
|
| pour (liquid): Persistent work that needs audit trail
| - Feature implementations spanning multiple sessions
| - Work you may need to reference later
| - Anything worth preserving in git history
|
| TIP: Formulas can specify phase:"vapor" to recommend wisp usage.
| If you use pour on a vapor-phase formula, you'll get a warning.
|
| The wisp lifecycle:
| 1. Create: bd mol wisp <proto> or bd create --ephemeral
| 2. Execute: Normal bd operations work on wisp issues
| 3. Squash: bd mol squash <id> (clears Ephemeral flag, promotes to persistent)
| 4. Or burn: bd mol burn <id> (deletes without creating digest)
|
| Examples:
| bd mol wisp beads-release --var version=1.0 # Release workflow
| bd mol wisp mol-my-workflow # Ephemeral operational cycle
| bd mol wisp list # List all wisps
| bd mol wisp gc # Garbage collect old wisps
|
| Subcommands:
| list List all wisps in current context
| gc Garbage collect orphaned wisps
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --root-only type=bool default="false" usage="Create only the root issue (no child step issues)"
flag --var type=stringArray default="[]" usage="Variable substitution (key=value); a name the proto cannot consume is an error"
bd mol wisp create
use: "create <proto-id>"
short: "Instantiate a proto as a wisp (solid -> vapor)"
hidden: false
runnable: true
long:
| Create a wisp from a proto - sublimation from solid to vapor.
|
| This is the chemistry-inspired command for creating ephemeral work from templates.
| The resulting wisp is stored in the main database with Ephemeral=true and NOT synced via git.
|
| Phase transition: Proto (solid) -> Wisp (vapor)
|
| Use wisp for:
| - Operational loops and recurring cycles
| - Health checks and monitoring
| - One-shot orchestration runs
| - Routine operations with no audit value
|
| The wisp will:
| - Be stored in main database with Ephemeral=true flag
| - NOT be synced via git
| - Either evaporate (burn) or condense to digest (squash)
|
| Examples:
| bd mol wisp create mol-patrol # Ephemeral patrol cycle
| bd mol wisp create mol-health-check # One-time health check
| bd mol wisp create mol-diagnostics --var target=db # Diagnostic run
flag --dry-run type=bool default="false" usage="Preview what would be created"
flag --root-only type=bool default="false" usage="Create only the root issue (no child step issues)"
flag --var type=stringArray default="[]" usage="Variable substitution (key=value); a name the proto cannot consume is an error"
bd mol wisp gc
use: "gc"
short: "Garbage collect old/abandoned wisps"
hidden: false
runnable: true
long:
| Garbage collect old or abandoned wisps from the database.
|
| A wisp is considered abandoned if:
| - It hasn't been updated in --age duration and is not closed
| - AND it is not live work: blocked steps (waiting on a dependency), pinned
| beads, and any step whose status category is wip (in_progress, blocked,
| hooked) or frozen (deferred, pinned) are never reclaimed by age, no matter
| how long they have been waiting (GH#4394). Custom statuses count by their
| configured category, so only plain open (active) and closed (done) steps
| are age-reclaimable. If the blocked set or the custom-status list cannot be
| read, the GC aborts rather than risk reclaiming live steps.
|
| Wisps that depend on an abandoned wisp are deleted with it, closed ones
| included even without --all, but only if they too haven't been updated in
| --age duration and are not live work. A dependent that is too young is
| spared and loses its edge to the deleted wisp: an open one is collected once
| it ages out, a closed one only by --all, --closed or 'bd purge'.
|
| Abandoned wisps are deleted without creating a digest. Use 'bd mol squash'
| if you want to preserve a summary before garbage collection.
|
| Use --closed to purge ALL closed wisps (regardless of age). This is the
| fastest way to reclaim space from accumulated wisp bloat. Safe by default:
| requires --force to actually delete.
|
| Note: This uses time-based cleanup, appropriate for ephemeral wisps.
| For graph-pressure staleness detection (blocking other work), see 'bd mol stale'.
|
| Examples:
| bd mol wisp gc # Clean abandoned wisps (default: 1h threshold)
| bd mol wisp gc --dry-run # Preview what would be cleaned
| bd mol wisp gc --age 24h # Custom age threshold
| bd mol wisp gc --all # Also clean closed wisps older than threshold
| bd mol wisp gc --closed # Preview closed wisp deletion
| bd mol wisp gc --closed --force # Delete all closed wisps
| bd mol wisp gc --closed --dry-run # Explicit dry-run (same as no --force)
| bd mol wisp gc --exclude-type agent,rig # Protect agent and rig wisps from GC
| bd mol wisp gc --closed --force --exclude-type mol # Delete closed wisps except mol type
flag --age type=string default="1h" usage="Age threshold for abandoned wisp detection"
flag --all type=bool default="false" usage="Also clean closed wisps older than threshold"
flag --closed type=bool default="false" usage="Delete all closed wisps (ignores --age threshold)"
flag --dry-run type=bool default="false" usage="Preview what would be cleaned"
flag --exclude-type type=stringSlice default="[]" usage="Exclude wisps of these types from GC (comma-separated, e.g., agent,rig)"
flag --force -f type=bool default="false" usage="Actually delete (default: preview only)"
bd mol wisp list
use: "list"
short: "List all wisps in current context"
hidden: false
runnable: true
long:
| List all wisps (ephemeral molecules) in the current context.
|
| Wisps are issues with Ephemeral=true in the main database. They are stored
| locally but not synced via git.
|
| The list shows:
| - ID: Issue ID of the wisp
| - Title: Wisp title
| - Status: Current status (open, in_progress, closed)
| - Started: When the wisp was created
| - Updated: Last modification time
|
| Old wisp detection:
| - Old wisps haven't been updated in 24+ hours
| - Use 'bd mol wisp gc' to clean up old/abandoned wisps
|
| Examples:
| bd mol wisp list # List all wisps
| bd mol wisp list --json # JSON output for programmatic use
| bd mol wisp list --all # Include closed wisps
flag --all type=bool default="false" usage="Include closed wisps"
flag --type type=string default="" usage="Filter by issue type (e.g., agent, task, patrol)"
bd note
use: "note <id> [text...]"
short: "Append a note to an issue"
group: "issues"
hidden: false
runnable: true
long:
| Append a note to an issue's notes field.
|
| Shorthand for 'bd update <id> --append-notes "text"'.
|
| Examples:
| bd note gt-abc "Fixed the flaky test"
| bd note gt-abc Fixed the flaky test
| echo "note from pipe" | bd note gt-abc --stdin
| bd note gt-abc --file notes.txt
|
| Note: "note" has NO subcommands — it only appends.
| To read notes on an issue, use: bd show <id>
flag --file type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin file"]} usage="Read note text from file"
flag --stdin type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["stdin file"]} usage="Read note text from stdin"
bd notion
use: "notion"
short: "Notion integration commands"
hidden: false
runnable: false
long:
| Commands for syncing issues between beads and Notion.
bd notion connect
use: "connect"
short: "Connect bd to an existing Notion database or data source"
hidden: false
runnable: true
flag --url type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Existing Notion database or data source URL"
bd notion init
use: "init"
short: "Create a dedicated Beads database in Notion"
hidden: false
runnable: true
flag --parent type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Parent page ID"
flag --title type=string default="Beads Issues" usage="Database title"
bd notion pull
use: "pull [refs...]"
short: "Pull specific items from Notion"
hidden: false
runnable: true
long:
| Pull one or more items from Notion.
|
| Accepts bead IDs or external references as positional arguments.
| Equivalent to: bd notion sync --pull --issues <refs>
flag --dry-run type=bool default="false" usage="Preview pull without making changes"
bd notion push
use: "push [bead-ids...]"
short: "Push specific beads to Notion"
hidden: false
runnable: true
long:
| Push one or more beads issues to Notion.
|
| Accepts bead IDs as positional arguments.
| Equivalent to: bd notion sync --push --issues <ids>
flag --dry-run type=bool default="false" usage="Preview push without making changes"
bd notion status
use: "status"
short: "Show Notion sync status"
hidden: false
runnable: true
bd notion sync
use: "sync"
short: "Sync issues with Notion"
hidden: false
runnable: true
long:
| Synchronize issues between beads and Notion.
|
| By default this performs bidirectional sync. Use --pull or --push to limit direction.
flag --create-only type=bool default="false" usage="Only create missing remote pages, do not update existing ones"
flag --dry-run type=bool default="false" usage="Preview changes without making mutations"
flag --issues type=string default="" usage="Comma-separated bead IDs to sync selectively (e.g., bd-abc,bd-def). Mutually exclusive with --parent."
flag --parent type=string default="" usage="Limit push to this bead and its descendants (push only). Mutually exclusive with --issues."
flag --prefer-local type=bool default="false" usage="On conflict, keep the local beads version"
flag --prefer-notion type=bool default="false" usage="On conflict, use the Notion version"
flag --pull type=bool default="false" usage="Only pull issues from Notion"
flag --push type=bool default="false" usage="Only push issues to Notion"
flag --state type=string default="all" usage="Issue state to sync: open, closed, or all"
bd onboard
use: "onboard"
short: "Display minimal snippet for agent instructions file"
group: "setup"
hidden: false
runnable: true
long:
| Display a minimal snippet to add to your agent instructions file for bd integration.
|
| By default, the agent instructions file is AGENTS.md. Use 'bd init --agents-file'
| to configure a different filename (e.g. BEADS.md).
|
| This outputs a small (~10 line) snippet that points to 'bd prime' for full
| workflow context. This is the same minimal profile that 'bd init' generates
| by default. This approach:
|
| • Keeps your agent file lean (doesn't bloat with instructions)
| • bd prime provides dynamic, always-current workflow details
| • Hooks auto-inject bd prime at session start
|
| For agents or environments that do not auto-inject hook output, use
| 'bd init --agents-profile=full' to embed the complete command reference.
bd orphans
use: "orphans"
short: "Identify orphaned issues (referenced in commits but still open)"
hidden: false
runnable: true
long:
| Identify orphaned issues - issues that are referenced in commit messages but remain open or in_progress in the database.
|
| This helps identify work that has been implemented but not formally closed.
|
| Examples:
| bd orphans # Show orphaned issues
| bd orphans --json # Machine-readable output
| bd orphans --details # Show full commit information
| bd orphans --fix # Close orphaned issues with confirmation
| bd orphans --label theme:personal # Only orphans with this label
| bd orphans --label-any theme:personal,theme:ventures # Orphans with either label
flag --details type=bool default="false" usage="Show full commit information"
flag --fix -f type=bool default="false" usage="Close orphaned issues with confirmation"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE). Can combine with --label"
bd ping
use: "ping"
short: "Check database connectivity"
group: "maint"
hidden: false
runnable: true
long:
| Lightweight health check that confirms bd can reach its database.
|
| Steps:
| 1. Resolve the .beads workspace
| 2. Open the store (embedded or server)
| 3. Run a trivial query (one issue row; a remote backend reads its
| authenticated server context instead)
| 4. Report timing
|
| Exit 0 on success, exit 1 on failure.
|
| Examples:
| bd ping # Quick connectivity check
| bd ping --json # Structured output for automation
bd preflight
use: "preflight"
short: "Show PR readiness checklist"
group: "maint"
hidden: false
runnable: true
long:
| Display a checklist of common pre-PR checks for contributors.
|
| This command helps catch common issues before pushing to CI:
| - Tests not run locally
| - Lint errors
| - Unformatted Go files
| - .beads/issues.jsonl pollution
| - Stale nix vendorHash
| - Version mismatches
|
| Examples:
| bd preflight # Show checklist
| bd preflight --check # Run checks automatically
| bd preflight --check --json # JSON output for programmatic use
| bd preflight --check --skip-lint # Explicitly skip lint check
|
flag --check type=bool default="false" usage="Run checks automatically"
flag --fix type=bool default="false" usage="Auto-fix issues where possible (vendorHash)"
flag --skip-lint type=bool default="false" usage="Skip lint check explicitly"
bd prime
use: "prime"
short: "Output AI-optimized workflow context"
group: "setup"
hidden: false
runnable: true
long:
| Output essential Beads workflow context in AI-optimized markdown format.
|
| Automatically detects if MCP server is active and adapts output:
| - MCP mode: Brief workflow reminders (~50 tokens)
| - CLI mode: Full command reference (~1-2k tokens)
|
| Designed for Claude Code, Gemini CLI, and Codex SessionStart hooks to prevent
| agents from forgetting bd workflow after context compaction.
|
| Config options:
| - no-git-ops: When true, outputs stealth mode (no git commands in session close protocol).
| Set via: bd config set no-git-ops true
| Useful when you want to control when commits happen manually.
| - agent.profile: Explicit policy profile for git/commit authority wording
| (conservative | minimal | team-maintainer; default conservative).
| Set via: bd config set agent.profile team-maintainer
| Or per-session: BD_AGENT_PROFILE=team-maintainer (env var takes precedence).
| See docs/getting-started/ide-setup.md#policy-profiles for what each profile means.
| - prime.disabled: When true, bd prime prints nothing, as it does outside a
| workspace (an empty envelope under --hook-json), whatever its other flags.
| For sessions whose host briefs the agent itself but that inherit a
| project's bd prime hook, such as an orchestrator's agent sessions.
| Set per-session: BD_PRIME_DISABLED=true. Or: bd config set prime.disabled true
|
| Workflow customization:
| - Place a PRIME.md file to override the default workflow text. Checked in this
| order, once bd resolves a workspace (outside one, prime emits no content):
| (1) .beads/PRIME.md relative to the current directory (the -C target
| when -C is set);
| (2) PRIME.md in the .beads directory bd resolves for this workspace
| (honors $BEADS_DIR, which -C overrides; a redirected .beads is
| followed);
| (3) the global PRIME.md in bd's user config dir:
| ~/.config/beads/ on Linux ($XDG_CONFIG_HOME/beads/ if set),
| ~/Library/Application Support/beads/ on macOS,
| %AppData%\beads\ on Windows.
| - Persistent memories (from bd remember) are still appended so memory
| injection keeps working under a custom template.
| - Use --export to dump the default content for customization.
| - Use --memories-only for hook contexts that should inject only persistent memories; this returns only the memories section even when a custom PRIME.md is present.
| - Use --no-memories to omit the persistent memories section (useful when the memories section is large and would dominate a context budget). --memories-only takes precedence if both are set.
|
| Memory injection caps:
| Large memory sets can exceed what a session-start hook host will ingest,
| and hosts truncate silently. Cap what prime injects with --max-memories N
| and/or --max-memory-chars N (or the prime.max-memories /
| prime.max-memory-chars config keys; an explicit flag wins, and an explicit
| 0 forces unlimited). Caps apply at whole-memory boundaries, at least one
| memory is always emitted, and a banner ahead of the entries reports how
| many were elided and how to browse the rest with bd memories.
| --max-memory-chars caps the total bytes of the injected memory entries;
| the section header and elision banner are excluded from the budget.
flag --export type=bool default="false" usage="Output default content (ignores PRIME.md override)"
flag --full type=bool default="false" usage="Force full CLI output (ignore MCP detection)"
flag --hook-json type=bool default="false" usage="Wrap output in the SessionStart hook JSON envelope (Claude Code, Gemini CLI, Codex)"
flag --max-memories type=int default="0" usage="Cap injected persistent memories to N entries (0 = unlimited; falls back to the prime.max-memories config key)"
flag --max-memory-chars type=int default="0" usage="Cap the total bytes of injected memory entries, at whole-memory boundaries; section header and banner are not counted (0 = unlimited; falls back to the prime.max-memory-chars config key)"
flag --mcp type=bool default="false" usage="Force MCP mode (minimal output)"
flag --memories-only type=bool default="false" usage="Output only persistent memories for compact hook contexts"
flag --no-memories type=bool default="false" usage="Omit the persistent memories section (ignored when --memories-only is set, which wins)"
flag --stealth type=bool default="false" usage="Stealth mode (no git operations, flush only)"
bd priority
use: "priority <id> <n>"
short: "Set the priority of an issue"
group: "issues"
hidden: false
runnable: true
long:
| Set the priority of an issue.
|
| Shorthand for 'bd update <id> --priority <n>'.
|
| Priority levels:
| 0 - Critical (security, data loss, broken builds)
| 1 - High (major features, important bugs)
| 2 - Medium (default)
| 3 - Low (polish, optimization)
| 4 - Backlog (future ideas)
|
| Examples:
| bd priority bd-123 0 # Critical
| bd priority bd-123 2 # Medium
bd promote
use: "promote <wisp-id>"
short: "Promote a wisp to a permanent bead"
group: "issues"
hidden: false
runnable: true
long:
| Promote a wisp (ephemeral issue) to a permanent bead.
|
| This copies the issue from the wisps table (dolt_ignored) to the permanent
| issues table (Dolt-versioned), preserving labels, dependencies, events, and
| comments. The original ID is preserved so all links keep working.
|
| A comment is added recording the promotion and optional reason.
|
| Examples:
| bd promote bd-wisp-abc123
| bd promote bd-wisp-abc123 --reason "Worth tracking long-term"
flag --reason -r type=string default="" usage="Reason for promotion"
bd provenance
use: "provenance"
short: "Append-only provenance event log"
group: "issues"
hidden: false
runnable: false
long:
| Record and read provenance events: typed bindings from an issue to an
| opaque external artifact (a git SHA, PR, work-id, transcript, or branch).
|
| The log is append-only — there is no update or delete. bd never interprets the
| actor or ref; only kind and ref-kind are structurally validated. Recording is
| idempotent on a deterministic id, so a producer firing twice is harmless.
bd provenance by-ref
use: "by-ref <ref>"
short: "List provenance events bound to a ref"
hidden: false
runnable: true
bd provenance log
use: "log <issue-id>"
short: "List provenance events for an issue"
hidden: false
runnable: true
flag --kind type=string default="" usage="filter by kind (optional)"
bd provenance record
use: "record --issue <id> --kind <k> --source <s>"
short: "Record a provenance event (idempotent)"
hidden: false
runnable: true
long:
| Record a provenance event. The event is appended idempotently: a
| deterministic id is computed from source:issue:kind:(ref or --at), so re-running
| the same record is a no-op.
|
| An event recorded without --ref requires --at so the id is caller-owned.
flag --actor type=string default="" usage="opaque actor identifier (optional)"
flag --at type=string default="" usage="event-time as RFC3339 (required for ref-less kinds)"
flag --issue type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="issue id (required)"
flag --kind type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="event kind: cut|claim|suspend|resume|handoff|commit|land|used (required)"
flag --payload type=string default="" usage="opaque payload, e.g. JSON (optional)"
flag --ref type=string default="" usage="opaque external reference, e.g. a SHA or PR url (optional)"
flag --ref-kind type=string default="" usage="ref kind: git-sha|pr|work-id|transcript|branch (optional)"
flag --source type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="producer of the event, e.g. git-hook, orchestrator (required)"
bd prune
use: "prune"
short: "Delete old closed beads to reclaim space and shrink exports"
group: "maint"
hidden: false
runnable: true
long:
| Permanently delete closed non-ephemeral beads and their associated data.
|
| Use this to trim closed regular beads (tasks, features, bugs, chores, etc.)
| that are no longer useful. The common case is a long-lived repo where
| closed work has piled up and is bloating auto-export or slowing queries.
|
| Requires --older-than or --pattern. The flag is a safety gate — without
| it, a muscle-memory `--force` could wipe every closed bead in the repo.
| Use `--pattern '*'` if you really do want to sweep everything closed.
|
| Deletes: issues, dependencies, labels, events, and comments for matching beads.
| Skips: pinned beads (protected), open/in-progress beads, and ephemeral beads.
|
| Also skips closed beads whose ID appears in the description, notes, or
| comments of any open / in-progress bead. This protects ADR / decision /
| verification trails that downstream beads still cite. Use
| --ignore-references to override (e.g., when bulk-decommissioning a
| retired label across the rig).
|
| To delete closed ephemeral beads (wisps, transient molecules) use
| `bd purge` instead.
|
| For full Dolt storage reclaim after deleting many rows, follow with `bd flatten`
| so history can be collapsed and old chunks can be garbage-collected.
|
| EXAMPLES:
| bd prune --older-than 30d # Preview closed beads >30d old
| bd prune --older-than 30d --force # Delete them
| bd prune --older-than 90d --dry-run # Detailed preview with stats
| bd prune --pattern "*" --force # Delete all closed regular beads
| bd prune --pattern "gm-temp-*" --force # Scope to a pattern
flag --dry-run type=bool default="false" usage="Preview what would be pruned with stats"
flag --force -f type=bool default="false" usage="Actually prune (without this, shows preview)"
flag --ignore-references type=bool default="false" usage="Delete closed beads even when referenced by open beads (use with care; see --help for details)"
flag --older-than type=string default="" usage="Only prune beads closed more than N ago (e.g., 30d, 2w, 60, 36h)"
flag --pattern type=string default="" usage="Only prune beads matching ID glob pattern (e.g., 'gm-old-*')"
bd purge
use: "purge"
short: "Delete closed ephemeral beads to reclaim space"
group: "maint"
hidden: false
runnable: true
long:
| Permanently delete closed ephemeral beads and their associated data.
|
| Closed ephemeral beads (wisps, transient molecules) accumulate rapidly and
| have no value once closed. This command removes them to reclaim storage.
|
| Deletes: issues, dependencies, labels, events, and comments for matching beads.
| Skips: pinned beads, and closed beads a live bead still depends on through a
| parent-child, tracks or blocks edge (a closed molecule root whose step is open,
| a closed bead a live convoy tracks). Live means any status that is not done.
|
| --wisps-plane selects by storage plane instead: every closed row stored in the
| wisps table, including --no-history beads, which the default ephemeral
| selection leaves to `bd prune`. It reaches durable-tier rows, so it requires
| --older-than or --pattern, like `bd prune`.
|
| --limit N caps one run at N beads, oldest-closed first, so a large backlog can
| be drained in bounded transactions; --json then reports "remaining" and
| "has_more". Loop while has_more is true.
|
| --older-than takes days (7, 7d), weeks (2w) or a duration with hour precision
| (36h, 168h, 90m).
|
| To delete closed non-ephemeral beads (regular tasks, features, bugs, etc.)
| use `bd prune` instead.
|
| For full Dolt storage reclaim after deleting many rows, follow with `bd flatten`
| so history can be collapsed and old chunks can be garbage-collected.
|
| EXAMPLES:
| bd purge # Preview what would be purged
| bd purge --force # Delete all closed ephemeral beads
| bd purge --older-than 7d --force # Only purge items closed 7+ days ago
| bd purge --pattern "*-wisp-*" # Only purge matching ID pattern
| bd purge --older-than 36h --force # Hour precision: closed 36+ hours ago
| bd purge --wisps-plane --older-than 168h --force
| # Every closed wisps-table row, incl. no-history
| bd purge --dry-run # Detailed preview with stats
flag --dry-run type=bool default="false" usage="Preview what would be purged with stats"
flag --force -f type=bool default="false" usage="Actually purge (without this, shows preview)"
flag --limit type=int default="0" usage="Purge at most N beads this run, oldest-closed first (0 = no limit); --json reports remaining/has_more"
flag --older-than type=string default="" usage="Only purge beads closed more than N ago (e.g., 7d, 2w, 30, 36h)"
flag --pattern type=string default="" usage="Only purge beads matching ID glob pattern (e.g., *-wisp-*)"
flag --wisps-plane type=bool default="false" usage="Select every closed row in the wisps table, including --no-history beads (requires --older-than or --pattern)"
bd q
use: "q [title]"
short: "Quick capture: create issue and output only ID"
group: "issues"
hidden: false
runnable: true
long:
| Quick capture creates an issue and outputs only the issue ID.
| Designed for scripting and AI agent integration.
|
| Example:
| bd q "Fix login bug" # Outputs: bd-a1b2
| ISSUE=$(bd q "New feature") # Capture ID in variable
| bd q "Task" | xargs bd show # Pipe to other commands
| bd q "Subtask" --parent=bd-a1b2 # Hierarchical child (outputs: bd-a1b2.1)
flag --labels -l type=stringSlice default="[]" usage="Labels"
flag --parent type=string default="" usage="Parent issue ID for hierarchical child (e.g., 'bd-a3f8e9')"
flag --priority -p type=string default="2" usage="Priority (0-4 or P0-P4)"
flag --type -t type=string default="task" usage="Issue type"
bd query
use: "query [expression]"
short: "Query issues using a simple query language"
group: "issues"
hidden: false
runnable: true
long:
| Query issues using a simple query language that supports compound filters,
| boolean operators, and date-relative expressions.
|
| The query language enables complex filtering that would otherwise require
| multiple flags or piping through jq.
|
| Syntax:
| field=value Equality comparison
| field!=value Inequality comparison
| field>value Greater than
| field>=value Greater than or equal
| field<value Less than
| field<=value Less than or equal
|
| Boolean operators (case-insensitive):
| expr AND expr Both conditions must match
| expr OR expr Either condition can match
| NOT expr Negates the condition
| (expr) Grouping with parentheses
|
| Supported fields:
| status Stored status (open, in_progress, blocked, deferred, closed). Note: dependency-blocked issues stay "open"; use 'bd blocked' to find them
| priority Priority level (0-4)
| type Issue type (bug, feature, task, epic, chore, decision)
| assignee Assigned user (use "none" for unassigned)
| owner Issue owner
| label Issue label (use "none" for unlabeled)
| title Search in title (contains)
| description Search in description (contains, "none" for empty)
| notes Search in notes (contains)
| created Creation date/time
| updated Last update date/time
| started Date/time issue first transitioned to in_progress
| closed Close date/time
| id Issue ID (supports wildcards: bd-*)
| spec Spec ID (supports wildcards)
| pinned Boolean (true/false)
| ephemeral Boolean (true/false)
| template Boolean (true/false)
| parent Parent issue ID
| mol_type Molecule type (swarm, patrol, work)
|
| Date values:
| Relative durations: 30min (30 minutes ago), 24h (24 hours ago),
| 7d (7 days ago), 2w (2 weeks ago),
| 6m (6 months ago), 1y (1 year ago)
| Absolute dates: 2025-01-15, 2025-01-15T10:00:00Z
| Natural language: tomorrow, "next monday", "in 3 days"
|
| Examples:
| bd query "status=open AND priority>1"
| bd query "status=open AND priority<=2 AND updated>7d"
| bd query "(status=open OR status=blocked) AND priority<2"
| bd query "type=bug AND label=urgent"
| bd query "NOT status=closed"
| bd query "assignee=none AND type=task"
| bd query "created>30d AND status!=closed"
| bd query "label=frontend OR label=backend"
| bd query "title=authentication AND priority=0"
flag --all -a type=bool default="false" usage="Include closed issues (default: exclude closed)"
flag --limit -n type=int default="50" usage="Limit results (default: 50, 0 = unlimited)"
flag --long type=bool default="false" usage="Show detailed multi-line output for each issue"
flag --offset type=int default="0" usage="Skip the first N matching results (0-based). Only supported under --proxied-server."
flag --parse-only type=bool default="false" usage="Only parse the query and show the AST (for debugging)"
flag --reverse -r type=bool default="false" usage="Invert the sort field's default direction (created/updated/closed default to newest-first, so --sort updated --reverse is oldest-first)"
flag --sort type=string default="" usage="Sort by field: priority, created, updated, closed, status, id, title, type, assignee"
bd quickstart
use: "quickstart"
short: "Quick start guide for bd"
group: "setup"
hidden: false
runnable: true
long:
| Display a quick start guide showing common bd workflows and patterns.
bd ready
use: "ready"
short: "Show ready work (open, no active blockers)"
hidden: false
runnable: true
long:
| Show ready work (open issues with no active blockers).
|
| Excludes in_progress, blocked, deferred, and hooked issues. This uses the
| GetReadyWork API which applies blocker-aware semantics to find truly claimable work.
|
| Note: 'bd list --ready' uses the same blocker-aware ready-work semantics.
|
| Use --mol to filter to a specific molecule's steps:
| bd ready --mol bd-patrol # Show ready steps within molecule
|
| Use --gated to find molecules ready for gate-resume dispatch:
| bd ready --gated # Find molecules where a gate closed
|
| Use --claim to atomically claim the first ready issue matching the filters:
| bd ready --claim --json
|
| This is useful for agents executing molecules to see which steps can run next.
flag --assignee -a type=string default="" usage="Filter by assignee"
flag --brief type=bool default="false" usage="Omit the free-form text (description, design, acceptance criteria, notes, payload, waiters) from each row. Filters that read those fields still select on them. An omitted field is indistinguishable from an empty one; fetch a whole issue with bd show. Requires --json, and cannot be combined with --claim, --gated, --mol or --explain."
flag --claim type=bool default="false" usage="Atomically claim the first ready issue matching the filters"
flag --exclude-label type=stringSlice default="[]" usage="Exclude issues that have ANY of these labels"
flag --exclude-type type=stringSlice default="[]" usage="Exclude issue types from results (comma-separated or repeatable, e.g., --exclude-type=convoy,epic)"
flag --explain type=bool default="false" usage="Show dependency-aware reasoning for why issues are ready or blocked"
flag --flat type=bool default="false" usage="Alias for --plain, spelled the way bd list spells it"
flag --gated type=bool default="false" usage="Find molecules ready for gate-resume dispatch"
flag --has-metadata-key type=string default="" usage="Filter issues that have this metadata key set"
flag --include-deferred type=bool default="false" usage="Include issues with future defer_until timestamps"
flag --include-ephemeral type=bool default="false" usage="Include ephemeral issues (wisps) in results"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE). Can combine with --label"
flag --label-pattern type=string default="" usage="Filter by label glob pattern (e.g., 'tech-*' matches tech-debt, tech-legacy)"
flag --label-regex type=string default="" usage="Filter by label regex pattern (e.g., 'tech-(debt|legacy)')"
flag --limit -n type=int default="100" usage="Maximum issues to show (use 0 for unlimited)"
flag --max-rows type=int default="0" usage="Hard upper bound on rows fetched from storage. Returns a non-zero exit (code 2) and an error to stderr if exceeded. 0 disables (the default). Overrides BEADS_MAX_ROWS for this invocation. Useful in CI/agent rigs that want a circuit breaker against pathological queries. Not supported under --proxied-server: an explicit --max-rows or BEADS_MAX_ROWS cap errors out rather than silently going unenforced."
flag --metadata-field type=stringArray default="[]" usage="Filter by metadata field (key=value, repeatable)"
flag --mol type=string default="" usage="Filter to steps within a specific molecule"
flag --mol-type type=string default="" usage="Filter by molecule type: swarm, patrol, or work"
flag --offset type=int default="0" usage="Skip the first N matching results (0-based). Only supported under --proxied-server."
flag --parent type=string default="" usage="Filter to descendants of this bead/epic"
flag --plain type=bool default="false" usage="Display issues as a plain numbered list"
flag --pretty type=bool default="true" usage="Display issues in a tree format with status/priority symbols"
flag --priority -p type=int default="0" usage="Filter by priority"
flag --sort -s type=string default="priority" usage="Sort policy: priority (default), hybrid, oldest"
flag --type -t type=string default="" usage="Filter by issue type (task, bug, feature, epic, decision, merge-request). Aliases: mr→merge-request, feat→feature, mol→molecule, dec/adr→decision"
flag --unassigned -u type=bool default="false" usage="Show only unassigned issues"
bd recall
use: "recall <key>"
short: "Retrieve a specific memory"
group: "setup"
hidden: false
runnable: true
long:
| Retrieve the full content of a memory by its key.
|
| Examples:
| bd recall dolt-phantoms
| bd recall auth-jwt
bd reclaim
use: "reclaim"
short: "Revert stale-lease in_progress issues back to ready (dead-worker recovery)"
group: "issues"
hidden: false
runnable: true
long:
| Revert in_progress issues whose lease has gone stale back to ready.
|
| When a worker claims an issue it takes a lease that expires after a TTL, kept
| alive by 'bd heartbeat'. A worker that dies stops heartbeating, so its lease
| expires and its issue would otherwise stay in_progress forever. reclaim is the
| reaper: it finds in_progress issues whose lease expired more than --older-than
| ago, clears the assignee, and sets them back to open so another worker can
| claim them. The previous owner's stale lease is recorded as a recovery event.
|
| --older-than is a grace window past lease expiry: only leases that expired at
| least this long ago are reclaimed, so a worker briefly paused (GC, clock skew)
| is not robbed of live work. Run it from a supervisor on a timer with a window
| of roughly 2× the claim TTL.
|
| By default reclaim covers every stale lease THIS replica granted. The scope
| filters below narrow it further, using the same label surface claiming is
| scoped by (--label / --label-any / --exclude-label), plus --assignee and --id.
| Filters AND-combine and never widen the set: a reclaimed lease must still be
| stale.
|
| Replicas and leases (federated deployments)
| -------------------------------------------
| A lease is only meaningful on the replica that granted it. Every other
| replica's view of the holder's liveness is stale by up to one sync interval,
| so a reaper elsewhere can revert a unit that is very much alive over there.
| reclaim therefore records the granting replica on each lease and SKIPS a lease
| another replica granted, summarizing what it declined on stderr (one line per
| run; 'bd -v' expands it to the first 20 leases individually). Reap it where it
| was granted; use --any-replica only when that replica is permanently gone (or
| when this node was renamed and its own old leases now look foreign — an
| ordinary heartbeat keeps a lease alive but does not re-home it to the node
| heartbeating it). Prefer the narrow form '--any-replica --id <id>': bare
| --any-replica reverts EVERY foreign stale lease, live peers included.
|
| Two invariants the guard cannot enforce for you:
|
| grace window > sync interval, and lease TTL > sync interval.
|
| A TTL or grace shorter than the cadence at which replicas exchange state is
| meaningless across the bridge — the remote view is a full interval old by
| construction. Raise the TTL/grace above the sync interval, never the reverse.
| The guard is opt-in: set BEADS_NODE_ID, or run 'bd config set node_id <name>'
| (which writes the per-machine ~/.config/bd/config.yaml — never commit a node_id
| to the git-tracked .beads/config.yaml, or every clone reads the same name and
| the guard goes armed-but-inert). One id per STORE, not per host: machines that
| are clients of the same dolt sql-server are ONE replica and must share one value
| or leave it unset. There is no hostname fallback — the hostname names the client
| process's machine, not the store — so an unnamed deployment keeps the old,
| unguarded behavior instead of stranding its own work.
|
| Examples:
| bd reclaim # default grace window (2× the lease TTL)
| bd reclaim --older-than 10m # reclaim leases expired >10m ago
| bd reclaim --older-than 0s # reclaim every currently-expired lease
| bd reclaim --label lane-a # only this machine's claim partition
| bd reclaim --label-any lane-a,lane-b --exclude-label pinned
| bd reclaim --assignee zelda --assignee epona # only these workers' leases
| bd reclaim --id wy-abc --id wy-def # exactly these issues
| bd reclaim --any-replica # also reap leases granted by a departed replica
flag --any-replica type=bool default="false" usage="Also reclaim leases granted by ANOTHER replica (unsafe unless that replica is gone; see 'Replicas and leases')"
flag --assignee -a type=stringSlice default="[]" usage="Only reclaim leases held by these assignees (repeatable)"
flag --exclude-label type=stringSlice default="[]" usage="Never reclaim issues carrying ANY of these labels"
flag --id type=stringSlice default="[]" usage="Only reclaim these issue IDs (repeatable)"
flag --label -l type=stringSlice default="[]" usage="Only reclaim issues with ALL these labels (AND). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Only reclaim issues with AT LEAST ONE of these labels (OR). Can combine with --label"
flag --older-than type=duration default="10m0s" usage="Only reclaim leases that expired at least this long ago (grace window)"
bd recompute-blocked
use: "recompute-blocked"
short: "Recompute is_blocked for all issues (repairs stale flags after a pull)"
group: "maint"
hidden: false
runnable: true
long:
| Recompute the denormalized is_blocked flag for every issue and wisp.
|
| is_blocked is derived from the dependency graph and maintained automatically by
| local writes and by a post-pull recompute scoped to what the merge changed. If
| that scoped recompute is skipped — a recompute that failed after its merge
| committed, or a conflicted pull resolved by hand — the flag can go stale, and a
| later pull that merges nothing will not refresh it (bd-6dnrw.37). 'bd ready'
| trusts the flag, so stale values silently hide ready work or surface blocked
| work.
|
| This command runs the full recompute unconditionally and commits the result.
| It is idempotent: on a consistent database it changes nothing. Works in every
| storage mode — embedded, server, and proxied-server (unlike 'bd doctor', which
| is server-mode only).
|
| On a workspace connected to a bd serve backend ('bd connect') it is a no-op
| that exits 0: the server maintains is_blocked on every write, and the column
| lives in the server's database, so the repair is run there, by the server's
| operator. --json then reports {"rows_corrected": 0, "maintained_by": "server"}.
|
| Examples:
| bd recompute-blocked # Repair stale is_blocked flags
| bd recompute-blocked --json # Machine-parseable {"rows_corrected": N}
bd remember
use: "remember \"<insight>\""
short: "Store a persistent memory"
group: "setup"
hidden: false
runnable: true
long:
| Store a memory that persists across sessions and account rotations.
|
| Memories are injected at prime time (bd prime) so you have them
| in every session without manual loading.
|
| The positional arg is the memory CONTENT (the key is auto-generated from it
| unless --key is given). As a convenience, if the arg is a bare key naming an
| existing memory, it is RECALLED instead of stored (same as 'bd recall');
| a bare key naming nothing is refused. Use --key to store slug-like content.
|
| Corpus budget (opt-in, off by default): set the memories.budget-chars config
| key to a byte ceiling for the whole memory corpus (sum of len(key)+len(content)).
| A write that would cross it is refused, and --force overrides; a write that
| lands at or above 80% of the budget warns. With the key unset nothing changes.
| bd prime's --max-memory-chars also counts bytes, but of each memory as
| injected, formatting included, so a budget equal to that cap does not
| guarantee prime injects every memory; set the budget below it for that.
|
| Examples:
| bd remember "always run tests with -race flag"
| bd remember "Dolt phantom DBs hide in three places" --key dolt-phantoms
| bd remember "auth module uses JWT not sessions" --key auth-jwt
| bd remember dolt-phantoms # bare existing key: reads it (= bd recall)
flag --force type=bool default="false" usage="Store even when the write would cross the memories.budget-chars corpus budget (no effect when the budget is unset)"
flag --key type=string default="" usage="Explicit key for the memory (auto-generated from content if not set). If a memory with this key already exists, it will be updated in place"
bd rename
use: "rename <old-id> <new-id>"
short: "Rename an issue ID"
hidden: false
runnable: true
long:
| Rename an issue from one ID to another.
|
| This updates:
| - The issue's primary ID
| - All references in other issues (descriptions, titles, notes, etc.)
| - Dependencies pointing to/from this issue
| - Labels, comments, and events
|
| Examples:
| bd rename bd-w382l bd-dolt # Rename to memorable ID
| bd rename gt-abc123 gt-auth # Use descriptive ID
|
| Note: The new ID must use a valid prefix for this database.
bd rename-prefix
use: "rename-prefix <new-prefix>"
short: "Rename the issue prefix for all issues in the database"
group: "maint"
hidden: false
runnable: true
long:
| Rename the issue prefix for all issues in the database.
| This will update all issue IDs and all text references across all fields.
|
| USE CASES:
| - Shortening long prefixes (e.g., 'knowledge-work-' → 'kw-')
| - Rebranding project naming conventions
| - Consolidating multiple prefixes after database corruption
| - Migrating to team naming standards
|
| Prefix validation rules:
| - Allowed characters: lowercase letters, numbers, hyphens
| - Must start with a letter
| - Must end with a hyphen (e.g., 'kw-', 'work-')
| - Cannot be empty or just a hyphen
|
| Multiple prefix detection and repair:
| If issues have multiple prefixes (corrupted database), use --repair to consolidate them.
| The --repair flag will rename all issues with incorrect prefixes to the new prefix,
| preserving issues that already have the correct prefix.
|
| EXAMPLES:
| bd rename-prefix kw- # Rename from 'knowledge-work-' to 'kw-'
| bd rename-prefix mtg- --repair # Consolidate multiple prefixes into 'mtg-'
| bd rename-prefix team- --dry-run # Preview changes without applying
|
| NOTE: This is a rare operation. Most users never need this command.
flag --dry-run type=bool default="false" usage="Preview changes without applying them"
flag --repair type=bool default="false" usage="Repair database with multiple prefixes by consolidating them"
bd reopen
use: "reopen [id...]"
short: "Reopen one or more closed issues"
group: "issues"
hidden: false
runnable: true
long:
| Reopen closed issues by setting status to 'open' and clearing the closed_at timestamp.
| This is more explicit than 'bd update --status open' and emits a Reopened event.
|
| Exit codes: 1 for general failures; 13 when the failure is a stale
| --if-revision guard (the precondition no longer held, nothing was written —
| another actor won the race, so retrying the same guard is pointless).
flag --if-revision type=string default="" usage="Apply the write only if the issue's current revision equals this value (the decimal int64 from `bd show --json`'s \"revision\" field). One id only: refused before any write when combined with more than one issue id. A mismatch writes nothing and exits 13 (vs 1 for other failures)."
flag --reason -r type=string default="" usage="Reason for reopening"
bd repo
use: "repo"
short: "Manage multiple repository configuration"
group: "advanced"
hidden: false
runnable: false
long:
| Configure and manage multiple repository support for multi-repo hydration.
|
| Multi-repo support allows hydrating issues from multiple beads repositories
| into a single database for unified cross-repo issue tracking.
|
| Configuration is stored in .beads/config.yaml under the 'repos' section:
|
| repos:
| primary: "."
| additional:
| - ~/beads-planning
| - ~/work-repo
|
| Examples:
| bd repo add ~/beads-planning # Add planning repo
| bd repo add ../other-repo # Add relative path repo
| bd repo list # Show all configured repos
| bd repo remove ~/beads-planning # Remove by path
| bd repo sync # Sync from all configured repos
bd repo add
use: "add <path>"
short: "Add an additional repository to sync"
hidden: false
runnable: true
long:
| Add a repository path to the repos.additional list in config.yaml.
|
| The path should point to a directory containing a .beads folder.
| Paths can be absolute or relative (they are stored as-is).
|
| This modifies .beads/config.yaml, which is version-controlled and
| shared across all clones of this repository.
bd repo list
use: "list"
short: "List all configured repositories"
hidden: false
runnable: true
long:
| List all repositories configured in .beads/config.yaml.
|
| Shows the primary repository (always ".") and any additional
| repositories configured for hydration.
bd repo remove
use: "remove <path>"
short: "Remove a repository from sync configuration"
hidden: false
runnable: true
long:
| Remove a repository path from the repos.additional list in config.yaml.
|
| The path must exactly match what was added (e.g., if you added "~/foo",
| you must remove "~/foo", not "/home/user/foo").
|
| This command also removes any previously-hydrated issues from the database
| that came from the removed repository.
bd repo sync
use: "sync"
short: "Manually trigger multi-repo sync"
hidden: false
runnable: true
long:
| Synchronize issues from all configured additional repositories.
|
| Reads issues.jsonl from each additional repository and imports them into
| the primary database with their original prefixes and source_repo set.
| Uses mtime caching to skip repos whose JSONL hasn't changed.
|
| Also triggers Dolt push/pull if a remote is configured.
flag --verbose type=bool default="false" usage="Show detailed sync progress"
bd restore
use: "restore <issue-id>"
short: "Restore the pre-compaction content of a compacted issue"
group: "sync"
hidden: false
runnable: true
long:
| Restore the pre-compaction content of a compacted issue.
|
| When an issue is compacted, its description/design/notes/acceptance criteria
| are summarized and the originals are archived to a compaction snapshot. This
| command recovers that original content.
|
| By default it is read-only: it displays the archived content without modifying
| the database. Pass --apply to write the original content back into the issue
| and step its compaction level back down.
|
| If no archived snapshot exists (e.g. the issue was compacted by an older bd
| before snapshot archiving), restore falls back to a best-effort reconstruction
| from Dolt version history, which can only be displayed, not applied.
flag --apply type=bool default="false" usage="Write the restored content back into the issue (default: display only)"
bd rules
use: "rules"
short: "Audit and compact Claude rules"
group: "maint"
hidden: false
runnable: false
bd rules audit
use: "audit"
short: "Scan rules for contradictions and merge opportunities"
hidden: false
runnable: true
flag --path type=string default=".claude/rules/" usage="Path to rules directory"
flag --threshold type=float64 default="0.6" usage="Jaccard similarity threshold"
bd rules compact
use: "compact"
short: "Merge related rules into composites"
hidden: false
runnable: true
flag --auto type=bool default="false" usage="Apply audit suggestions"
flag --dry-run type=bool default="false" usage="Preview without applying"
flag --group type=stringSlice default="[]" usage="Rule names to merge"
flag --path type=string default=".claude/rules/" usage="Path to rules directory"
bd schema
use: "schema"
short: "Print the JSON Schema for bd's --json / export output"
hidden: false
runnable: true
annotations: {bd:skip_store="1"}
long:
| Print the JSON Schema for bd's canonical output record types.
|
| The schema is reflected from the same Go structs bd serializes, so it stays in
| lockstep with the actual --json / export output. Use it to generate typed
| consumer models (datamodel-code-generator, quicktype, ...) rather than
| hand-maintaining them.
|
| bd schema | jq '.types.issue' # the issue record schema
| bd schema | jq '.types.dependency' # the dependency record schema
bd search
use: "search [query]"
short: "Search issues by text query"
group: "issues"
hidden: false
runnable: true
long:
| Search issues across title and ID (all statuses, including closed).
|
| ID-like queries (e.g., "bd-123", "hq-319") use fast exact/prefix matching.
| Text queries search titles. Use --desc-contains for description search.
| Use --status open (etc.) to narrow; closed issues are included by default
| so "was this already filed/fixed?" cannot silently answer no. Matches
| beyond --limit are dropped status-blind, so when hunting live work in a
| large DB, narrow with --status open or raise --limit.
|
| Examples:
| bd search "authentication bug"
| bd search "login" --status open
| bd search "database" --label backend --limit 10
| bd search --query "performance" --assignee alice
| bd search "bd-5q" # Search by partial ID (fast prefix match)
| bd search "security" --priority-min 0 --priority-max 2
| bd search "bug" --created-after 2025-01-01
| bd search "refactor" --status open # Only open issues
| bd search "bug" --sort priority
| bd search "task" --sort created --reverse
| bd search "api" --desc-contains "endpoint"
| bd search "cleanup" --no-assignee --no-labels
flag --assignee -a type=string default="" usage="Filter by assignee"
flag --closed-after type=string default="" usage="Filter issues closed after date (YYYY-MM-DD or RFC3339)"
flag --closed-before type=string default="" usage="Filter issues closed before date (YYYY-MM-DD or RFC3339)"
flag --created-after type=string default="" usage="Filter issues created after date (YYYY-MM-DD or RFC3339)"
flag --created-before type=string default="" usage="Filter issues created before date (YYYY-MM-DD or RFC3339)"
flag --desc-contains type=string default="" usage="Filter by description substring (case-insensitive)"
flag --empty-description type=bool default="false" usage="Filter issues with empty or missing description"
flag --external-contains type=string default="" usage="Filter by external ref substring (case-insensitive)"
flag --has-metadata-key type=string default="" usage="Filter issues that have this metadata key set"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL)"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE)"
flag --limit -n type=int default="50" usage="Limit results (default: 50)"
flag --long type=bool default="false" usage="Show detailed multi-line output for each issue"
flag --metadata-field type=stringArray default="[]" usage="Filter by metadata field (key=value, repeatable)"
flag --no-assignee type=bool default="false" usage="Filter issues with no assignee"
flag --no-labels type=bool default="false" usage="Filter issues with no labels"
flag --notes-contains type=string default="" usage="Filter by notes substring (case-insensitive)"
flag --priority-max type=string default="" usage="Filter by maximum priority (inclusive, 0-4 or P0-P4)"
flag --priority-min type=string default="" usage="Filter by minimum priority (inclusive, 0-4 or P0-P4)"
flag --query type=string default="" usage="Search query (alternative to positional argument)"
flag --reverse -r type=bool default="false" usage="Invert the sort field's default direction (created/updated/closed default to newest-first, so --sort updated --reverse is oldest-first)"
flag --sort type=string default="" usage="Sort by field: priority, created, updated, closed, status, id, title, type, assignee"
flag --status -s type=string default="" usage="Filter by stored status (comma-separated for OR; open, in_progress, blocked, deferred, closed, all). Default searches all statuses including closed. Note: dependency-blocked issues use 'bd blocked'"
flag --type -t type=string default="" usage="Filter by type (bug, feature, task, epic, chore, decision, message, molecule, gate, spike, story, milestone); custom types require types.custom config, and an unknown type is an error. Aliases: feat/enhancement→feature, mol→molecule, dec/adr→decision, mr→merge-request"
flag --updated-after type=string default="" usage="Filter issues updated after date (YYYY-MM-DD or RFC3339)"
flag --updated-before type=string default="" usage="Filter issues updated before date (YYYY-MM-DD or RFC3339)"
bd send-metrics
use: "send-metrics"
short: "Internal: flush queued telemetry events (spawned by bd)"
hidden: true
runnable: true
bd serve
use: "serve"
short: "Serve the beads HTTP API over loopback"
hidden: false
runnable: true
long:
| Serve the beads HTTP API — the same work surface the CLI answers, for
| automation clients that would otherwise fork a bd subprocess per call.
|
| The wire contract is described by an OpenAPI document (/v0); GET
| /v0/beads/context reports which operations this build actually implements.
|
| DEPLOYMENT
|
| Pass an explicit port. The default 127.0.0.1:0 takes an ephemeral one, which
| is right for ad-hoc and test use — where the bound address printed on stdout
| is read immediately — but carries no mutual exclusion: two serves against one
| workspace then run side by side on different ports with no way to enumerate
| them. On a fixed port the second one fails to bind, which is the intended
| behavior. Concurrent serves are data-safe either way; claims are arbitrated
| in the SQL server.
|
| Run it under a supervisor. bd shuts down gracefully on SIGHUP as well as
| SIGINT and SIGTERM, so closing the terminal of a foreground bd serve stops it.
|
| PROBES
|
| GET /healthz is LIVENESS only: it answers from the process and never touches
| the database, so it stays green while the database is unreachable. For
| readiness use GET /v0/beads/ready?limit=1 — a real query, where 200 means
| ready and 503 means live but not ready.
|
| AUTHENTICATION
|
| Optional, and off by default on loopback — where the trust model is the
| loopback boundary itself, the same one the database behind it already relies
| on. --auth-token-file turns it on: every operation except GET /healthz then
| requires an "Authorization: Bearer <token>" header, GET /v0/beads/context
| included, because it reports the repo root, beads directory and database name.
|
| The file holds ONE TOKEN PER LINE and every line is accepted. That is the
| rotation mechanism: write the new token alongside the old, roll the clients
| over, then delete the old line. The file is re-read while the server runs, so
| both the addition and the removal take effect within about a second and
| neither needs a restart. Write it atomically (a temp file plus rename; a
| Kubernetes secret mount already does this).
|
| There is deliberately no --auth-token flag. A credential passed as an
| argument is readable by every local user in the process listing.
|
| --allow-non-loopback REQUIRES a token file. Beyond loopback, reaching the
| address would otherwise be the whole authorization: any peer could read every
| issue and claim work as any actor. --insecure-no-auth is the explicit,
| auditable way to say you meant that anyway.
|
| The Host allowlist is what a service deployment usually trips over first. The
| DNS-rebinding check answers only to loopback spellings and the bind address,
| so a client dialing a service name gets 400 on every request; enumerate the
| names it dials with --allowed-host (repeatable). Matching is exact — no
| wildcards — and the startup log line prints the effective allowlist.
|
| WHAT THIS DOES NOT DO
|
| No TLS. Even with a token, the credential and every issue body travel in
| plaintext, so a deployment beyond loopback has to supply confidentiality
| itself — a service mesh, or a network boundary you already trust.
|
| Hooks do not fire. A hook is a user-controlled subprocess per mutation: in a
| concurrent server that is an unbounded latency multiplier and an orphaned
| child at shutdown, and its working-directory-derived hook lookup is
| meaningless in a server process. A CLI claim runs on_update; an HTTP claim
| does not.
|
| The per-command auto-commit machinery does not run. Durability is per request:
| a successful claim commits inside its own transaction, exactly as a proxied
| CLI claim does today.
|
| An actor on an HTTP request is caller-asserted provenance for the audit trail,
| not authenticated identity — the same thing it has always been on the CLI,
| where any local process can pass any --actor.
|
| It does not run under --readonly, and refuses to start rather than binding.
| Every server it binds publishes the issue-claim operation, and the capability
| set it advertises is a property of the build rather than of the flags on the
| process that started it — so a read-only server would advertise a write it
| could never land.
|
| DESTRUCTIVE OPERATIONS
|
| POST /v0/beads/issues:sweep deletes closed beads in bulk — the operation
| behind bd purge and bd prune — and nothing it deletes comes back. It shares
| the library surface those commands call, so it inherits their guards: pinned
| beads are never swept, and a durable sweep with neither a cutoff nor an id
| pattern is refused rather than clearing every closed bead in the workspace.
| Combined with the trust model above, that means anyone who can reach this
| address can erase closed work; bind it accordingly.
flag --addr type=string default="127.0.0.1:0" usage="Address to bind as IP:PORT; the host must be a numeric IP literal, and port 0 takes an ephemeral port"
flag --allow-non-loopback type=bool default="false" usage="Permit a bind beyond loopback. Requires --auth-token-file, since reaching the address would otherwise be the whole authorization"
flag --allowed-host type=stringArray default="[]" usage="Additional Host header value to answer to, e.g. a service DNS name. Repeatable; matched exactly, with no wildcards"
flag --auth-token-file type=string default="" usage="Require an Authorization: Bearer token from this file, one token per line, all accepted. Re-read while running, so rewriting it rotates tokens without a restart (env BEADS_SERVE_TOKEN_FILE)"
flag --insecure-no-auth type=bool default="false" usage="Serve a non-loopback bind with NO authentication. Every peer that can reach the address gets full read and claim access"
flag --large-apply-ceiling type=duration default="5m0s" usage="Whole-run budget for a POST issues:batchApply request over 100 items (a ceiling, not a target; requests at or under 100 items are unaffected). Must be positive. The orchestrator's stop grace must be at least this long plus 5s, or an external SIGKILL can cut off an in-flight large apply a graceful drain would otherwise have waited out; see engdocs/SERVE_RUNBOOK.md"
bd set-state
use: "set-state <issue-id> <dimension>=<value>"
short: "Set operational state (creates event + updates label)"
group: "issues"
hidden: false
runnable: true
long:
| Atomically set operational state on an issue.
|
| This command:
| 1. Creates an event bead recording the state change (source of truth)
| 2. Removes any existing label for the dimension
| 3. Adds the new dimension:value label (fast lookup cache)
|
| State labels follow the convention <dimension>:<value>, for example:
| patrol:active, patrol:muted
| mode:normal, mode:degraded
| health:healthy, health:failing
|
| Examples:
| bd set-state agent-abc patrol=muted --reason "Investigating stuck worker"
| bd set-state agent-abc mode=degraded --reason "High error rate detected"
| bd set-state agent-abc health=healthy
|
| The --reason flag provides context for the event bead (recommended).
flag --reason type=string default="" usage="Reason for the state change (recorded in event)"
bd setup
use: "setup [recipe]"
short: "Setup integration with AI editors"
group: "setup"
hidden: false
runnable: true
long:
| Setup integration files for AI editors and coding assistants.
|
| Recipes define where beads workflow instructions are written. Built-in recipes
| include cursor, claude, copilot, gemini, aider, factory, codex, mux, opencode, junie, kiro, windsurf, cody, and kilocode.
|
| Examples:
| bd setup cursor # Install Cursor IDE integration (rules + agent hooks)
| bd setup cursor --global # Install global Cursor hooks (~/.cursor/hooks.json)
| bd setup kiro # Install Kiro steering guidance
| bd setup codex # Install Codex skill + AGENTS.md guidance + native hooks
| bd setup codex --global # Install global Codex skill + guidance + native hooks
| bd setup copilot # Install Copilot CLI plugin + repository instructions
| bd setup mux --project # Install Mux workspace layer (.mux/AGENTS.md)
| bd setup mux --global # Install Mux global layer (~/.mux/AGENTS.md)
| bd setup mux --project --global # Install both Mux layers
| bd setup --list # Show all available recipes
| bd setup --print # Print the template to stdout
| bd setup -o rules.md # Write template to custom path
| bd setup --add myeditor .myeditor/rules.md # Add custom recipe
|
| Use 'bd setup <recipe> --check' to verify installation status.
| Use 'bd setup <recipe> --remove' to uninstall.
flag --add type=string default="" usage="Add a custom recipe with given name"
flag --check type=bool default="false" usage="Check if integration is installed"
flag --global type=bool default="false" usage="Install globally (claude/codex/cursor/mux; writes to ~/.claude/settings.json, $CODEX_HOME/AGENTS.md or ~/.codex/AGENTS.md, ~/.cursor/hooks.json, or ~/.mux/AGENTS.md)"
flag --list type=bool default="false" usage="List all available recipes"
flag --output -o type=string default="" usage="Write template to custom path"
flag --print type=bool default="false" usage="Print the template to stdout"
flag --project type=bool default="false" usage="Install for this project only (gemini/mux)"
flag --remove type=bool default="false" usage="Remove the integration"
flag --stealth type=bool default="false" usage="Use stealth mode (claude/gemini)"
bd ship
use: "ship <capability>"
short: "Publish a capability for cross-project dependencies"
hidden: false
runnable: true
long:
| Ship a capability to satisfy cross-project dependencies.
|
| This command:
| 1. Finds issue with export:<capability> label
| 2. Validates issue is closed (or --force to override)
| 3. Adds provides:<capability> label
|
| External projects can depend on this capability using:
| bd dep add <issue> external:<project>:<capability>
|
| The capability is resolved when the external project has a closed issue
| with the provides:<capability> label.
|
| Examples:
| bd ship mol-run-assignee # Ship the mol-run-assignee capability
| bd ship mol-run-assignee --force # Ship even if issue is not closed
| bd ship mol-run-assignee --dry-run # Preview without making changes
flag --dry-run type=bool default="false" usage="Preview without making changes"
flag --force type=bool default="false" usage="Ship even if issue is not closed"
bd show
use: "show [id...] [--id=<id>...] [--current]"
aliases: ["view"]
short: "Show issue details"
group: "issues"
hidden: false
runnable: true
flag --as-of type=string default="" usage="Show issue as it existed at a specific commit hash or branch (requires Dolt; commit hashes must be the full 32-character hash from 'bd history', not a prefix)"
flag --brief-deps type=bool default="false" usage="Reduce each dependency to its identity fields in JSON output (--json only; drops description, design, notes and acceptance criteria)"
flag --children type=bool default="false" usage="Show only the children of this issue"
flag --comments-tail type=int default="0" usage="Render only the last N comments in text output, preceded by one elision line naming how many older ones were hidden (text output only; 0, the default, renders every comment unchanged; N must be >= 0)"
flag --current type=bool default="false" usage="Show the currently active issue (in-progress, hooked, or last touched)"
flag --id type=stringArray default="[]" usage="Issue ID (use for IDs that look like flags, e.g., --id=gt--xyz)"
flag --include-comments type=bool default="false" usage="Stream full comment bodies in JSON output (--json only; may be slow on issues with many comments). Without it the comments field is absent entirely, not truncated: an issue with comments carries comment_count and comments_omitted=true, so check those before reading an absent comments field as none."
flag --include-dependents type=bool default="false" usage="Stream full dependent issues in JSON output (--json only; may be slow on hub beads)"
flag --local-time type=bool default="false" usage="Show timestamps in local time instead of UTC (date-only fields are always local)"
flag --long type=bool default="false" usage="Show all available fields (extended metadata, agent identity, gate fields, etc.)"
flag --refs type=bool default="false" usage="Show issues that reference this issue (reverse lookup)"
flag --short type=bool default="false" usage="Show compact one-line output per issue"
flag --thread type=bool default="false" usage="Show full conversation thread (for messages)"
flag --watch -w type=bool default="false" usage="Watch for changes and auto-refresh display"
bd sql
use: "sql <query>"
short: "Execute raw SQL against the beads database"
group: "maint"
hidden: false
runnable: true
long:
| Execute a raw SQL query against the underlying database (Dolt).
|
| Useful for debugging, maintenance, and working around bugs in higher-level commands.
|
| Examples:
| bd sql 'SELECT COUNT(*) FROM issues'
| bd sql 'SELECT id, title FROM issues WHERE status = "open" LIMIT 5'
| bd sql 'DELETE FROM dirty_issues WHERE issue_id = "bd-abc123"'
| bd sql --csv 'SELECT id, title, status FROM issues'
|
| The query is passed directly to the database. Reads (SELECT, WITH ... SELECT,
| SHOW, EXPLAIN) return results as a table (or JSON/CSV with --json/--csv). Writes
| (INSERT, UPDATE, DELETE, DDL) report the number of rows affected. Statements
| that may both write and return rows, such as CALL, are committed and print any
| rows they return (or "OK").
|
| In proxied-server mode, multiple statements separated by ';' run as a single
| committed batch and report "OK", and --database runs the query against a
| different server database (equivalent to a session USE) without changing the
| project's configured database.
|
| WARNING: Direct database access bypasses the storage layer. Use with caution.
flag --csv type=bool default="false" usage="Output results in CSV format"
bd stale
use: "stale"
short: "Show stale issues (not updated recently)"
group: "views"
hidden: false
runnable: true
long:
| Show issues that haven't been updated recently and may need attention.
| This helps identify:
| - In-progress issues with no recent activity (may be abandoned)
| - Open issues that have been forgotten
| - Issues that might be outdated or no longer relevant
flag --days -d type=int default="30" usage="Issues not updated in this many days"
flag --exclude-label type=stringSlice default="[]" usage="Exclude issues that have ANY of these labels"
flag --label -l type=stringSlice default="[]" usage="Filter by labels (AND: must have ALL). Can combine with --label-any"
flag --label-any type=stringSlice default="[]" usage="Filter by labels (OR: must have AT LEAST ONE). Can combine with --label"
flag --limit -n type=int default="50" usage="Maximum issues to show"
flag --status -s type=string default="" usage="Filter by status (open|in_progress|blocked|deferred)"
bd state
use: "state <issue-id> <dimension>"
short: "Query the current value of a state dimension"
group: "issues"
hidden: false
runnable: true
long:
| Query the current value of a state dimension from an issue's labels.
|
| State labels follow the convention <dimension>:<value>, for example:
| patrol:active
| mode:degraded
| health:healthy
|
| This command extracts the value for a given dimension.
|
| Examples:
| bd state witness-abc patrol # Output: active
| bd state witness-abc mode # Output: normal
| bd state witness-abc health # Output: healthy
bd state list
use: "list <issue-id>"
short: "List all state dimensions on an issue"
hidden: false
runnable: true
long:
| List all state labels (dimension:value format) on an issue.
|
| This filters labels to only show those following the state convention.
|
| Example:
| bd state list witness-abc
| # Output:
| # patrol: active
| # mode: normal
| # health: healthy
bd status
use: "status"
aliases: ["stats"]
short: "Show issue database overview and statistics"
group: "views"
hidden: false
runnable: true
long:
| Show a quick snapshot of the issue database state and statistics.
|
| This command provides a summary of issue counts by state (open, in_progress,
| blocked, closed), ready work, extended statistics (pinned issues,
| average lead time), and recent activity over the last 24 hours from git history.
|
| Similar to how 'git status' shows working tree state, 'bd status' gives you
| a quick overview of your issue database without needing multiple queries.
|
| Use cases:
| - Quick project health check
| - Onboarding for new contributors
| - Integration with shell prompts or CI/CD
| - Daily standup reference
| - Fast CI status checks that don't need blocked-count accuracy
|
| Examples:
| bd status # Show summary with activity
| bd status --no-activity # Skip git activity (faster)
| bd status --no-blocked # Skip slow blocked-count scan (faster)
| bd stats --no-blocked --json # JSON output without blocked count
| bd status --json # JSON format output
| bd status --assigned # Show issues assigned to current user
| bd stats # Alias for bd status
flag --all type=bool default="false" usage="Show all issues (default behavior)"
flag --assigned type=bool default="false" usage="Show issues assigned to current user"
flag --no-activity type=bool default="false" usage="Skip git activity summary (faster)"
flag --no-blocked type=bool default="false" usage="Skip blocked-count computation (faster on large rigs; not supported in proxied-server mode)"
bd statuses
use: "statuses"
short: "List valid issue statuses"
group: "views"
hidden: false
runnable: true
long:
| List all valid issue statuses and their categories.
|
| Built-in statuses (open, in_progress, blocked, etc.) are always valid.
| Additional statuses can be configured via status.custom:
|
| bd config set status.custom "in_review:active,qa_testing:wip,on_hold:frozen"
|
| Categories control behavior:
| active — appears in 'bd ready' and default 'bd list'
| wip — excluded from 'bd ready', visible in default 'bd list'
| done — excluded from 'bd ready' and default 'bd list'
| frozen — excluded from 'bd ready' and default 'bd list'
|
| Statuses without a category (legacy format) are valid but excluded from 'bd ready'.
|
| Examples:
| bd statuses # List all statuses with icons and categories
| bd statuses --json # Output as JSON
|
bd supersede
use: "supersede <id> --with <new>"
short: "Mark an issue as superseded by a replacement issue"
group: "deps"
hidden: false
runnable: true
long:
| Mark an issue as superseded by a different (replacement) issue.
|
| The superseded issue is automatically closed with a reference to the replacement.
| Useful for design docs, specs, and evolving artifacts.
|
| Examples:
| bd supersede bd-old --with bd-new # Mark bd-old as superseded by bd-new
flag --with type=string default="" annotations={cobra_annotation_bash_completion_one_required_flag=["true"]} usage="Replacement issue ID (required)"
bd swarm
use: "swarm"
short: "Swarm management for structured epics"
group: "deps"
hidden: false
runnable: false
long:
| Swarm management commands for coordinating parallel work on epics.
|
| A swarm is a structured body of work defined by an epic and its children,
| with dependencies forming a DAG (directed acyclic graph) of work.
bd swarm create
use: "create [epic-id]"
short: "Create a swarm molecule from an epic"
hidden: false
runnable: true
long:
| Create a swarm molecule to orchestrate parallel work on an epic.
|
| The swarm molecule:
| - Links to the epic it orchestrates
| - Has mol_type=swarm for discovery
| - Specifies a coordinator (optional)
| - Can be picked up by any coordinator agent
|
| If given a single issue (not an epic), it will be auto-wrapped:
| - Creates an epic with that issue as its only child
| - Then creates the swarm molecule for that epic
|
| Examples:
| bd swarm create bd-epic-123 # Create swarm for epic
| bd swarm create bd-epic-123 --coordinator=observer/ # With specific coordinator
| bd swarm create bd-task-456 # Auto-wrap single issue
flag --coordinator type=string default="" usage="Coordinator address (e.g., my-project/witness)"
flag --force type=bool default="false" usage="Create new swarm even if one already exists"
bd swarm list
use: "list"
short: "List all swarm molecules"
hidden: false
runnable: true
long:
| List all swarm molecules with their status.
|
| Shows each swarm molecule with:
| - Progress (completed/total issues)
| - Active workers
| - Epic ID and title
|
| Examples:
| bd swarm list # List all swarms
| bd swarm list --json # Machine-readable output
bd swarm status
use: "status [epic-or-swarm-id]"
short: "Show current swarm status"
hidden: false
runnable: true
long:
| Show the current status of a swarm, computed from beads.
|
| Accepts either:
| - An epic ID (shows status for that epic's children)
| - A swarm molecule ID (follows the link to find the epic)
|
| Displays issues grouped by state:
| - Completed: Closed issues
| - Active: Issues currently in_progress (with assignee)
| - Ready: Open issues with all dependencies satisfied
| - Blocked: Open issues waiting on dependencies
|
| The status is COMPUTED from beads, not stored separately.
| If beads changes, status changes.
|
| Examples:
| bd swarm status gt-epic-123 # Show swarm status by epic
| bd swarm status gt-swarm-456 # Show status via swarm molecule
| bd swarm status gt-epic-123 --json # Machine-readable output
bd swarm validate
use: "validate [epic-id]"
short: "Validate epic structure for swarming"
hidden: false
runnable: true
long:
| Validate an epic's structure to ensure it's ready for swarm execution.
|
| Checks for:
| - Correct dependency direction (requirement-based, not temporal)
| - Orphaned issues (roots with no dependents)
| - Missing dependencies (leaves that should depend on something)
| - Cycles (impossible to resolve)
| - Disconnected subgraphs
|
| Reports:
| - Ready fronts (waves of parallel work)
| - Estimated worker-sessions
| - Maximum parallelism
| - Warnings for potential issues
|
| Examples:
| bd swarm validate gt-epic-123 # Validate epic structure
| bd swarm validate gt-epic-123 --verbose # Include detailed issue graph
flag --verbose type=bool default="false" usage="Include detailed issue graph in output"
bd sync
use: "sync"
short: "Pull, check for conflicts, repair is_blocked, and push (the federation loop)"
group: "sync"
hidden: false
runnable: true
long:
| Run one full synchronization cycle against the Dolt remote.
|
| This is the loop every multi-machine beads deployment otherwise hand-rolls in
| shell:
|
| 1. pull from the remote
| 2. check for merge conflicts POSITIVELY, from the merge's own conflict rows
| and from Dolt's conflict tables — never inferred from the pull's exit
| status, which is not a trustworthy conflict signal in either direction
| 3. recompute the denormalized is_blocked flag, so dependency edges merged in
| from another replica do not leave 'bd ready' stale
| 4. push, retrying a bounded number of times when another replica wins the
| push race
|
| The repair in step 3 refuses to run while another writer has uncommitted changes
| to issues/dependencies. That is transient and not this sync's doing, so it is
| retried on the same budget as a push race rather than failing the run. A working
| set that is NOT transient exits 4 instead, because no amount of retrying will
| ever publish and only an operator can clear it. Two kinds of evidence say so:
| constraint violations on the dirty tables are detected positively and escalate
| on the very attempt that finds them; an abandoned uncommitted edit has no such
| positive signal, so it is only inferred once the same pending graph edits have
| blocked every attempt of several consecutive runs.
|
| Conflicts sync cannot resolve safely are NEVER auto-resolved: it halts before
| recomputing or pushing and exits 2, and repeated runs keep halting the same way
| until an operator resolves the divergence. (The pull underneath does auto-settle
| the conflict classes it can settle convergently — machine-local metadata,
| audit-only dependency rows, and last-write-wins on issue cells. Anything beyond
| those halts here.) Whether the halted merge was aborted or left live in the
| working set depends on the pull route, so the halt message reports which.
|
| Exit codes (a sync timer can branch on these without parsing output):
|
| 0 synced, or nothing to do
| 1 error (transport, auth, storage)
| 2 merge conflict — halted, nothing pushed, resolve it by hand
| 3 retries exhausted (push race, or a concurrent writer's dirty working set)
| — transient, nothing pushed, retry on the next tick
| 4 the dirty working set is stuck, not busy: identical pending graph edits
| blocked every attempt of several consecutive runs — nothing pushed, and no
| later tick will publish until an operator clears it
|
| On the default-remote path, a rig with no Dolt remote yet but a git origin
| configured adopts that origin as its Dolt remote first, exactly as 'bd dolt push'
| does — so 'bd sync' works as a first-time federation bring-up step instead of
| reporting 'no remote' and doing nothing. Passing --remote never adopts anything.
|
| This is not 'bd federation sync', which syncs with named peer towns and takes a
| --strategy ours|theirs to resolve whatever conflicts it meets. 'bd sync' targets
| the configured remote and has no such switch: what it cannot settle, it halts on.
|
| Examples:
| bd sync # sync with the default remote
| bd sync --remote mini # sync with a specific remote
| bd sync --attempts 5 # allow more push-race retries
| bd sync --json # machine-parseable outcome
flag --attempts type=int default="3" usage="Maximum pull/push attempts before reporting a transient retry exhaustion (exit 3)"
flag --no-adopt type=bool default="false" usage="Never derive a Dolt remote from git origin (also BD_NO_REMOTE_ADOPT=1)"
flag --remote type=string default="" usage="Sync with a specific named remote instead of the default"
flag --yes -y type=bool default="false" usage="Consent to adopting a Dolt remote derived from git origin when none is configured"
bd tag
use: "tag <id> <label>"
short: "Add a label to an issue"
group: "issues"
hidden: false
runnable: true
long:
| Add a label to an issue.
|
| Shorthand for 'bd update <id> --add-label <label>'.
|
| Examples:
| bd tag bd-123 bug
| bd tag bd-123 needs-review
bd todo
use: "todo"
short: "Manage TODO items (convenience wrapper for task issues)"
group: "issues"
hidden: false
runnable: true
long:
| Manage TODO items as lightweight task issues.
|
| TODOs are regular task-type issues with convenient shortcuts:
| bd todo add "Title" -> bd create "Title" -t task -p 2
| bd todo -> bd list --type task --status open
| bd todo done <id> -> bd close <id>
|
| TODOs can be promoted to full issues by changing type or priority:
| bd update todo-123 --type bug --priority 0
bd todo add
use: "add <title>"
short: "Add a new TODO item"
hidden: false
runnable: true
flag --description -d type=string default="" usage="Description"
flag --priority -p type=int default="2" usage="Priority (0-4, default 2)"
bd todo done
use: "done <id> [<id>...]"
short: "Mark TODO(s) as done"
hidden: false
runnable: true
flag --reason type=string default="" usage="Reason for closing (default: Completed)"
bd todo list
use: "list"
short: "List TODO items"
hidden: false
runnable: true
flag --all type=bool default="false" usage="Show all TODOs including completed"
bd types
use: "types"
short: "List valid issue types"
group: "views"
hidden: false
runnable: true
long:
| List all valid issue types that can be used with bd create --type.
|
| Core work types (bug, task, feature, chore, epic, decision, spike, story, milestone)
| and system types (message, molecule, gate, event) are always valid.
| Custom types are registered with 'bd config set types.custom' or declared under
| types.custom in .beads/config.yaml; the list shown is exactly the set that
| bd create --type accepts.
|
| Examples:
| bd types # List all types with descriptions
| bd types --sections # List required sections for each type
| bd types --json # Output as JSON
|
flag --sections type=bool default="false" usage="Show required sections for each issue type"
bd unclaim
use: "unclaim [id...]"
short: "Release a claimed issue"
group: "issues"
hidden: false
runnable: true
long:
| Release a claimed issue by clearing the assignee and resetting status to 'open'.
|
| Use this when an agent crashes mid-work or you need to abandon a claimed task.
| The issue becomes available for re-claiming by other agents.
|
| Only the current assignee can release its own claim. Releasing another
| actor's claim requires --force and should be coordinated with the holder
| first — their claim may be live even if the issue looks idle. Prefer
| letting lease expiry reclaim genuinely abandoned work.
|
| With --if-assignee, the release is an atomic compare-and-swap (the inverse of
| claim): the issue is released only while it is still assigned to the given
| assignee. If the holder differs — e.g. the claim was already reclaimed and
| re-taken by another worker — nothing is changed and bd exits nonzero with an
| error naming the current holder. Use this from supervisors that must return a
| specific worker's issue without ever clobbering someone else's live claim.
| --if-assignee requires a non-empty assignee and cannot be combined with --force
| (they encode contradictory intent).
|
| Exit status: 0 when every issue was released; 1 when any release failed
| (including an --if-assignee mismatch).
|
| Examples:
| bd unclaim bd-123
| bd unclaim bd-123 --reason "Agent crashed"
| bd unclaim bd-123 bd-456
| bd unclaim bd-123 --if-assignee worker-7 # only if still held by worker-7
flag --force type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["force if-assignee"]} usage="Release the claim even if held by a different actor (admin/reaper use)"
flag --if-assignee type=string default="" annotations={cobra_annotation_mutually_exclusive=["force if-assignee"]} usage="Only release if still assigned to this assignee (atomic compare-and-swap; exits nonzero without changing the issue when the holder differs)"
flag --reason -r type=string default="" usage="Reason for unclaiming"
bd undefer
use: "undefer [id...]"
short: "Undefer one or more issues (restore to open)"
hidden: false
runnable: true
long:
| Undefer issues to restore them to open status.
|
| This brings issues back from the icebox so they can be worked on again.
| Issues will appear in 'bd ready' if they have no blockers.
|
| If an issue carries a defer_until timestamp but its status isn't
| "deferred" (e.g. after an explicit --status change), undefer clears
| the stray timestamp without touching status.
|
| Examples:
| bd undefer bd-abc # Undefer a single issue
| bd undefer bd-abc bd-def # Undefer multiple issues
bd update
use: "update [id...]"
short: "Update one or more issues"
group: "issues"
hidden: false
runnable: true
long:
| Update one or more issues.
|
| If no issue ID is provided, updates the last touched issue (from most recent
| create, update, show, or close operation). This fallback only applies in
| interactive sessions (stdin is a terminal); in scripts and agent sessions a
| missing ID is an error, so a command built from an empty variable cannot
| silently mutate an unrelated issue. Set BD_LAST_TOUCHED_FALLBACK=1 to allow
| the fallback anywhere, or =0 to disable it entirely.
|
| Updates are applied per issue ID, not atomically across IDs: when some IDs
| fail, the remaining issues are still updated, every failed ID is reported on
| stderr, and the command exits nonzero.
|
| Exit codes: 1 for general failures; 13 when every failure is a stale
| --if-assignee/--if-status guard (the precondition no longer held, nothing was
| written — another actor won the race, so retrying the same guard is
| pointless).
flag --acceptance type=string default="" usage="Acceptance criteria"
flag --acceptance-criteria type=string default="" hidden usage="DEPRECATED: use --acceptance"
flag --add-label -l type=stringSlice default="[]" usage="Add labels (repeatable); -l matches bd create -l"
flag --allow-empty-description type=bool default="false" usage="Allow empty description replacement when reading from stdin or file"
flag --append-notes type=string default="" annotations={cobra_annotation_mutually_exclusive=["clear-notes append-notes"]} usage="Append to existing notes (with newline separator)"
flag --assignee -a type=string default="" usage="Assignee"
flag --await-id type=string default="" usage="Set gate await_id (e.g., GitHub run ID for gh:run gates)"
flag --body type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin body"]} usage="Alias for --description (GitHub CLI convention)"
flag --body-file type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin body-file"]} usage="Read description from file (use - for stdin)"
flag --claim type=bool default="false" usage="Atomically claim the issue (sets assignee to you, status to in_progress; idempotent if already claimed by you; issues assigned to a pool alias listed in the claim.pools config are claimable too)"
flag --clear-notes type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["clear-notes notes" "clear-notes append-notes"]} usage="Clear the notes field (--notes \"\" is refused: an empty value is usually a dead command substitution)"
flag --defer type=string default="" usage="Defer until date (empty to clear). Issue hidden from bd ready until then, then auto-wakes to open"
flag --description -d type=string default="" annotations={cobra_annotation_mutually_exclusive=["stdin description"]} usage="Issue description"
flag --description-file type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin description-file"]} usage="Alias for --body-file"
flag --design type=string default="" annotations={cobra_annotation_mutually_exclusive=["design design-file"]} usage="Design notes"
flag --design-file type=string default="" annotations={cobra_annotation_mutually_exclusive=["design design-file"]} usage="Read design from file (use - for stdin)"
flag --due type=string default="" usage="Due date/time (empty to clear). Formats: +6h, +1d, +2w, tomorrow, next monday, 2025-01-15"
flag --ephemeral type=bool default="false" usage="Mark issue as ephemeral (wisp) - not exported to JSONL"
flag --estimate -e type=int default="0" usage="Time estimate in minutes (e.g., 60 for 1 hour)"
flag --external-ref type=string default="" usage="External reference (e.g., 'gh-9', 'jira-ABC', Linear URL)"
flag --force type=bool default="false" usage="Override refusals: let -a/--assignee overwrite another actor's live in_progress claim (use only for abandoned claims — crashed agent, expired lease; prefer bd reclaim), let -s/--status move the issue into closed (or a configured done status) despite open children or a live blocker (same as bd close --force), and let --notes overwrite existing non-empty notes (use --append-notes to preserve history instead)"
flag --history type=bool default="false" usage="Clear no-history flag (re-enable Dolt commit history)"
flag --if-assignee type=string default="" usage="Apply the update only if the current assignee equals this value (--if-assignee '' requires unassigned); a mismatch writes nothing and exits 13 (vs 1 for other failures). Requires a field update; cannot combine with --claim"
flag --if-revision type=string default="" usage="Apply the write only if the issue's current revision equals this value (the decimal int64 from `bd show --json`'s \"revision\" field). One id only: refused before any write when combined with more than one issue id. A mismatch writes nothing and exits 13 (vs 1 for other failures). Composes with --if-assignee/--if-status: all guards present must hold."
flag --if-status type=string default="" usage="Apply the update only if the current status equals this value; a mismatch writes nothing and exits 13 (vs 1 for other failures). Requires a field update; cannot combine with --claim"
flag --message -m type=string default="" hidden annotations={cobra_annotation_mutually_exclusive=["stdin message"]} usage="Alias for --description (git commit convention)"
flag --metadata type=string default="" usage="Set custom metadata (JSON object, or @file.json to read from file)"
flag --no-history type=bool default="false" usage="Mark issue as no-history (skip Dolt commits, not GC-eligible)"
flag --notes type=string default="" annotations={cobra_annotation_mutually_exclusive=["clear-notes notes"]} usage="Replace the notes field (requires --force over existing non-empty notes; --clear-notes clears; --append-notes appends instead)"
flag --parent type=string default="" usage="New parent issue ID (reparents the issue, use empty string to remove parent)"
flag --persistent type=bool default="false" usage="Mark issue as persistent (promote wisp to regular issue)"
flag --priority -p type=string default="" usage="Priority (0-4 or P0-P4, 0=highest)"
flag --remove-label type=stringSlice default="[]" usage="Remove labels (repeatable)"
flag --session type=string default="" usage="Claude Code session ID for status=closed (or set CLAUDE_SESSION_ID env var)"
flag --set-labels type=stringSlice default="[]" usage="Set labels, replacing all existing (repeatable)"
flag --set-metadata type=stringArray default="[]" usage="Set metadata key=value (repeatable, e.g., --set-metadata team=platform)"
flag --spec-id type=string default="" usage="Link to specification document"
flag --status -s type=string default="" usage="New status"
flag --stdin type=bool default="false" annotations={cobra_annotation_mutually_exclusive=["stdin body-file" "stdin description-file" "stdin description" "stdin body" "stdin message"]} usage="Read description from stdin (alias for --body-file -)"
flag --title type=string default="" usage="New title"
flag --type -t type=string default="" usage="New type (bug|feature|task|epic|chore|decision|spike|story|milestone); custom types require types.custom config; aliases: enhancement/feat→feature, dec/adr→decision"
flag --unset-metadata type=stringArray default="[]" usage="Remove metadata key (repeatable, e.g., --unset-metadata team)"
bd upgrade
use: "upgrade"
short: "Check and manage bd version upgrades"
group: "maint"
hidden: false
runnable: false
long:
| Commands for checking bd version upgrades and reviewing changes.
|
| The upgrade command helps you stay aware of bd version changes:
| - bd upgrade status: Check if bd version changed since last use
| - bd upgrade review: Show what's new since your last version
| - bd upgrade ack: Acknowledge the current version
|
| Version tracking is automatic - bd updates metadata.json on every run.
bd upgrade ack
use: "ack"
short: "Acknowledge the current bd version"
hidden: false
runnable: true
long:
| Mark the current bd version as acknowledged.
|
| This updates metadata.json to record that you've seen the current
| version. Mainly useful after reviewing upgrade changes to suppress
| future upgrade notifications.
|
| Note: Version tracking happens automatically, so you don't need to
| run this command unless you want to explicitly mark acknowledgement.
|
| Examples:
| bd upgrade ack
| bd upgrade ack --json
bd upgrade review
use: "review"
short: "Review changes since last bd version"
hidden: false
runnable: true
long:
| Show what's new in bd since the last version you used.
|
| Unlike 'bd info --whats-new' which shows the last 3 versions,
| this command shows ALL changes since your specific last version.
|
| If you're upgrading from an old version, you'll see the complete
| changelog of everything that changed since then.
|
| Examples:
| bd upgrade review
| bd upgrade review --json
bd upgrade status
use: "status"
short: "Check if bd version has changed"
hidden: false
runnable: true
long:
| Check if bd has been upgraded since you last used it.
|
| This command uses the version tracking that happens automatically
| at startup to detect if bd was upgraded.
|
| Examples:
| bd upgrade status
| bd upgrade status --json
bd vc
use: "vc"
short: "Version control operations"
group: "sync"
hidden: false
runnable: false
long:
| Version control operations for the beads database.
|
| These commands provide git-like version control for your issue data, including branching, merging, and
| viewing history.
|
| Note: 'bd history', 'bd diff', and 'bd branch' also work for quick access.
| This subcommand provides additional operations like merge and commit.
bd vc commit
use: "commit"
short: "Create a commit with all staged changes"
hidden: false
runnable: true
long:
| Create a new Dolt commit with all current changes.
|
| Examples:
| bd vc commit -m "Added new feature issues"
| bd vc commit --message "Fixed priority on several issues"
| echo "Multi-line message" | bd vc commit --stdin
flag --message -m type=string default="" usage="Commit message"
flag --stdin type=bool default="false" usage="Read commit message from stdin"
bd vc merge
use: "merge <branch>"
short: "Merge a branch into the current branch"
hidden: false
runnable: true
long:
| Merge the specified branch into the current branch.
|
| If there are merge conflicts, they will be reported. You can resolve
| conflicts with --strategy.
|
| Examples:
| bd vc merge feature-xyz # Merge feature-xyz into current branch
| bd vc merge feature-xyz --strategy ours # Merge, preferring our changes on conflict
| bd vc merge feature-xyz --strategy theirs # Merge, preferring their changes on conflict
flag --strategy type=string default="" usage="Conflict resolution strategy: 'ours' or 'theirs'"
bd vc status
use: "status"
short: "Show current branch and uncommitted changes"
hidden: false
runnable: true
long:
| Show the current branch, commit hash, and any uncommitted changes.
|
| Examples:
| bd vc status
bd version
use: "version"
short: "Print version information"
hidden: false
runnable: true
bd versions
use: "versions <id>"
short: "List the recorded versions of a bead"
group: "views"
hidden: false
runnable: true
long:
| List the versions recorded for a bead by versioned history.
|
| Recording is off by default. Turn it on with:
|
| bd config set versioned-history.enabled true
|
| That writes the setting into the store, so every client of that store agrees
| about whether a write is recorded, and it is the setting this command reports.
| BD_VERSIONED_HISTORY_ENABLED=1 (or a value in config.yaml) also turns recording
| on for the writes a process makes, but it says nothing about the store, and
| this command only reads, so it does not consult them.
|
| Either source turning it on is enough for a writer; neither can switch the
| other off. The consequence worth knowing: once the store setting says on,
| BD_VERSIONED_HISTORY_ENABLED=0 will not turn recording off for one run. Turn
| it off where it was turned on:
|
| bd config set versioned-history.enabled false
|
| Only beads created while recording is on, or that enter the issues plane
| while it is on (a wisp promoted or made persistent), are versioned. A bead
| already on the issues plane when recording was turned on is legacy: editing
| it records nothing (the write fence, design §16.2b), and nothing is
| backfilled.
|
| Turning recording off does not hide what was already recorded — this command
| still lists it, and says that recording is currently off.
|
| A caution while the feature is young: keep recording ON for every writer of a
| shared store, or leave it off for all of them. A write from a client with
| recording off advances nothing, and the next recorded write mints a version
| that absorbs that unrecorded change under its own actor — the revisions stay
| contiguous and the listing looks gapless when it is not.
|
| Examples:
| bd versions bd-123
| bd versions bd-123 --json
bd where
use: "where"
short: "Show active beads location"
group: "setup"
hidden: false
runnable: true
long:
| Show the active beads database location, including redirect information.
|
| This command is useful for debugging when using redirects, to understand
| which beads workspace is actually being used.
|
| Examples:
| bd where # Show active beads location
| bd where --json # Output in JSON format
|
bd worktree
use: "worktree"
short: "Manage git worktrees for parallel development"
group: "maint"
hidden: false
runnable: false
annotations: {bd:skip_store="1"}
long:
| Manage git worktrees with proper beads configuration.
|
| Worktrees allow multiple working directories sharing the same git repository,
| enabling parallel development (e.g., multiple agents or features).
|
| Worktrees automatically share the same beads database as the main repository
| via git common directory discovery — no manual redirect configuration needed.
|
| Examples:
| bd worktree create feature-auth # Create worktree
| bd worktree create bugfix --branch fix-1 # Create with specific branch name
| bd worktree list # List all worktrees
| bd worktree remove feature-auth # Remove worktree (with safety checks)
| bd worktree info # Show info about current worktree
bd worktree create
use: "create <name> [--branch=<branch>]"
short: "Create a worktree"
hidden: false
runnable: true
long:
| Create a git worktree for parallel development.
|
| This command:
| 1. Creates a git worktree at ./<name> (or specified path)
| 2. Adds the worktree path to .gitignore (if inside repo root)
|
| The worktree automatically shares the same beads database as the main
| repository via git common directory discovery — no redirect file needed.
|
| Examples:
| bd worktree create feature-auth # Create at ./feature-auth
| bd worktree create bugfix --branch fix-1 # Create with branch name
| bd worktree create ../agents/worker-1 # Create at relative path
flag --branch type=string default="" usage="Branch name for the worktree (default: same as name)"
bd worktree info
use: "info"
short: "Show worktree info for current directory"
hidden: false
runnable: true
long:
| Show information about the current worktree.
|
| If the current directory is in a git worktree, shows:
| - Worktree path and name
| - Branch
| - Beads configuration (redirect or main)
| - Main repository location
|
| Examples:
| bd worktree info # Show current worktree info
| bd worktree info --json # JSON output
bd worktree list
use: "list"
short: "List all git worktrees"
hidden: false
runnable: true
long:
| List all git worktrees and their beads configuration state.
|
| Shows each worktree with:
| - Name (directory name)
| - Path (full path)
| - Branch
| - Beads state: "redirect" (uses shared db), "shared" (is main), "none" (no beads)
|
| Examples:
| bd worktree list # List all worktrees
| bd worktree list --json # JSON output
bd worktree remove
use: "remove <name>"
short: "Remove a worktree with safety checks"
hidden: false
runnable: true
long:
| Remove a registered git worktree with fail-closed safety checks.
|
| Without --force, the target must be clean and its pinned HEAD must be contained
| in either the configured upstream or the single comparator selected by
| --merged-into. Comparators may be full refs, unambiguous short ref names, or
| full commit object IDs. Revision expressions and worktree-local pseudorefs such
| as HEAD and ORIG_HEAD are rejected.
|
| --force skips cleanliness and containment requirements, but it does not skip
| registered-identity and concurrent-change checks. --force and --merged-into
| are mutually exclusive, and each flag may be specified at most once.
|
| Worktree removal and .gitignore cleanup are not atomic. If removal succeeds but
| cleanup fails, this command returns an error that explicitly reports the
| worktree as removed; it does not claim or attempt a rollback.
|
| Examples:
| bd worktree remove feature-auth # Check the configured upstream
| bd worktree remove feature-auth --merged-into main # Check containment in main
| bd worktree remove feature-auth --force # Skip clean/containment checks
flag --force type=bool default="false" usage="Skip cleanliness and containment checks"
flag --merged-into type=string default="" usage="Require worktree HEAD to be contained in this ref"