beads/website/versioned_docs/version-1.0.5/reference/advanced.md
matt wilkie b55472412b
docs: snapshot versioned docs for 1.0.5 release (#4246)
The v1.0.5 tag shipped with cmd/bd/version.go bumped to 1.0.5 but without
the Docusaurus version snapshot, so check-version-consistency (via
scripts/check-docs-version.sh) went red on main: versions.json and
docusaurus.config.ts lastVersion were still 1.0.4 and
website/versioned_docs/version-1.0.5 was missing.

Create the 1.0.5 docs snapshot to restore consistency:
- docusaurus docs:version 1.0.5 (versions.json + versioned_docs + sidebar)
- set docusaurus.config.ts lastVersion to 1.0.5
- regenerate versioned CLI reference (stamps "Reference for bd v1.0.5")
- regenerate website/static/llms-full.txt

Verified: scripts/check-versions.sh and scripts/check-doc-flags.sh pass.

Refs: mybd-4qku

Agent-Signature: claude-opus-4-8-medium on behalf of matt wilkie
2026-05-28 21:51:26 -07:00

3.2 KiB

id title sidebar_position
advanced Advanced Features 3

Advanced Features

Advanced beads functionality.

Issue Rename

Rename issues while preserving references:

bd rename bd-42 bd-new-id
bd rename bd-42 bd-new-id --dry-run  # Preview

Updates:

  • All dependencies pointing to old ID
  • All references in other issues
  • Comments and descriptions

Issue Merge

Merge duplicate issues:

bd merge bd-42 bd-43 --into bd-41
bd merge bd-42 bd-43 --into bd-41 --dry-run

What gets merged:

  • Dependencies → target
  • Text references updated across all issues
  • Source issues closed with merge reason

Database Compaction

Reduce database size by compacting old issues:

# View compaction statistics
bd admin compact --stats

# Preview candidates (30+ days closed)
bd admin compact --analyze --json

# Apply agent-generated summary
bd admin compact --apply --id bd-42 --summary summary.txt

# Immediate deletion (CAUTION!)
bd admin cleanup --force

When to compact:

  • Database > 10MB with old closed issues
  • After major milestones
  • Before archiving project phase

Restore from History

View deleted or compacted issues from git:

bd restore bd-42 --show
bd restore bd-42 --to-file issue.json

Database Inspection

# Schema info
bd info --schema --json

# Raw database query (advanced — requires dolt sql-server running)
bd dolt sql "SELECT * FROM issues LIMIT 5"

Custom Tables

Extend the database with custom tables:

// In Go code using beads as library
storage.UnderlyingDB().Exec(`
  CREATE TABLE IF NOT EXISTS custom_table (...)
`)

See the bd-example-extension-go example for a working extension.

Event System

Subscribe to beads events:

# View recent events
bd events list --since 1h

# Watch events in real-time
bd events watch

Events:

  • issue.created
  • issue.updated
  • issue.closed
  • dependency.added
  • sync.completed

Batch Operations

Create Multiple

# Bootstrap a new database from JSONL
bd init --from-jsonl issues.jsonl

Update Multiple

bd list --status open --priority 4 --json | \
  jq -r '.[].id' | \
  xargs -I {} bd update {} --priority 3

Close Multiple

bd list --label "sprint-1" --status open --json | \
  jq -r '.[].id' | \
  xargs -I {} bd close {} --reason "Sprint complete"

API Access

Use beads as a Go library:

import "github.com/steveyegge/beads/internal/storage/embeddeddolt"

store, _ := embeddeddolt.New(ctx, ".beads", "beads", "main")
defer store.Close()
issue, _ := store.GetIssue(ctx, "bd-a1b2")

Performance Tuning

Large Databases

# Enable WAL mode
bd config set database.wal_mode true

# Increase cache
bd config set database.cache_size 10000

Many Concurrent Agents

Beads uses Dolt server mode to handle concurrent access from multiple agents. The server manages transaction isolation automatically.

# Start the Dolt server
bd dolt start

# Check server health
bd doctor

CI/CD Optimization

In CI/CD environments, beads uses embedded mode by default (no server required):

# Just run commands directly — no special flags needed
bd list