Reference

CLI reference

bitbucket-cli browses repositories, drives the full pull-request review and merge lifecycle, posts inline review comments, and queries branches and commits. It supports Bitbucket Cloud and Data Center / Server, and emits agent-friendly JSON with structured errors.

Generated from the command tree, so it always matches --help.

Global flags

Persistent flags accepted by every command.

FlagDefaultDescription
--allow-writesfalseoverride read-only mode (defaults.read_only / BITBUCKET_CLI_READ_ONLY) for this invocation
--base-urlBitbucket site URL (overrides config)
--configconfig directory (default ~/.angelmsger/bitbucket, falling back to ~/.bitbucket when only that exists)
--fieldscomma-separated dot-path fields to keep
--flavorbackend flavor: cloud, datacenter or auto
--format, -foutput format: json, table or ndjson
--prettyfalsehuman-friendly mode: interactive TUI in `config init`, colorized JSON elsewhere
--timeoutrequest timeout, e.g. 30s
--use-contextuse a named context for this invocation
--verbose, -vfalseverbose diagnostics on stderr

bitbucket-cli authcommand group

Inspect and manage stored credentials

bitbucket-cli auth

bitbucket-cli auth login

Store a credential for the configured server

bitbucket-cli auth login

Prompt for a secret and store it securely. Run `config init --pretty` first if the server URL is not set.

Examples

  bitbucket-cli auth login
  bitbucket-cli --use-context staging auth login

bitbucket-cli auth logout

Remove the stored credential for the configured server

bitbucket-cli auth logout

bitbucket-cli auth status

Show whether a usable credential is configured

bitbucket-cli auth status

bitbucket-cli branchcommand group

List and manage repository branches

bitbucket-cli branch

bitbucket-cli branch create

Create a branch from a starting ref

bitbucket-cli branch create <name> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview without sending
--from-refstarting ref (branch name or commit hash)
--repo<workspace>/<repo>

bitbucket-cli branch delete

Delete a branch

bitbucket-cli branch delete <name> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--repo<workspace>/<repo>
--yesfalseconfirm the deletion

bitbucket-cli branch get

Show a single branch

bitbucket-cli branch get <name> [flags]

Options

FlagDefaultDescription
--repo<workspace>/<repo>

bitbucket-cli branch list

List branches in a repository

bitbucket-cli branch list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryfilter by name substring
--repo<workspace>/<repo>
--sortsort key

bitbucket-cli commentcommand group

Read and write pull-request comments

bitbucket-cli comment

bitbucket-cli comment add

Add a comment on a PR (general or inline)

bitbucket-cli comment add [flags]

Options

FlagDefaultDescription
--contentcomment body (Markdown)
--content-fileread content from this file
--dry-runfalsepreview the HTTP request without sending it
--inlineinline anchor as <path>:<line>
--pr<workspace>/<repo>/<id> or PR URL
--reply-to0reply to this comment ID

bitbucket-cli comment delete

Delete a comment

bitbucket-cli comment delete <comment-id> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--pr<workspace>/<repo>/<id> or PR URL
--yesfalseconfirm the deletion

bitbucket-cli comment list

List comments on a PR

bitbucket-cli comment list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--pr<workspace>/<repo>/<id> or PR URL

bitbucket-cli comment update

Edit a comment

bitbucket-cli comment update <comment-id> [flags]

Options

FlagDefaultDescription
--contentnew content (Markdown)
--dry-runfalsepreview the HTTP request without sending it
--pr<workspace>/<repo>/<id> or PR URL

bitbucket-cli commitcommand group

Query commits in a repository

bitbucket-cli commit

bitbucket-cli commit compare

List the commits between two refs

bitbucket-cli commit compare [flags]

Options

FlagDefaultDescription
--fromexclude commits reachable from this ref
--repo<workspace>/<repo>
--toinclude commits reachable from this ref

bitbucket-cli commit get

Show a single commit

bitbucket-cli commit get <hash> [flags]

Options

FlagDefaultDescription
--repo<workspace>/<repo>

bitbucket-cli commit list

List commits in a repository

bitbucket-cli commit list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--branchbranch or ref to walk from
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--pathfilter to commits touching this path
--repo<workspace>/<repo>
--sinceearliest commit date
--untillatest commit date

