Skip to content

Instantly share code, notes, and snippets.

@eins78
Created March 3, 2026 08:44
Show Gist options
  • Select an option

  • Save eins78/8798561f1ab7433a11df5fabea3393b7 to your computer and use it in GitHub Desktop.

Select an option

Save eins78/8798561f1ab7433a11df5fabea3393b7 to your computer and use it in GitHub Desktop.
bb CLI — source command renames + source diff

bb CLI — source command renames + source diff

Renamed listing commands to plural, reworked commits for dual mode, merged diffstat into diff --stat.

Before After
source branch source branches
source tag source tags
source commit [ref] source commits [ref] (list mode) / source commits <sha> (detail)
source diffstat <spec> source diff <spec> / source diff <spec> --stat

bb --help

$ bb --help
bb — Bitbucket Cloud CLI

Usage: bb <command> [flags]

Pull Requests:
  pr list             List pull requests
  pr view <id>        View a pull request
  pr create           Create a pull request
  pr edit <id>        Edit a pull request (reviewers, title, body)
  pr comment <id>     Comment on a pull request (create, resolve, unresolve)
  pr review <id>      Approve a pull request
  pr merge <id>       Merge a pull request
  pr close <id>       Decline a pull request
  pr tasks <id>       List, resolve, or reopen tasks
  pr diff <id>        Show PR diff (or --stat for summary)
  pr status           Show PRs you authored or are reviewing
  pr activity <id>    Show PR activity timeline

Source:
  source ls [path]    List files and directories
  source cat <path>   Print file contents
  source branches     List branches
  source tags         List tags
  source search <q>   Search code in the repository
  source commits [ref] List commits (or show one by SHA)
  source diff <spec>  Compare two refs (or --stat for summary)

source branches

$ bb source branches
NAME   TARGET   MESSAGE
  command-init                           9606ee6c9ebf  F add "init-agent" command
  feature/forms-with-webbloqs-skill      47443275b040  Applied suggestion to ...
  feature/jib-config-for-apple-silicone  3a01d2dae6d6  E: add maven config for apple silicone
  feature/prompt-challenger              b84b2e25d1c8  d Add prompt-challenger skill with documentation
  feature/styling-webbloqs-skill         94c19c349462  Applied suggestion to ...
  improve-bdd-skill                      f9b638a1277a  F Improve BDD skills based on expert practitioner feedback
* master                                 69fde8373142  Merged in feature/bb-cli (pull request #69)

source tags

$ bb source tags
No tags found

source commits (list mode)

$ bb source commits
HASH   DATE   AUTHOR   MESSAGE
69fde8373142  2026-03-02  Qubert        Merged in feature/bb-cli (pull request #69)
a72a74d8c1b4  2026-03-02  Qubert        Merged in feature/bb-source-commands (pull request #70)
c05c6c57c740  2026-03-02  Max Albrecht  D Strengthen bb CLI skill discovery and add prerequisite che
40b3ecb3b2ac  2026-03-02  Max Albrecht  B Fix missing write:repository:bitbucket scope in auth promp
74a75806b8af  2026-03-02  Max Albrecht  B Fix source commands for branches with slashes
c261c5ddd1ee  2026-03-02  Max Albrecht  B Fix bb_parse_remote for HTTPS URLs with usernames
6d3b5dc1fb78  2026-02-27  Qubert        F Add source command group to bb CLI (ls, cat, branch, tag)

source commits (single SHA)

$ bb source commits de127cb75689
Commit:   de127cb75689
Author:   Max Albrecht <max.albrecht@quatico.com>
Date:     2026-02-27T20:11:55+00:00
Parents:  6b79133a75b0, 735355df539b

Merged in skills-story-tracking-markdown (pull request #68)

F Add story-tracking and markdown skills

source diff

$ bb source diff de127cb75689..69fde8373142 | head -20
diff --git a/claude-code/README.md b/claude-code/README.md
index 92dc78d..ab50401 100644
--- a/claude-code/README.md
+++ b/claude-code/README.md
@@ -31,6 +31,7 @@ Reusable skills in `skills/`.
 | `implementing-bdd-scenarios` | Step definitions, ...
 | `jest-testing-conventions` | Jest unit testing: ...
 | `handling-pull-requests` | PR workflow guidance: ...
+| `working-with-bitbucket-api` | Bitbucket Cloud API via `bb` CLI — ...
 | `working-with-bitbucket-web` | Bitbucket web UI navigation ...

source diff --stat

$ bb source diff de127cb75689..69fde8373142 --stat
STATUS   ADDED   REMOVED   PATH
modified  +3     -1   claude-code/README.md
modified  +17    -11  claude-code/skills/handling-pull-requests/SKILL.md
added     +30    -0   claude-code/skills/working-with-bitbucket-api/README.md
added     +126   -0   claude-code/skills/working-with-bitbucket-api/SKILL.md
added     +1510  -0   claude-code/skills/working-with-bitbucket-api/bin/bb
added     +33    -0   claude-code/skills/working-with-bitbucket-api/install-dependencies.sh
modified  +11    -11  claude-code/skills/working-with-bitbucket-web/SKILL.md
modified  +3     -1   package.json

source search

$ bb source search "import" | head -5
REPO   FILE   MATCHES   LINES
config  claude-code/skills/shared-element-development/SKILL.md      5  52,53,54,...
config  checkstyle/checkstyle_sonar_quatico.xml                     3  0,1
config  claude-code/skills/jest-testing-conventions/SKILL.md        5  147,148,...
config  claude-code/skills/shared-element-development/REFERENCE.md  3  110,111,...

error: old command names

$ bb source branch
unknown source command: branch

$ bb source tag
unknown source command: tag

$ bb source diffstat main..develop
unknown source command: diffstat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment