Skip to content

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.

  • All recipes assume bb auth login has already succeeded — interactively, or via the BB_USERNAME and BB_API_TOKEN env vars.
  • WORKSPACE and REPO are 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 --all wherever a recipe has to see every result — the Showing 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_AGAIN and EPIPE on GET, HEAD and OPTIONS. Nothing else is retried — a 500 is not, and neither is ENOTFOUND or a TLS failure. The retry wrapper recipe is for failures that persist past that.
  • --jq JSON-encodes its output: strings come back with quotes around them. Pipe --json to external jq -r when you need a raw string for the shell. See the JSON Output reference for the envelope structure of list-style commands.