PR Commands
Manage pull requests (PRs) in Bitbucket repositories. New here? Start with Create, edit, and view.
Global options work on every PR command: --json [fields], --jq <expression>, --no-color, --no-unicode, --no-truncate, --locale <locale>, -w, --workspace, -r, --repo — see Global Flags.
Command groups
Section titled “Command groups”Most-used commands
Section titled “Most-used commands”| Task | Command |
|---|---|
| Create a PR | bb pr create -t "Add feature" |
| Create a PR with the repository’s default reviewers | bb pr create -t "Add feature" --default-reviewers |
| List open PRs | bb pr list |
| List all PRs (ignore the default limit) | bb pr list --all |
| List PRs where you are a reviewer | bb pr list --mine |
| View PR details | bb pr view 42 |
| View checks | bb pr checks 42 |
| Review diff | bb pr diff 42 --stat |
| Checkout PR locally | bb pr checkout 42 |
| Approve PR | bb pr approve 42 |
| Merge PR | bb pr merge 42 --strategy squash |
JSON for automation
Section titled “JSON for automation”List commands wrap their results in an envelope. Bare bb pr list --json returns {workspace, repoSlug, state, filters, count, pullRequests}, so a --jq filter starts at .pullRequests[]. Adding a field list (--json id,title) drops the envelope and returns a flat array, so the filter starts at .[] instead. Single-PR commands like bb pr view return the PR object itself, with no envelope.
# Project to specific fields (returns a flat array)bb pr list --json id,title,author.display_name
# Filter with built-in --jqbb pr list --json --jq '.pullRequests[] | select(.state == "OPEN") | .title'
# Combine projection + filter (jq runs after projection)bb pr list --json id,title,state --jq '.[] | select(.state == "OPEN") | .title'
# Grab a PR URL from view outputbb pr view 42 --json --jq '.links.html.href'
# Capture diffstat totalsbb pr diff 42 --stat --json --jq '{filesChanged, totalAdditions, totalDeletions}'--json <fields> misfires on bb pr create, bb pr edit and bb pr view — see Create, Edit, and View PRs for why, and JSON Output for the full reference.