bitbucket-cli configcommand group

Manage bitbucket-cli configuration

bitbucket-cli config

bitbucket-cli config delete-context

Delete a context and its stored credential

bitbucket-cli config delete-context <name>

Examples

  bitbucket-cli config delete-context staging

bitbucket-cli config get-contexts

List the configured contexts

bitbucket-cli config get-contexts

List every context in the config file. The current context — the one used when --use-context is not given — is marked.

Examples

  bitbucket-cli config get-contexts
  bitbucket-cli config get-contexts --format table

bitbucket-cli config init

Interactively set up server URL and credentials

bitbucket-cli config init

Run the interactive setup wizard. It collects a server URL, detects the flavor, validates a credential and stores it. The wizard can also configure additional named contexts for working with several servers.

Examples

  bitbucket-cli config init --pretty   # interactive TUI (recommended)
  bitbucket-cli config init             # plain line-by-line wizard (scripts, non-TTY)

bitbucket-cli config path

Print the config file path

bitbucket-cli config path

bitbucket-cli config show

Show the resolved configuration

bitbucket-cli config show [flags]

Options

FlagDefaultDescription
--explainfalseannotate each value with its source

bitbucket-cli config use-context

Switch the current context

bitbucket-cli config use-context <name>

Set the current context — the server used by default. Override it for a single command with the global --use-context flag instead.

Examples

  bitbucket-cli config use-context staging

bitbucket-cli doctor

Diagnose configuration, credentials and connectivity

bitbucket-cli doctor [flags]

Options

FlagDefaultDescription
--no-update-checkfalseskip the check for a newer bitbucket-cli release

Examples

  bitbucket-cli doctor
  bitbucket-cli doctor --no-update-check

bitbucket-cli filecommand group

Browse and read repository source files at any ref

bitbucket-cli file

bitbucket-cli file get

Read a file's raw contents at a ref

bitbucket-cli file get <workspace>/<repo> [flags]

Options

FlagDefaultDescription
--outputwrite raw bytes to this file; `-` for stdout
--pathfile path within the repo (required)
--range1-based inclusive line range, e.g. 10:40 (client-side slicing)
--refbranch / tag / commit (default: repository default branch)

bitbucket-cli file list

List entries under a repository path at a ref

bitbucket-cli file list <workspace>/<repo> [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--pathpath within the repo to list (empty = root)
--refbranch / tag / commit (default: repository default branch)

bitbucket-cli file tree

Recursively list files under a path at a ref

bitbucket-cli file tree <workspace>/<repo> [flags]

Options

FlagDefaultDescription
--depth0maximum depth from --path (0 = unlimited)
--pathsubtree root (empty = repo root)
--refbranch / tag / commit (default: repository default branch)

bitbucket-cli prcommand group

Drive Bitbucket pull requests (list, review, merge)

bitbucket-cli pr

bitbucket-cli pr activity

List the activity timeline of a PR

bitbucket-cli pr activity <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)

bitbucket-cli pr approve

Approve a PR

bitbucket-cli pr approve <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it

bitbucket-cli pr checkout

Print (or run, with --exec) git fetch + checkout for a PR

bitbucket-cli pr checkout <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--branchpr/%dlocal branch name format; %d is replaced with the PR id
--execfalseactually run the git commands in the current working directory
--remoteorigingit remote name to fetch from

bitbucket-cli pr commits

List commits included in a PR

bitbucket-cli pr commits <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)

bitbucket-cli pr create

Open a new pull request

bitbucket-cli pr create [flags]

Options

FlagDefaultDescription
--close-source-branchfalseclose the source branch on merge
--descriptionPR description (Markdown)
--description-fileread description from this file
--dry-runfalsepreview the HTTP request without sending it
--repo<workspace>/<repo>
--reviewer[]reviewer UUID (Cloud) or username (DC); repeatable
--sourcesource branch
--source-repocross-repo source (Cloud forks): <ws>/<repo>
--targetdestination branch (default: repo default)
--titlePR title

bitbucket-cli pr decline

Decline (close without merging) a PR

bitbucket-cli pr decline <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--messagedecline message
--yesfalseconfirm declining

