PHPackages                             jeffersongoncalves/bb-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. jeffersongoncalves/bb-cli

ActiveProject[CLI &amp; Console](/categories/cli)

jeffersongoncalves/bb-cli
=========================

A modern Bitbucket Cloud CLI built with Laravel Zero. Manage pull requests, pipelines, branches, environments, and more from your terminal.

v1.2.3(1w ago)49↓93.8%MITPHPPHP ^8.2CI passing

Since Feb 23Pushed 1w ago1 watchersCompare

[ Source](https://github.com/jeffersongoncalves/bb-cli)[ Packagist](https://packagist.org/packages/jeffersongoncalves/bb-cli)[ Docs](https://github.com/jeffersongoncalves/bb-cli)[ RSS](/packages/jeffersongoncalves-bb-cli/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (27)Versions (9)Used By (0)

[![BB CLI](https://raw.githubusercontent.com/jeffersongoncalves/bb-cli/main/art/jeffersongoncalves-bb-cli.png)](https://raw.githubusercontent.com/jeffersongoncalves/bb-cli/main/art/jeffersongoncalves-bb-cli.png)

BB CLI
======

[](#bb-cli)

A modern Bitbucket Cloud CLI built with [Laravel Zero](https://laravel-zero.com/).

 [![Tests](https://github.com/jeffersongoncalves/bb-cli/actions/workflows/run-tests.yml/badge.svg)](https://github.com/jeffersongoncalves/bb-cli/actions) [![Build](https://github.com/jeffersongoncalves/bb-cli/actions/workflows/build.yml/badge.svg)](https://github.com/jeffersongoncalves/bb-cli/actions) [![Total Downloads](https://camo.githubusercontent.com/e4f49c1b063202a31ea89a2a4c53a9e000950285a43515cba2bd24e9723875f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6566666572736f6e676f6e63616c7665732f62622d636c69)](https://packagist.org/packages/jeffersongoncalves/bb-cli) [![License](https://camo.githubusercontent.com/78742531cfc37b0a7043636b379a1a35136c741f746886fd6b5bdbf8c3412d9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6566666572736f6e676f6e63616c7665732f62622d636c69)](https://github.com/jeffersongoncalves/bb-cli/blob/main/LICENSE) [![PHP 8.2+](https://camo.githubusercontent.com/8f0af9c5395ae4ef8ba7a7ad65fa61c44927ea9c3eb3be91a13c678254f29bd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d383839324246)](https://camo.githubusercontent.com/8f0af9c5395ae4ef8ba7a7ad65fa61c44927ea9c3eb3be91a13c678254f29bd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d383839324246)

Features
--------

[](#features)

- **Pull Requests** - Create, list, approve, merge, decline, diff, and manage PRs
- **Pipelines** - Trigger, monitor, and wait for CI/CD pipelines
- **Branches** - List and filter branches by name or author
- **Environments** - Manage deployment environments and variables
- **Authentication** - Secure credential storage with API tokens
- **Browse** - Open repositories in the browser from the terminal
- **Auto-detection** - Automatically detects workspace/repo from git remote

Requirements
------------

[](#requirements)

- PHP 8.2+
- Git

Installation
------------

[](#installation)

```
composer global require jeffersongoncalves/bb-cli
```

Or clone and build locally:

```
git clone https://github.com/jeffersongoncalves/bb-cli.git
cd bb-cli
composer install
php bb app:build bb
```

Getting Started
---------------

[](#getting-started)

### 1. Create a Bitbucket API Token

[](#1-create-a-bitbucket-api-token)

1. Go to your Bitbucket **Account settings** &gt; **Security** &gt; **[API tokens](https://support.atlassian.com/bitbucket-cloud/docs/api-tokens/)**
2. Click **Create API token with scopes**
3. Name the token (e.g. `bb-cli`) and set an expiry date
4. Select **Bitbucket** as the app and grant the following [permissions](https://support.atlassian.com/bitbucket-cloud/docs/api-token-permissions/):

> **Note:** In Bitbucket API tokens, Write does **not** imply Read — each permission must be granted separately.

ScopePermissionScope IDRequired for**Repositories**Read`read:repository:bitbucket`List branches, browse source code**Pull Requests**Read`read:pullrequest:bitbucket`View and list PRs, diffs, commits**Pull Requests**Write`write:pullrequest:bitbucket`Create, approve, merge, decline PRs**Pipelines**Read`read:pipeline:bitbucket`View pipeline status and logs**Pipelines**Write`write:pipeline:bitbucket`Trigger and stop pipelines**Pipelines**Admin`admin:pipeline:bitbucket`Manage environment variables5. Click **Create token** and **copy it immediately** — it will only be shown once

> **Migrating from App Passwords?** API tokens are the [long-term replacement](https://support.atlassian.com/bitbucket-cloud/docs/api-tokens/) for App Passwords. Simply run `bb auth:save` again with your new API token — existing `config.json` files using the old `app_password` format are still supported.
>
> **Important:** API tokens require your **Atlassian account email** for API authentication, not your Bitbucket username. Your email can be found in Bitbucket under **Personal settings** &gt; **Email Aliases**.

### 2. Save your credentials

[](#2-save-your-credentials)

```
bb auth:save
```

You will be prompted for your Atlassian account email and API token.

### 3. Verify authentication

[](#3-verify-authentication)

```
bb auth:show
```

### 4. Start using commands

[](#4-start-using-commands)

```
bb pr:list
bb pipeline:latest
bb browse
```

> All commands auto-detect the repository from your git remote. Use `--project=owner/repo` to override.

Commands
--------

[](#commands)

### Authentication

[](#authentication)

CommandDescription`auth:save`Save Bitbucket credentials (email and API token)`auth:show`Display saved credentials### Pull Requests

[](#pull-requests)

CommandDescription`pr:list`List pull requests (filter by `--state` and `--destination`)`pr:create  [destination]`Create a new pull request`pr:approve `Approve a PR (use `0` to approve all open PRs)`pr:unapprove `Remove approval from a PR`pr:request-changes `Request changes on a PR`pr:unrequest-changes `Remove change request from a PR`pr:merge `Merge a PR (`--strategy=merge_commit|squash|fast_forward`)`pr:decline `Decline a PR`pr:commits `List commits in a PR`pr:diff `Display the diff of a PR`pr:files `List changed files in a PR### Pipelines

[](#pipelines)

CommandDescription`pipeline:latest`Get the latest pipeline status`pipeline:get `Get pipeline details by UUID or build number`pipeline:run `Trigger a pipeline for a branch`pipeline:custom  `Trigger a custom pipeline`pipeline:wait [id]`Wait for a pipeline to complete with live status### Branches

[](#branches)

CommandDescription`branch:list`List all repository branches`branch:name `Filter branches by name pattern`branch:user `List branches by a specific author### Environments

[](#environments)

CommandDescription`env:list`List deployment environments`env:variables `List variables for an environment`env:create-variable `Create an environment variable`env:update-variable `Update an environment variable### Browse

[](#browse)

CommandDescription`browse`Open repository in the browser`browse:show`Display repository URLGlobal Options
--------------

[](#global-options)

OptionDescription`--project=owner/repo`Override auto-detected repository`--help`Show command help`-v`Verbose outputDevelopment
-----------

[](#development)

```
# Install dependencies
composer install

# Run tests
composer test

# Run tests only
composer test:unit

# Code formatting
composer lint

# Static analysis
composer phpstan
```

License
-------

[](#license)

BB CLI is open-source software licensed under the [MIT license](LICENSE).

###  Health Score

44

↑

FairBetter than 90% of packages

Maintenance98

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Recently: every ~30 days

Total

6

Last Release

10d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/411493?v=4)[Jefferson Gonçalves](/maintainers/jeffersongoncalves)[@jeffersongoncalves](https://github.com/jeffersongoncalves)

---

Top Contributors

[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (74 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

bitbucketbitbucket-apibitbucket-cloudclicommand-line-tooldevtoolslaravel-zeropharphppipelinespull-requestscliDevtoolslaravel-zerobitbucketpipelinepull-requestbitbucket-cloudbitbucket-api

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jeffersongoncalves-bb-cli/health.svg)

```
[![Health](https://phpackages.com/badges/jeffersongoncalves-bb-cli/health.svg)](https://phpackages.com/packages/jeffersongoncalves-bb-cli)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.7k357.7M11.1k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

819430.4k54](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2592.3M13](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

672.3M4](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16458.3k8](/packages/nunomaduro-laravel-console-dusk)[mehrancodes/laravel-harbor

A CLI tool to Quickly create On-Demand preview environment for your apps.

10097.5k](/packages/mehrancodes-laravel-harbor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
