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. AGENT NOTE: a companion Skill ("bitbucket") carries the canonical usage, safety modes, and env setup and is the source of truth for driving this CLI. If you are an agent, load that Skill before composing commands. Check status with `bitbucket-cli skill status`; install it with `bitbucket-cli skill install`.

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 for interactive terminal use only (agents/scripts should omit): TUI in `config init`, colorized JSON elsewhere; errors without a TTY
--timeoutrequest timeout, e.g. 30s
--use-contextuse a named context for this invocation
--verbose, -vfalseverbose diagnostics on stderr

bitbucket-cli auth

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` 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 branch

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 comment

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); literal \n \t \r are decoded to real newlines/tabs (use --content-file for exact bytes)
--content-fileread content from this file (sent as exact bytes, no escape decoding)
--dry-runfalsepreview the HTTP request without sending it
--inlineinline anchor as <path>:<line> (line is the new/post-change file line unless --side old)
--pr<workspace>/<repo>/<id> or PR URL
--reply-to0reply to this comment ID
--sidenewdiff side the --inline line refers to: new (post-change) or old (pre-change/removed)

bitbucket-cli comment delete

Delete one or more comments

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

Delete a PR comment. Pass several comment IDs to delete them in one run, or a single '-' to read newline-separated IDs from stdin. --yes (or --dry-run) is required and applies to the whole batch.

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
--tasksfalseonly comments that are actionable tasks
--unresolvedfalseonly comments whose thread is not resolved

bitbucket-cli comment resolve

Resolve (or reopen) a comment thread

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

Mark a PR comment thread resolved, or reopen it with --unresolve. On Data Center this is also how a task (a BLOCKER-severity comment) is completed or reopened. Bitbucket Cloud's separate task objects are not covered — this resolves comment threads, the `resolved` field surfaced by `comment list` and `pr threads`.

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--pr<workspace>/<repo>/<id> or PR URL
--unresolvefalsereopen the thread instead of resolving it

Examples

  bitbucket-cli comment resolve 42 --pr myws/myrepo/7
  bitbucket-cli comment resolve 42 --pr myws/myrepo/7 --unresolve

bitbucket-cli comment update

Edit a comment

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

Options

FlagDefaultDescription
--contentnew content (Markdown); literal \n \t \r are decoded to real newlines/tabs
--dry-runfalsepreview the HTTP request without sending it
--pr<workspace>/<repo>/<id> or PR URL

bitbucket-cli commit

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 config

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 file

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 pr

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 one or more PRs

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

Approve a PR. Pass several PR references to approve them in one run, or a single '-' to read newline-separated references from stdin. With more than one, output is a {items, has_more} aggregate with a per-PR ok/error and the exit code is non-zero if any approval failed.

Options

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

Examples

  bitbucket-cli pr approve myws/myrepo/7
  bitbucket-cli pr approve myws/myrepo/7 myws/myrepo/8
  bitbucket-cli pr inbox --format json | jq -r '.items[].ref' | bitbucket-cli pr approve -

bitbucket-cli pr checkout

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

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

Options

FlagDefaultDescription
--basebase branch to fetch (default: the PR's destination branch, looked up via the API)
--branchpr/%dlocal branch name format; %d is replaced with the PR id
--execfalseactually run the git commands in the current working directory
--remotegit remote to fetch from (default: upstream if present, else origin)

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); literal \n \t \r are decoded to real newlines/tabs (use --description-file for exact bytes)
--description-fileread description from this file (sent as exact bytes, no escape decoding)
--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 fork: <ws>/<repo> (DC also needs --target)
--targetdestination branch (default: repo default)
--titlePR title

bitbucket-cli pr decline

Decline (close without merging) one or more PRs

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

Decline a PR. Pass several PR references to decline them in one run, or a single '-' to read newline-separated references from stdin. --yes (or --dry-run) is required and applies to the whole batch.

Options

FlagDefaultDescription
--dry-runfalsepreview the HTTP request without sending it
--messagedecline message; literal \n \t \r are decoded to real newlines/tabs
--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
--commentablefalselist the new/old-side line numbers each file can carry an inline comment on
--line-numbersfalseprefix each line with its old/new file line numbers (for picking --inline lines)
--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 and base branch

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

Options

FlagDefaultDescription
--basebase branch to fetch (default: the PR's destination branch, looked up via the API)
--execfalseactually run `git fetch` in the current working directory
--remotegit remote to fetch from (default: upstream if present, else origin)

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; literal \n \t \r are decoded to real newlines/tabs
--strategymerge_commitmerge_commit | squash | fast_forward
--yesfalseconfirm the merge

bitbucket-cli pr request-changes

Cast (or withdraw) a request-changes / needs-work 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> [flags]

Options

FlagDefaultDescription
--comment0only the thread containing this comment id (root or reply)
--unresolvedfalseonly threads that are not resolved

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; literal \n \t \r are decoded to real newlines/tabs
--dry-runfalsepreview the HTTP request without sending it
--reviewer[]replace reviewer list (repeatable)
--titlenew title

bitbucket-cli repo

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; literal \n \t \r are decoded to real newlines/tabs
--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 skill

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 status

Report whether the companion Skill is loaded and installed

bitbucket-cli skill status [flags]

Options

FlagDefaultDescription
--projectfalsecheck the project skills dirs (./.claude/skills, ./.agents/skills) instead of $HOME

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 tag

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 user

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 workspace

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