My AI Coding Agent Couldn't Read Bitbucket PRs, So I Fixed That
Source: Dev.to
Overview
Here’s a frustrating thing I ran into.
I’m using Claude Code (Anthropic’s terminal‑based coding agent) and it’s genuinely helpful. It can run commands, read files, and help me work through problems. When I was on a GitHub project, it could even check PR status and help with reviews using gh pr view and friends.
Then I switched to a Bitbucket project, and suddenly my AI assistant was blind. “Sorry, I can’t access that” over and over. No CLI tool meant no way to get PR diffs, check statuses, or do any of the Git platform stuff that makes AI‑assisted development actually flow.
So I built one.
What it is
A gh‑style CLI for Bitbucket Cloud. Nothing fancy, just the thing that was missing:
# authenticate once
bb auth login
# now your terminal (and any AI agent) can interact with Bitbucket
bb pr list
bb pr view 42
bb pr diff 42
bb repo list
Now when I ask Claude Code “can you check the open PRs and summarize them”, it actually can. It runs bb pr list --json, parses the output, and gives me what I need. Same with “review the diff on PR #15” – it runs bb pr diff 15 and we’re in business.
The stuff that matters
Context detection
If you’re in a git repo with a Bitbucket remote, it figures out the workspace and repo automatically:
cd my-bitbucket-project
bb pr list # just works, no flags needed
JSON output everywhere
Critical for both scripting and AI agents:
bb pr list --json | jq '.[] | select(.state == "OPEN")'
Standard npm install
npm install -g @pilatos/bitbucket-cli
What it covers
- Authentication
- Repositories: clone, create, list, view, delete
- Pull requests: create, list, view, edit, diff, merge, approve, decline, checkout
What it doesn’t have yet: pipelines, issue‑tracker integration, code search. It covers the 80 % use case, basically.
Why I’m sharing this
If you’re using AI coding tools on Bitbucket projects and hitting the same wall I did, this exists now.
If you want to contribute – it’s open source, TypeScript, clean architecture. Adding new commands is straightforward. Pipeline support would be cool if anyone wants to tackle it.
- GitHub:
- Docs:
Not affiliated with Atlassian. Just a dev who wanted his AI tools to actually work.