bitbucket-cli pr diff

Print the unified diff of a PR (use --path to scope to one file)

bitbucket-cli pr diff <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--pathrestrict the diff to a single file path

bitbucket-cli pr fetch

Print (or run, with --exec) git fetch for a PR's source ref

bitbucket-cli pr fetch <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--execfalseactually run `git fetch` in the current working directory
--remoteorigingit remote name to fetch from

bitbucket-cli pr files

List changed files in a PR (diffstat: path / status / added / removed)

bitbucket-cli pr files <workspace>/<repo>/<id>

bitbucket-cli pr get

Show a pull request

bitbucket-cli pr get <workspace>/<repo>/<id> | <url> [flags]

Options

FlagDefaultDescription
--scopesummarysummary | full | diff | commits | activity

bitbucket-cli pr inbox

List PRs involving me across repositories (--role reviewer by default)

bitbucket-cli pr inbox [flags]

List pull requests involving the authenticated user across every accessible repository. Data Center uses the dashboard endpoint — a single call covers every project. Bitbucket Cloud has no global reviewer index, so --role reviewer (and --role participant) require --workspace; --role author works globally via the user's `/pullrequests/<uuid>` endpoint.

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--rolereviewerreviewer | author | participant
--stateOPENOPEN | MERGED | DECLINED | ALL
--workspaceCloud workspace to scope reviewer / participant queries to (ignored on Data Center)

bitbucket-cli pr list

List pull requests in a repository

bitbucket-cli pr list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--authorfilter by author username
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryserver-side filter (Cloud `q=`)
--repo<workspace>/<repo> or Bitbucket repo URL
--reviewerfilter by reviewer username
--sourcefilter by source branch
--stateOPENOPEN | MERGED | DECLINED | ALL
--targetfilter by destination branch

bitbucket-cli pr merge

Merge a PR

bitbucket-cli pr merge <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--close-source-branchfalseclose the source branch after merging
--dry-runfalsepreview the HTTP request without sending it
--messagemerge commit message
--strategymerge_commitmerge_commit | squash | fast_forward
--yesfalseconfirm the merge

bitbucket-cli pr request-changes

Cast (or withdraw) a request-changes vote (Cloud only)

bitbucket-cli pr request-changes <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--withdrawfalsewithdraw a previous request-changes vote

bitbucket-cli pr status

Show merge readiness: mergeable, conflicts, reviewers, CI builds

bitbucket-cli pr status <workspace>/<repo>/<id>

bitbucket-cli pr threads

List PR review threads grouped by file and anchor

bitbucket-cli pr threads <workspace>/<repo>/<id>

bitbucket-cli pr unapprove

Withdraw an approval

bitbucket-cli pr unapprove <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it

bitbucket-cli pr update

Edit a PR's title, description, or reviewers

bitbucket-cli pr update <workspace>/<repo>/<id> [flags]

Options

FlagDefaultDescription
--descriptionnew description
--dry-runfalsepreview the HTTP request without sending it
--reviewer[]replace reviewer list (repeatable)
--titlenew title

bitbucket-cli repocommand group

Browse and manage Bitbucket repositories

bitbucket-cli repo

bitbucket-cli repo clone-url

Print the HTTPS or SSH clone URL of a repository

bitbucket-cli repo clone-url <workspace>/<repo> | <url> [flags]

Options

FlagDefaultDescription
--protocolhttpshttps or ssh

bitbucket-cli repo create

Create a repository

bitbucket-cli repo create <slug> [flags]

Options

FlagDefaultDescription
--descriptionrepository description
--dry-runfalsepreview the HTTP request instead of sending it
--namehuman-friendly name (defaults to slug)
--privatetruemake the repository private
--workspaceworkspace slug / project key

bitbucket-cli repo delete

Delete a repository (irreversible)

bitbucket-cli repo delete <workspace>/<repo> | <url> [flags]

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--yesfalseconfirm the deletion

bitbucket-cli repo get

Show a repository's details

bitbucket-cli repo get <workspace>/<repo> | <url>

bitbucket-cli repo list

List repositories in a workspace (Cloud) or project (Data Center)

