Recipes
Ready-to-copy workflows that combine bb with jq and shell. Each recipe is a complete, runnable script — drop it into a CI job or a dotfile and adjust the workspace and repository names.
For the primitives these recipes are built on, see the Scripting & Automation guide and the CI/CD Integration guide.
Available recipes
Section titled “Available recipes”Auto-merge when CI is greenPoll bb pr checks until all checks pass, then merge — the GitOps-friendly way.
Bulk reviewer assignmentAssign a fixed list of reviewers across many open pull requests (team rotations, onboarding).
Fork synchronizationFetch upstream, rebase your fork, and push the result for fork-based contribution flows.
Reporting & analytics with jqCount PRs per state, sum diff sizes, group by author, and export to CSV.
Retry wrapper for transient failuresA shell wrapper that retries bb invocations with exponential backoff for persistent flakes.
Conventions used in these recipes
Section titled “Conventions used in these recipes”- All recipes assume
bb auth loginhas already succeeded — interactively, or via theBB_USERNAMEandBB_API_TOKENenv vars. WORKSPACEandREPOare read from the environment with a${VAR:-default}fallback. Export them in CI, or edit the defaults at the top of the script.- List commands default to
--limit 25. Pass--allwherever a recipe has to see every result — theShowing 25 pull requests. Use --limit <n> or --all to see more.hint is printed with table output only, never under--json. - The CLI already retries HTTP 429, 502, 503 and 504 up to 3 times with exponential backoff. It also retries
ECONNRESET,ETIMEDOUT,ECONNABORTED,EAI_AGAINandEPIPEon GET, HEAD and OPTIONS. Nothing else is retried — a 500 is not, and neither isENOTFOUNDor a TLS failure. The retry wrapper recipe is for failures that persist past that. --jqJSON-encodes its output: strings come back with quotes around them. Pipe--jsonto externaljq -rwhen you need a raw string for the shell. See the JSON Output reference for the envelope structure of list-style commands.