Why does Atlassian refuse to give us a decent Bitbucket CLI?
Since a native, developer-friendly tool was missing, I decided to stop complaining and actually build something. I put together a framework that parses their OpenAPI specification file and wraps the API endpoints into a functional CLI tool. The logic was simple: if the API documentation exists, there's no reason we should be forced to click through a sluggish web UI for every single PR or repository setting change.
The result is an unofficial Bitbucket CLI that actually works. It's not a polished corporate product, but it handles the heavy lifting I actually need in my daily AI workflow. By automating the interaction with the Bitbucket API, I can manage my repos without leaving the terminal, which is a non-negotiable for my productivity.
If you're stuck in a corporate environment where you can't switch providers, here is a practical tutorial on how I approached the deployment of this tool from scratch:
1. API Mapping: I started by pulling the full OpenAPI JSON from Bitbucket to identify which endpoints correspond to the most common CLI actions (listing PRs, checking build statuses, etc.).
2. Wrapper Logic: I wrote a parser that converts these API definitions into executable shell commands, handling the authentication headers automatically.
3. Authentication: The tool uses App Passwords to authenticate, ensuring you don't have to hardcode your main account credentials into the environment.
For those who want to see the implementation or try it out, the code is hosted here:
https://github.com/scr2em/bitbucket-cliIt's a raw, community-driven approach to a problem that should have been solved years ago. While it's unofficial, it proves that we don't have to settle for subpar tooling just because a vendor wants to upsell a specific AI agent or enterprise suite. It’s essentially a deep dive into how we can use OpenAPI specs to bridge the gap between a clunky UI and a streamlined terminal experience. Whether you're doing prompt engineering or standard backend dev, staying in the terminal is just faster.