bitbucket-cli repo list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryserver-side filter expression (Cloud `q=`)
--rolefilter by role (Cloud only): owner|contributor|member
--sortsort key (Cloud only)
--workspaceworkspace slug (Cloud) or project key (Data Center)

bitbucket-cli skillcommand group

Install the companion Skill for coding agents (Claude Code, Codex)

bitbucket-cli skill

bitbucket-cli skill install

Deploy the embedded Skill into a coding agent's skills directory

bitbucket-cli skill install [flags]

Write the companion `bitbucket` Skill — bundled inside this binary — into a coding agent's skills directory. With no flags it probes for installed agents (Claude Code, Codex) and installs into each one found. Re-run it after upgrading the CLI to refresh the Skill to the matching version.

Options

FlagDefaultDescription
--agent[]target agents instead of auto-detecting (claude-code, codex)
--direxplicit skills base directory; installs into <dir>/bitbucket
--projectfalseinstall into the project (./.claude/skills, ./.agents/skills) instead of $HOME

bitbucket-cli skill path

Print where the Skill would be installed, and whether it is

bitbucket-cli skill path [flags]

Options

FlagDefaultDescription
--agent[]limit to specific agents (claude-code, codex)
--direxplicit skills base directory
--projectfalseuse the project skills directories instead of $HOME

bitbucket-cli skill show

Print the embedded SKILL.md to stdout

bitbucket-cli skill show

bitbucket-cli skill uninstall

Remove the companion Skill from a coding agent's skills directory

bitbucket-cli skill uninstall [flags]

Delete a previously installed `bitbucket` Skill. With no flags it probes for installed agents (Claude Code, Codex) and removes the Skill from each one found.

Options

FlagDefaultDescription
--agent[]target agents instead of auto-detecting (claude-code, codex)
--direxplicit skills base directory; removes <dir>/bitbucket
--projectfalseremove from the project (./.claude/skills, ./.agents/skills) instead of $HOME

bitbucket-cli tagcommand group

List and inspect repository tags

bitbucket-cli tag

bitbucket-cli tag get

Show a single tag (commit hash + date / message on Cloud)

bitbucket-cli tag get <name> [flags]

Options

FlagDefaultDescription
--repo<workspace>/<repo>

bitbucket-cli tag list

List tags in a repository

bitbucket-cli tag list [flags]

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryfilter by name substring
--repo<workspace>/<repo>
--sortsort key

bitbucket-cli usercommand group

Discover Bitbucket users (workspace members on Cloud / global users on DC)

bitbucket-cli user

bitbucket-cli user get

Show details of a single user (UUID/account_id on Cloud; slug/username on DC)

bitbucket-cli user get <selector>

bitbucket-cli user list

List users (workspace members on Cloud / global users on DC)

bitbucket-cli user list [flags]

List Bitbucket users. Cloud: --workspace is required (Cloud has no global user list; the API exposes members of a specific workspace). DC: --workspace is ignored; the global /users endpoint is used. Use --query to filter by display-name substring.

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryfilter by display-name substring
--workspaceworkspace slug (Cloud only; ignored on DC)

bitbucket-cli user me

Print the user the configured credentials authenticate as (alias for whoami)

bitbucket-cli user me

bitbucket-cli version

Print version information

bitbucket-cli version

bitbucket-cli whoami

Print the user the configured credentials authenticate as

bitbucket-cli whoami

Examples

  bitbucket-cli whoami

bitbucket-cli workspacecommand group

List and inspect Bitbucket workspaces (Cloud) / projects (DC)

bitbucket-cli workspace

bitbucket-cli workspace get

Show details of a single workspace / project

bitbucket-cli workspace get <slug>

bitbucket-cli workspace list

List every workspace / project the current credentials can see

bitbucket-cli workspace list [flags]

List every Bitbucket workspace (Cloud) or project (Data Center) the authenticated user can see. The `slug` field of each entry is what every other command's --workspace flag expects.

Options

FlagDefaultDescription
--allfalsefetch every page of results
--cursorstart from this pagination cursor (the 'next' of a prior page)
--limit0page size (default from config)
--queryfilter by name substring
--rolefilter by role (Cloud only): owner | collaborator | member