DEV Community

Paul van der lei
Paul van der lei

Posted on

My AI Coding Agent Couldn't Read Bitbucket PRs, So I Fixed That

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

JSON output everywhere - critical for both scripting and AI agents:

bb pr list --json | jq '.[] | select(.state == "OPEN")'
Enter fullscreen mode Exit fullscreen mode

Standard npm install:

npm install -g @pilatos/bitbucket-cli
Enter fullscreen mode Exit fullscreen mode

What it covers

The daily stuff: authentication, repositories (clone, create, list, view, delete), and pull requests (create, list, view, edit, diff, merge, approve, decline, checkout).

What it doesn't have yet: pipelines, no issue tracker integration, no code search. 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.

And if you want to contribute - it's open source, TypeScript, clean architecture. Adding new commands is pretty straightforward. Pipeline support would be cool if anyone wants to tackle it.

GitHub: github.com/0pilatos0/bitbucket-cli
Docs: bitbucket-cli.paulvanderlei.com


Not affiliated with Atlassian. Just a dev who wanted his AI tools to actually work.

Top comments (0)