beads/docs/cli-reference/batch.md
Chris Sells 4ea6fa3ac0 docs(emitter): emit Mintlify CLI reference and generated docs.json nav
bd help --docs-root now additionally writes docs/cli-reference/ in Mintlify
form (frontmatter title as H1, extensionless root-relative links, JSX
auto-generated markers since Mintlify parses .md through MDX) and rewrites
the CLI Reference pages array inside docs/docs.json via a textual splice
that leaves the rest of the file byte-identical — the ~113 nav entries are
never hand-maintained. The Docusaurus outputs (docs/CLI_REFERENCE.md,
website/docs/cli-reference/, versioned snapshots) are unchanged.

generate-cli-docs.sh --check seeds docs/docs.json and docs/cli-reference/
into its scratch root and diffs both; check-cli-docs-drift.sh adds them to
GEN_PATHSPECS and the regeneration fingerprint; docs-autofix-push.sh
allowlists the new generated paths; check-doc-flags.sh scans the new
docs/ subdirectories and requires command coverage in docs/cli-reference/.

Includes the initial docs/docs.json scaffold (nav mirrors the Docusaurus
sidebar IA) and the generated docs/cli-reference/ pages.

TDD: new emitter behavior covered in cmd/bd/help_all_test.go
(Mintlify page format, nav splice correctness + idempotence, bare-root
generation without docs.json).
2026-07-12 10:37:07 -07:00

2.2 KiB

title description
bd batch Run multiple write operations in a single database transaction

{/* AUTO-GENERATED: do not edit manually */}

Generated from bd help --doc batch.

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 Supported dependency types: see 'bd dep add --help' (default: blocks)

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.

bd batch [flags]

Flags:

      --dry-run          Parse input and echo commands without executing
  -f, --file string      Read commands from file instead of stdin
  -m, --message string   DOLT_COMMIT message (default: 'bd: batch N ops by <actor>')