# Add to your Claude Code skills
git clone https://github.com/avivsinai/bitbucket-cliGuides for using ai agents skills like bitbucket-cli.
bitbucket-cli is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by avivsinai. Bitbucket CLI with gh-like ergonomics. It has 269 GitHub stars.
bitbucket-cli's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/avivsinai/bitbucket-cli" and add it to your Claude Code skills directory (see the Installation section above).
bitbucket-cli is primarily written in Go. It is open-source under avivsinai on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh bitbucket-cli against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
bkt is one command-line interface for Bitbucket Cloud and Bitbucket Data Center. It follows the ergonomics of gh, gives every command a stable JSON/YAML output contract, and ships an agent skill and an MCP server so coding agents can work with Bitbucket too.
This project (github.com/avivsinai/bitbucket-cli, binary bkt) is unrelated to the Rust bkt subprocess-caching tool, the Bitbucket Enterprise CLI, and other packages named bitbucket-cli.
brew install bitbucket-cli
# Bitbucket Cloud: log in through your browser
bkt auth login https://bitbucket.org --kind cloud --web
bkt context create cloud --host api.bitbucket.org --workspace myteam --set-active
# Bitbucket Data Center: paste a Personal Access Token
bkt auth login https://bitbucket.example.com --web-token
bkt context create dc --host bitbucket.example.com --project ABC --set-active
bkt pr list --mine
bkt pr create --title "feat: cache" --source feature/cache --target main
Inside a clone, bkt takes the workspace or project and the repository from the git remote when the remote points at the active context's host.
| Platform | Command |
|---|---|
| macOS / Linux (Homebrew core) | brew install bitbucket-cli |
| Windows (WinGet) | winget install AvivSinai.Bitbucket-CLI |
| Windows (Scoop) | scoop bucket add avivsinai https://github.com/avivsinai/scoop-bucketscoop install bitbucket-cli |
| Go 1.26+ | go install github.com/avivsinai/bitbucket-cli/cmd/bkt@latest |
| Nix (flakes) | nix profile install github:avivsinai/bitbucket-cli |
| Debian / Ubuntu | .deb from the latest release |
| Any | Archive from the latest release |
Every install method supports Bitbucket Cloud browser login with no extra setup.
brew install avivsinai/tap/bitbucket-cli installs the prebuilt release binary, signed with a Developer ID and notarized, instead of Homebrew's source build. Both provide the same bkt command, so install only one.nix run github:avivsinai/bitbucket-cli -- --version runs master without installing. Append a ref, such as github:avivsinai/bitbucket-cli/v0.36.0, to pin a release.skills/bkt/, so the CLI and its agent skill stay on one version.checksums.txt, a CycloneDX SBOM, and GitHub build provenance: gh attestation verify <archive> --repo avivsinai/bitbucket-cli.git clone https://github.com/avivsinai/bitbucket-cli && cd bitbucket-cli && make build produces ./bin/bkt.bkt auth login checks a credential against the host before it stores it. bkt auth status lists your hosts and when OAuth tokens expire.
Browser OAuth (recommended). bkt opens Bitbucket in your browser. After you approve access, bkt stores a short-lived access token and refreshes it automatically:
bkt auth login https://bitbucket.org --kind cloud --web
To use your own OAuth consumer instead of bkt's, set both BKT_OAUTH_CLIENT_ID and BKT_OAUTH_CLIENT_SECRET before you log in.
API token. --web-token opens Atlassian's token page, then prompts for the token:
bkt auth login https://bitbucket.org --kind cloud --web-token
# or non-interactively
bkt auth login https://bitbucket.org --kind cloud --username <atlassian-email> --with-token < token.txt
Create the token under Atlassian account → Security → API tokens with Create API token with scopes. Choose Bitbucket as the app (general Atlassian tokens do not work) and grant:
read:user:bitbucket), requiredbkt repo createbkt pipeline, bkt variable, or bkt webhookLog in with your Atlassian account email, not your Bitbucket username. Atlassian has removed app passwords; replace any you still use with an API token.
bkt auth login https://bitbucket.example.com --web-token
# or non-interactively
bkt auth login https://bitbucket.example.com --username alice --with-token < pat.txt
Create the Personal Access Token under Profile picture → Manage account → Personal access tokens with Repository Read/Write and Project Read.
Tokens live in the OS keychain: macOS Keychain, Windows Credential Manager, or Secret Service/KWallet on Linux. Host metadata lives in config.yml in the bkt config directory (~/Library/Application Support/bkt on macOS, %AppData%\bkt on Windows, $XDG_CONFIG_HOME/bkt or ~/.config/bkt on Linux) and never contains a token.
--allow-insecure-store or set BKT_ALLOW_INSECURE_STORE=1 to use an encrypted file instead.BKT_KEYRING_TIMEOUT, for example BKT_KEYRING_TIMEOUT=2m.bkt collection. Set BKT_KEYRING_COLLECTION to your provider's default collection (for example kdewallet) to share the wallet you already unlocked. Add credentials stored under the old collection again. Distributors can set the default at build time with -ldflags -X github.com/avivsinai/bitbucket-cli/internal/secret.defaultKeyringCollection=<collection>; the environment variable still wins.bkt auth doctor explains prompts that persist; it never reads the stored secret.Set BKT_TOKEN and BKT_HOST, and bkt needs no login and no config file:
# Data Center
export BKT_HOST=https://bitbucket.example.com BKT_TOKEN=<pat> BKT_PROJECT=MYPROJ BKT_REPO=my-service
# Cloud, user API token (basic auth)
export BKT_HOST=https://bitbucket.org BKT_TOKEN=<api-token> [email protected] \
BKT_WORKSPACE=my-workspace BKT_REPO=my-repo
# Cloud, repository / project / workspace access token (bearer auth)
export BKT_HOST=https://bitbucket.org BKT_TOKEN=<access-token> BKT_AUTH_METHOD=bearer
bkt pr list
When BKT_HOST is set, BKT_TOKEN is used for that host only. The pair wins over an active context that points at another host, and bkt refuses to send the token to a different host named with --context or --host.
Resource access tokens belong to no user. Commands that need a user identity, such as bkt pr list --mine across repositories, still need a user API token or OAuth.
In Bitbucket Pipelines, store BKT_TOKEN and BKT_HOST as secured repository variables and install a pinned release:
pipelines:
default:
- step:
name: Open PR
script:
- export BKT_VERSION=0.36.0 # pin the release you have tested
- curl -fsSL "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"
| Variable | Purpose |
|---|---|
BKT_TOKEN |
Token for every request; bypasses the keychain. |
BKT_HOST |
Base URL, for example https://bitbucket.example.com. bitbucket.org selects Cloud. |
BKT_USERNAME |
Username for basic auth. Required for Cloud user API tokens. |
BKT_AUTH_METHOD |
basic or bearer. Data Center defaults to bearer without BKT_USERNAME; Cloud defaults to basic. |
BKT_PROJECT / BKT_WORKSPACE / BKT_REPO |
Default Data Center project, Cloud workspace, and repository. |
BKT_CONFIG_DIR |
Config directory (default: the per-OS location above). |
BKT_OAUTH_CLIENT_ID / BKT_OAUTH_CLIENT_SECRET |
Your own Bitbucket Cloud OAuth consumer for --web; set both. |
BKT_ALLOW_INSECURE_STORE |
1 allows the encrypted file store when no keychain exists. |
BKT_KEYRING_TIMEOUT |
Keychain operation timeout, for example 2m. |
BKT_KEYRING_COLLECTION |
Secret Service collection (Linux). |
BKT_HTTP_DEBUG |
1 logs each request URL and response st |