Skip to content

Installation

There are two ways to install bb:

  • Standalone binary: one self-contained executable per platform, attached to each GitHub Release since v2.2.0. Needs no Bun, Node.js or npm.
  • Package manager: the npm package, which runs on the Bun runtime.

Either way, bb needs Git to detect the workspace and repository of the current directory.

The install script picks the binary for your platform, checks it against the release’s SHA256SUMS and installs it:

Terminal window
curl -fsSL https://github.com/0pilatos0/bitbucket-cli/releases/latest/download/install.sh | sh

Installs to ~/.local/bin/bb. Add that folder to your PATH if the script says it is missing.

Run the script again to update. These environment variables change what it does:

Variable Effect
BB_VERSION Install this version, e.g. 2.2.0, instead of the latest release
BB_INSTALL_DIR Install into this folder. On Windows, PATH is then left to you
BB_RELEASES_URL Download from a mirror of https://github.com/0pilatos0/bitbucket-cli/releases

For example, to install for all users:

Terminal window
curl -fsSL https://github.com/0pilatos0/bitbucket-cli/releases/latest/download/install.sh | sudo env BB_INSTALL_DIR=/usr/local/bin sh
Platform Binary Archive
Linux x64 bb-linux-x64 bb-linux-x64.tar.gz
Linux arm64 bb-linux-arm64 bb-linux-arm64.tar.gz
macOS Intel bb-darwin-x64 bb-darwin-x64.tar.gz
macOS Apple silicon bb-darwin-arm64 bb-darwin-arm64.tar.gz
Windows x64 bb-windows-x64.exe bb-windows-x64.zip

The archives hold the same binary, named bb (bb.exe on Windows), plus the license, and are less than half the download. Releases before they were added only have the raw binaries.

Each release also ships SHA256SUMS covering binaries and archives. Download the binary and the checksums, verify, then put the binary on your PATH:

Terminal window
asset=bb-linux-x64 # or bb-linux-arm64
base=https://github.com/0pilatos0/bitbucket-cli/releases/latest/download
curl -fsSLO "$base/$asset"
curl -fsSLO "$base/SHA256SUMS"
sha256sum --check --ignore-missing SHA256SUMS
chmod +x "$asset"
sudo mv "$asset" /usr/local/bin/bb

To pin a version, replace latest/download with download/v<version>.

Every binary and archive carries a build provenance attestation that proves it was built by this repository’s release workflow. Check it with the GitHub CLI:

Terminal window
gh attestation verify bb-linux-x64 --repo 0pilatos0/bitbucket-cli

The npm package runs on the Bun runtime 1.1.30 or newer, not Node.js. Install Bun if bun --version fails:

Terminal window
curl -fsSL https://bun.sh/install | bash

On Windows, --jq requires Bun 1.4.2 or newer. With Bun 1.3.14, it can print the result and then fail to exit.

For other platforms and install methods, see bun.sh. Then install the CLI with any package manager:

Terminal window
npm install -g @pilatos/bitbucket-cli
Terminal window
# Clone the repository
git clone https://github.com/0pilatos0/bitbucket-cli.git
cd bitbucket-cli
# Install dependencies
bun install
# Build
bun run build
# Link globally
bun link
Terminal window
bb --version

Update bb the same way you installed it.

  • Standalone binary: repeat the download steps and replace the old binary. They fetch the latest release.

  • Package manager: install the latest version with the package manager you used: npm install -g @pilatos/bitbucket-cli@latest, pnpm add -g @pilatos/bitbucket-cli@latest, or bun install -g @pilatos/bitbucket-cli@latest.

  • Built from source: pull and rebuild in your clone. The bun link from the first install still points at it.

    Terminal window
    git pull
    bun install
    bun run build

Run bb --version to confirm the new version.

Sign out and remove shell completion first, while bb is still installed:

Terminal window
bb auth logout # revokes an OAuth token and deletes stored credentials
bb completion uninstall # only if you installed completion

bb auth logout does not revoke API tokens. Delete those in your Bitbucket API token settings.

Then remove the CLI:

  • Standalone binary: delete the binary, for example sudo rm /usr/local/bin/bb, or bb.exe on Windows.
  • Package manager: npm uninstall -g @pilatos/bitbucket-cli, pnpm remove -g @pilatos/bitbucket-cli, or bun remove -g @pilatos/bitbucket-cli.
  • Built from source: run bun unlink in your clone, then delete the clone.

Finally, delete the configuration directory, which holds your settings and aliases: ~/.config/bb on macOS and Linux, %APPDATA%\bb on Windows.

Authenticate with your Bitbucket account.

Then install shell completion so your shell can complete bb subcommands and flags.