bkt – Bitbucket CLI
Bitbucket Cloud & Data Center workflows for developers, coding agents, and automation-first teams.

bkt is a stand-alone Bitbucket command-line interface that targets Bitbucket Data Center and Bitbucket Cloud. It mirrors the ergonomics of gh and delivers a consistent JSON/YAML contract for automation.
Built for AI & automation: Drop bkt into Claude Code, Codex and other coding agents, or shell scripts and they inherit structured output, predictable flags, and safe defaults—no glue code required.
Installation
Homebrew (macOS/Linux)
brew install avivsinai/tap/bitbucket-cli
Scoop (Windows)
scoop bucket add avivsinai https://github.com/avivsinai/scoop-bucket
scoop install bitbucket-cli
Go Install
go install github.com/avivsinai/bitbucket-cli/cmd/bkt@latest
This installs bkt to $GOPATH/bin (or $HOME/go/bin by default). Ensure the directory is in your $PATH.
Nix (NixOS / nix-darwin / Linux / macOS)
Run the latest master without installing:
nix run github:avivsinai/bitbucket-cli -- --version
Install into your user profile:
nix profile install github:avivsinai/bitbucket-cli
Pin to a specific tag or commit by appending a ref (e.g. github:avivsinai/bitbucket-cli/v1.2.3).
Don't have Nix yet? See nixos.asia/en/install for a quick setup guide (installs Nix with flakes enabled out of the box).
Binary Downloads
Download pre-built binaries for your platform from the releases page.
The .tar.gz and .zip release archives also include skills/bkt/, so the CLI and canonical skill files stay in sync when you install from a release artifact.
Official binaries support Bitbucket Cloud OAuth (bkt auth login --kind cloud --web) out of the box. Source and Nix builds can use the same flow by setting BKT_OAUTH_CLIENT_ID and BKT_OAUTH_CLIENT_SECRET in the environment. API-token login via --web-token works without that extra setup.
Bitbucket Pipelines
bkt supports fully config-free headless use via environment variables. Set BKT_TOKEN and BKT_HOST as secured repository variables — no prior bkt auth login or bkt context create step required.
pipelines:
default:
- step:
name: Open PR
script:
- export BKT_VERSION="0.26.0" # pin to a released version
- curl -sL "https://github.com/avivsinai/bitbucket-cli/releases/download/v${BKT_VERSION}/bkt_${BKT_VERSION}_linux_x86_64.tar.gz" | tar xz -C /tmp && install /tmp/bkt /usr/local/bin/
- bkt pr create --title "Auto PR" --source "$BITBUCKET_BRANCH"
Environment Variables
All bkt behaviour can be configured via environment variables, which is especially useful in containers and CI/CD pipelines.