
Bkt
- 1.4k installs
- 180 repo stars
- Updated August 2, 2026
- avivsinai/bitbucket-cli
bkt provides documented workflows for Bitbucket CLI for Data Center and Cloud. Use when users need to manage repositories, pull requests, branches, issues, webhooks, or pipelines in Bitbucket. Trigg
About
The bkt skill bitbucket CLI for Data Center and Cloud Use when users need to manage repositories pull requests branches issues webhooks or pipelines in Bitbucket Triggers include bitbucket bkt pull request PR repo list branch create Bitbucket Data Center Bitbucket Cloud keyring timeout Bitbucket CLI bkt bkt is a unified CLI for Bitbucket Data Center and Bitbucket Cloud It mirrors gh ergonomics and provides structured JSON YAML output for automation Verify installation always check before running any bkt command bash bkt version If not installed Platform Command macOS Linux brew install avivsinai tap bitbucket-cli Windows scoop bucket add avivsinai https github com avivsinai scoop-bucket scoop install bitbucket-cli Go go install github com avivsinai bitbucket-cli cmd bkt latest Binary Download from GitHub Releases https github com avivsinai bitbucket-cli releases 2 Check authentication most commands require an active session bash bkt auth status Bitbucket Cloud Token Requirements Create an API token with scopes not a general API token Select Bitbucket as the application Required scope Account Read read user bitbucket Additional
- Create an "API token with scopes" (not a general API token)
- Select **Bitbucket** as the application
- Required scope: **Account: Read** (`read:user:bitbucket`)
- Additional scopes as needed: Repositories, Pull requests, Issues
- [headless / env vars](rules/headless.md) - Config-free CI/container auth (BKT_TOKEN, BKT_HOST) and full env var refere
Bkt by the numbers
- 1,357 all-time installs (skills.sh)
- +52 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #338 of 2,203 Security skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
bkt capabilities & compatibility
- Capabilities
- create an "api token with scopes" (not a general · select **bitbucket** as the application · required scope: **account: read** (`read:user:bi · additional scopes as needed: repositories, pull · [headless / env vars](rules/headless.md) confi
- Use cases
- documentation
What bkt says it does
# Bitbucket CLI (bkt) `bkt` is a unified CLI for **Bitbucket Data Center** and **Bitbucket Cloud**.
It mirrors `gh` ergonomics and provides structured JSON/YAML output for automation.
npx skills add https://github.com/avivsinai/bitbucket-cli --skill bktAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.4k |
|---|---|
| repo stars | ★ 180 |
| Security audit | 1 / 3 scanners passed |
| Last updated | August 2, 2026 |
| Repository | avivsinai/bitbucket-cli ↗ |
How do I use bkt for the task described in its SKILL.md triggers?
Bitbucket CLI for Data Center and Cloud. Use when users need to manage repositories, pull requests, branches, issues, webhooks, or pipelines in Bitbucket. Triggers include "bitbucket", "bkt", "pull r.
Who is it for?
Teams invoking bkt when the user request matches documented triggers and prerequisites.
Skip if: Skip when cached docs are missing, the request is a negative trigger, or another sibling skill owns the workflow.
When should I use this skill?
Bitbucket CLI for Data Center and Cloud. Use when users need to manage repositories, pull requests, branches, issues, webhooks, or pipelines in Bitbucket. Triggers include "bitbucket", "bkt", "pull request", "PR", "repo
What you get
Step-by-step guidance grounded in bkt documentation and reference files.
- Rotated server secrets
- Updated logging configuration
By the numbers
- Documents 3 admin subcommand areas: secrets rotate, logging get, and logging set
Files
Bitbucket CLI (bkt)
bkt is a unified CLI for Bitbucket Data Center and Bitbucket Cloud. It mirrors gh ergonomics and provides structured JSON/YAML output for automation.
Before You Start
1. Verify installation — always check before running any bkt command:
bkt --versionIf not installed:
| Platform | Command |
|---|---|
| macOS/Linux | brew install avivsinai/tap/bitbucket-cli |
| Windows | scoop bucket add avivsinai https://github.com/avivsinai/scoop-bucket && scoop install bitbucket-cli |
| Go | go install github.com/avivsinai/bitbucket-cli/cmd/bkt@latest |
| Binary | Download from GitHub Releases |
2. Check authentication — most commands require an active session:
bkt auth statusBitbucket Cloud Token Requirements:
- Create an "API token with scopes" (not a general API token)
- Select Bitbucket as the application
- Required scope: Account: Read (
read:user:bitbucket) - Additional scopes as needed: Repositories, Pull requests, Issues
For config-free use in containers and CI pipelines, see headless authentication.
If not authenticated, log in:
# Data Center (PAT-based)
bkt auth login https://bitbucket.example.com --username alice --token <PAT>
# Bitbucket Cloud — OAuth (official binaries open browser out of the box)
bkt auth login https://bitbucket.org --kind cloud --web
# Bitbucket Cloud — API token (--web-token opens Atlassian's token creation page)
bkt auth login https://bitbucket.org --kind cloud --web-tokenFor source and Nix builds, set BKT_OAUTH_CLIENT_ID and BKT_OAUTH_CLIENT_SECRET env vars before running --web.
3. Set up a context — contexts bind a host to a project/workspace and optional default repo, so you don't repeat flags on every command:
# Data Center
bkt context create dc-prod --host bitbucket.example.com --project ABC --set-active
# Cloud
bkt context create cloud-team --host bitbucket.org --workspace myteam --set-activePlatform Awareness
Some commands are Data Center only or Cloud only — check the command reference for *(DC)* and *(Cloud)* badges. Key splits:
| Feature | Data Center | Cloud |
|---|---|---|
| Pull requests | yes | yes |
| Repositories | yes | yes |
| Branches (list) | yes | yes |
| Branches (create/delete/protect) | yes | — |
| Issues | — | yes |
| Pipelines | — | yes |
| Permissions | yes | — |
| Webhooks | yes | yes |
| Auto-merge, tasks, reactions | yes | — |
| Variables | — | yes |
When a user's context is DC, do not suggest Cloud-only commands (and vice versa). If the platform is unknown, ask or check with bkt auth status.
Common Workflows
Create a PR from the current branch
bkt pr create --title "feat: add caching" --target mainSource branch, title, and target default to sensible values from git state. Add --draft for work-in-progress, --reviewer alice to request review.
Review cycle
bkt pr checks 42 --wait # Wait for CI to pass
bkt pr approve 42 # Approve
bkt pr merge 42 # Merge (closes source branch by default)Checkout a colleague's PR locally
bkt pr checkout 42 # Creates pr/42 branchStructured output for scripting
All commands support --json, --yaml, --jq, and --template:
bkt pr list --mine --json | jq '.pull_requests[].title'Raw API escape hatch
For endpoints without a dedicated command:
bkt api /rest/api/1.0/projects --param limit=100 --jsonGlobal Flags
Every command accepts these inherited flags:
| Flag | Short | Purpose |
|---|---|---|
--context | -c | Use a specific named context |
--json | JSON output | |
--yaml | YAML output | |
--jq | Apply a jq expression (requires --json) | |
--template | Render with Go template |
References
- headless / env vars — Config-free CI/container auth (BKT_TOKEN, BKT_HOST) and full env var reference
<!-- auto-generated by cmd/docgen — do not edit below this line -->
- admin — Administrative operations for Bitbucket (DC)
- auth — Manage Bitbucket authentication credentials
- branch — Inspect and manage branches
- commit — Work with commits
- context — Manage Bitbucket CLI contexts
- extension — Manage bkt CLI extensions
- issue — Work with Bitbucket Cloud issues (Cloud)
- perms — Manage Bitbucket permissions (DC)
- pipeline — Run and inspect Bitbucket Cloud pipelines (Cloud)
- pr — Manage pull requests
- project — Work with Bitbucket projects (DC)
- repo — Work with Bitbucket repositories
- status — Inspect commit and pull request statuses
- variable — Manage pipeline variables (Cloud)
- webhook — Manage Bitbucket webhooks
- other — api
<!-- end auto-generated -->
<!-- auto-generated by cmd/docgen — do not edit -->
bkt admin
Perform administrative operations on a Bitbucket Data Center instance.
This command group provides access to server-level management tasks such as secrets rotation and logging configuration. All subcommands require a Data Center context; they are not available for Bitbucket Cloud.
bkt admin <command> [flags]Examples
# Rotate encryption keys on the configured DC instance
bkt admin secrets rotate
# Show the current logging configuration
bkt admin logging get
# Set the logging level to DEBUG
bkt admin logging set --level DEBUGSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| logging | Inspect or update logging settings (DC) | — |
| secrets | Manage secrets manager operations (DC) | — |
bkt admin logging
Inspect or update the logging configuration of a Bitbucket Data Center instance. You can view the current log level and async setting, or change them at runtime without restarting the server. This command group is only available for Data Center contexts.
bkt admin logging <command> [flags]Examples
# Show the current logging configuration
bkt admin logging get
# Set the log level to WARN
bkt admin logging set --level WARN
# Enable async logging at DEBUG level
bkt admin logging set --level DEBUG --async| Subcommand | Description |
|---|---|
| get | Show current logging configuration (DC only) |
| set | Update logging configuration (DC only) |
bkt admin logging get
Display the current logging configuration of a Bitbucket Data Center instance, including the active log level and whether asynchronous logging is enabled. Output defaults to human-readable text but supports JSON via the --output flag. Requires a Data Center context.
Usage
bkt admin logging get [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Show logging config in human-readable format
bkt admin logging get
# Show logging config as JSON
bkt admin logging get --output json
# Query a specific DC context
bkt admin logging get --context prod-dcbkt admin logging set
Update the logging configuration of a Bitbucket Data Center instance at runtime. You can change the log level (TRACE, DEBUG, INFO, WARN, ERROR) and toggle asynchronous logging without restarting the server. This command requires a Data Center context and will fail against Cloud instances.
Usage
bkt admin logging set [flags]Flags
| Flag | Short | Description |
|---|---|---|
--async | Enable asynchronous logging | |
--level | Logging level: TRACE, DEBUG, INFO, WARN, ERROR |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Set the log level to INFO
bkt admin logging set --level INFO
# Enable async logging
bkt admin logging set --async
# Set DEBUG level with async on a named context
bkt admin logging set --level DEBUG --async --context staging-dcbkt admin secrets
Manage encryption keys and secrets through the Bitbucket Data Center Secrets Manager plugin. Use the subcommands to rotate keys and perform other secrets-related maintenance tasks on your DC instance.
bkt admin secrets <command> [flags]Examples
# Rotate the encryption keys
bkt admin secrets rotate
# Rotate keys using a specific DC context
bkt admin secrets rotate --context my-dc| Subcommand | Description |
|---|---|
| rotate | Rotate encryption keys via the Secrets Manager plugin (DC only) |
bkt admin secrets rotate
Trigger an encryption key rotation on a Bitbucket Data Center instance through the Secrets Manager plugin. This is a server-side operation that generates a new encryption key and re-encrypts stored secrets. The command requires a Data Center context and will fail against Cloud instances.
Usage
bkt admin secrets rotate [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Rotate encryption keys on the default DC context
bkt admin secrets rotate
# Rotate keys on a named DC context
bkt admin secrets rotate --context prod-dc<!-- auto-generated by cmd/docgen — do not edit -->
bkt auth
Manage authentication credentials for Bitbucket Data Center and Cloud hosts.
Tokens are stored in the OS keychain by default. For Data Center hosts, bkt uses Personal Access Tokens (PATs). For Bitbucket Cloud, bkt uses Atlassian API tokens with scopes.
Use "bkt auth login" to add a host, "bkt auth status" to inspect stored credentials, and "bkt auth logout" to remove them.
bkt auth <command> [flags]Subcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| doctor | Diagnose authentication and keychain issues | — |
| login | Authenticate against a Bitbucket Data Center or Cloud host | --allow-http, --allow-insecure-store, --auth-method, --kind |
| logout | Remove stored credentials for a host | --host |
| status | Show authentication status for configured hosts | — |
bkt auth doctor
Inspect the keychain/secret store wiring and explain why prompts or timeouts may be happening.
On macOS this reports the current bkt binary's code signature, Designated Requirement, and whether a stored token item is present for the host. If the stored item was created by a bkt binary with a different Designated Requirement — which is common after brew upgrade bkt — macOS will keep prompting for the Keychain password on every read. The fix in that case is to re-run bkt auth login so the item is recreated with the current binary's DR.
The command never reads the stored secret itself.
Usage
bkt auth doctor [host] [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Inspect the default host
bkt auth doctor
# Inspect a specific host
bkt auth doctor bitbucket.example.combkt auth login
Authenticate against a Bitbucket Data Center or Cloud host and store credentials in the OS keychain.
For Data Center (--kind dc, the default), you authenticate with a Personal Access Token (PAT). The token needs Repository Read/Write and Project Read permissions. Use --web-token to open the PAT management page in your browser.
For Bitbucket Cloud (--kind cloud), the simplest method is --web-token, which opens the Atlassian API token page and prompts for the token locally. Browser-based OAuth via --web works out of the box in official release binaries. For source and Nix builds, set BKT_OAUTH_CLIENT_ID and BKT_OAUTH_CLIENT_SECRET before running --web. The CLI receives a short-lived access token that is automatically refreshed.
Credentials are verified against the remote host before being stored. If no OS keychain is available, pass --allow-insecure-store to use encrypted file fallback. In non-interactive environments, provide --username and --token on the command line or via stdin.
Usage
bkt auth login [host] [flags]Flags
| Flag | Short | Description |
|---|---|---|
--allow-http | Allow http:// URLs for login even though credentials will be sent in plaintext | |
--allow-insecure-store | Allow encrypted fallback secret storage when no OS keychain is available | |
--auth-method | Authentication method: basic (username+token) or bearer (token-only) | |
--kind | Bitbucket deployment kind (dc or cloud) | |
--token | Authentication token (DC: PAT, Cloud: API token). WARNING: visible in process list and shell history; prefer the interactive prompt | |
--username | Username (DC: PAT owner, Cloud: Atlassian email for API tokens) | |
--web | -w | Authenticate via OAuth in the browser (Cloud only) |
--web-token | Open browser to create an API token, then prompt for credentials |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Login to Bitbucket Cloud via OAuth
bkt auth login https://bitbucket.org --kind cloud --web
# Login to Bitbucket Cloud with an API token
bkt auth login https://bitbucket.org --kind cloud --web-token
# Interactive login to a Data Center instance
bkt auth login https://bitbucket.example.com
# Open browser to create a PAT, then prompt for credentials
bkt auth login https://bitbucket.example.com --web-token
# Non-interactive login with flags (CI pipelines)
bkt auth login https://bitbucket.example.com --username admin --token "$PAT"bkt auth logout
Remove stored credentials for a Bitbucket host and delete the host entry from the configuration file.
The host can be specified as a positional argument or with the --host flag, using either the host key (e.g. "bitbucket.example.com") or the full base URL. Any contexts associated with the removed host are also deleted.
This command does not work when the BKT_TOKEN environment variable is set, because the token is externally managed in that case.
Usage
bkt auth logout [host] [flags]Flags
| Flag | Short | Description |
|---|---|---|
--host | Host key or base URL to remove |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Remove credentials by host key
bkt auth logout bitbucket.example.com
# Remove credentials by base URL
bkt auth logout https://bitbucket.example.com
# Remove Bitbucket Cloud credentials
bkt auth logout api.bitbucket.orgbkt auth status
Display the authentication status for all configured Bitbucket hosts and contexts.
For each host, the output includes the base URL, deployment kind (dc or cloud), the stored username, and the token source (OS keychain or the BKT_TOKEN environment variable). Configured contexts are listed with their associated host, project/workspace, and default repository.
Use --output json to get machine-readable output suitable for scripting.
Usage
bkt auth status [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Show all configured hosts and contexts
bkt auth status
# Get status as JSON
bkt auth status --output json<!-- auto-generated by cmd/docgen — do not edit -->
bkt branch
Inspect and manage branches in a Bitbucket repository.
Supports listing, creating, deleting, rebasing, and setting the default branch. Branch protection rules are available through the "protect" subcommand.
Listing works on both Bitbucket Data Center and Cloud. Create, delete, set-default, and protect subcommands currently support Data Center only.
bkt branch <command> [flags]Examples
# List branches in the current context
bkt branch list
# Create a branch from main (Data Center)
bkt branch create feature/login --from main
# Delete a stale branch (Data Center)
bkt branch delete feature/old-experimentSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| create | Create a new branch (DC) | --from, --message, --project, --repo |
| delete | Delete a branch (DC) | --dry-run, --project, --repo |
| list | List branches | --filter, --limit, --project, --repo |
| protect | Manage branch protection rules (DC) | — |
| rebase | Rebase the current branch onto another branch | --interactive, --no-fetch |
| set-default | Set the default branch (DC) | — |
bkt branch create
Create a new branch in a Bitbucket Data Center repository.
The --from flag is required and specifies the branch or commit to use as the starting point. An optional --message flag lets you attach a creation message.
This command currently supports Data Center contexts only.
Usage
bkt branch create <branch> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--from | Branch or commit to start from (required) | |
--message | Optional branch creation message | |
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Create a feature branch from main
bkt branch create feature/user-auth --from main
# Create a branch from a specific commit
bkt branch create hotfix/login --from abc1234
# Create a branch with a message
bkt branch create release/v2.0 --from main --message "Release candidate"bkt branch delete
Delete a branch from a Bitbucket Data Center repository.
Use --dry-run to validate that the branch can be deleted without actually removing it. This is useful for confirming permissions and branch existence.
This command currently supports Data Center contexts only.
Alias: rm
Usage
bkt branch delete <branch> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--dry-run | Perform a dry run without deleting | |
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Delete a branch
bkt branch delete feature/old-experiment
# Dry-run to verify before deleting
bkt branch delete feature/old-experiment --dry-run
# Delete a branch in a specific project and repo
bkt branch delete bugfix/stale --project MYPROJ --repo backendbkt branch list
List branches in a Bitbucket repository.
Works on both Bitbucket Data Center and Cloud. On Data Center, uses --project and --repo to identify the repository. On Cloud, uses --workspace and --repo. The default branch is marked with an asterisk (*).
Alias: ls
Usage
bkt branch list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--filter | Filter branches by text | |
--limit | Maximum branches to list (0 for all) | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List branches in the current context
bkt branch list
# Filter branches by name
bkt branch list --filter feature/
# List up to 10 branches
bkt branch list --limit 10
# List branches in a specific Cloud workspace and repo
bkt branch list --workspace myteam --repo backendbkt branch protect
Manage branch protection rules (restrictions) for a Bitbucket Data Center repository. Supports listing existing restrictions, adding new ones, and removing them by ID.
Restriction types include no-creates, no-deletes, fast-forward-only, and require-approvals. Restrictions can target specific users or groups.
This command group currently supports Data Center contexts only.
bkt branch protect <command> [flags]Examples
# List all branch restrictions
bkt branch protect list
# Prevent direct pushes to main
bkt branch protect add main --type fast-forward-only
# Remove a restriction by ID
bkt branch protect remove 42| Subcommand | Description |
|---|---|
| add | Add a branch restriction (DC only) |
| list | List branch restrictions (DC only) |
| remove | Remove a branch restriction (DC only) |
bkt branch protect add
Add a branch restriction to a Bitbucket Data Center repository.
Available restriction types: no-creates Prevent creating branches matching the pattern no-deletes Prevent deleting branches matching the pattern fast-forward-only Only allow fast-forward merges (no force pushes) require-approvals Require pull request approval before merging
Restrictions can be scoped to specific users or groups with the --user and --group flags, which are repeatable.
This command currently supports Data Center contexts only.
Usage
bkt branch protect add <branch> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--group | Group names to apply the restriction to (repeatable) | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--type | Restriction type (no-creates, no-deletes, fast-forward-only, require-approvals) | |
--user | Usernames to apply the restriction to (repeatable) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Prevent force pushes to main
bkt branch protect add main --type fast-forward-only
# Require PR approvals on release branches
bkt branch protect add release/v2 --type require-approvals
# Block branch deletion for specific users
bkt branch protect add main --type no-deletes --user alice --user bob
# Restrict a branch for a group
bkt branch protect add develop --type no-creates --group developersbkt branch protect list
List all branch restrictions configured for a Bitbucket Data Center repository.
Each restriction is shown with its ID, type, and the branch matcher it applies to. Use the restriction ID with "protect remove" to delete a rule.
This command currently supports Data Center contexts only.
Usage
bkt branch protect list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List all restrictions in the current context
bkt branch protect list
# List restrictions for a specific project and repo
bkt branch protect list --project MYPROJ --repo backendbkt branch protect remove
Remove a branch restriction from a Bitbucket Data Center repository by its numeric ID. Use "bkt branch protect list" to find restriction IDs.
This command currently supports Data Center contexts only.
Usage
bkt branch protect remove <restriction-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Remove a restriction by ID
bkt branch protect remove 42
# Remove a restriction in a specific project and repo
bkt branch protect remove 15 --project MYPROJ --repo backendbkt branch rebase
Rebase the current local branch onto another branch using git rebase.
By default, all remotes are fetched before rebasing to ensure the target branch is up to date. Use --no-fetch to skip the fetch step if you have already fetched recently. Use --interactive to open an interactive rebase session.
This command is a local git convenience wrapper and does not call the Bitbucket API. It works regardless of whether the context is Data Center or Cloud.
Usage
bkt branch rebase <branch> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--interactive | Run rebase in interactive mode | |
--no-fetch | Skip fetching before rebase |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Rebase onto main
bkt branch rebase main
# Interactive rebase onto develop
bkt branch rebase develop --interactive
# Rebase without fetching first
bkt branch rebase main --no-fetchbkt branch set-default
Set the default branch for a Bitbucket Data Center repository.
The default branch is the one shown by default when browsing the repository and is used as the base for new pull requests.
This command currently supports Data Center contexts only.
Usage
bkt branch set-default <branch> [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Set main as the default branch
bkt branch set-default main
# Switch the default branch to develop
bkt branch set-default develop<!-- auto-generated by cmd/docgen — do not edit -->
bkt commit
Inspect and compare commits in a Bitbucket repository. Subcommands let you view diffs between two commits or refs. Works with both Bitbucket Cloud and Data Center; on Cloud the diff spec uses ".." notation, while on Data Center the two refs are passed separately to the API.
bkt commit <command> [flags]Examples
# Show changes between two commit SHAs
bkt commit diff abc1234 def5678
# Compare a branch to main
bkt commit diff feature/login mainSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| diff | Show the diff between two commits or refs | --project, --repo, --workspace |
bkt commit diff
Display a unified diff between two commits, branches, or tags. The output is streamed through the configured pager when available.
On Data Center the two refs are resolved independently by the server. On Cloud the refs are joined with ".." and sent as a single diff spec; note that branch names containing literal ".." characters may confuse the Cloud API.
Use --project/--repo (DC) or --workspace/--repo (Cloud) to override the values from the current context.
Usage
bkt commit diff <from> <to> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Diff two commits
bkt commit diff abc1234 def5678
# Diff the current branch against main
bkt commit diff feature/signup main
# Diff with explicit repo override
bkt commit diff v1.0.0 v1.1.0 --repo my-service
# Diff on a Cloud workspace
bkt commit diff develop main --workspace myteam --repo backend<!-- auto-generated by cmd/docgen — do not edit -->
bkt context
Manage named contexts that store connection defaults for different Bitbucket hosts, projects, workspaces, and repositories. Each context bundles a host with its associated scope so you can switch between environments without repeating flags on every command.
bkt context <command> [flags]Examples
# Create a Data Center context and make it active
bkt context create work --host bitbucket.mycompany.com --project TEAM --set-active
# List all configured contexts
bkt context list
# Switch to a different context
bkt context use personalSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| create | Create a new CLI context | --host, --project, --repo, --set-active |
| delete | Delete a context | — |
| list | List available contexts | — |
| use | Activate an existing context | — |
bkt context create
Create a named context that stores connection defaults for a Bitbucket host. A context binds a host to a project (Data Center) or workspace (Cloud) and an optional default repository, so subsequent commands inherit these values without requiring flags.
Usage
bkt context create <name> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--host | Host key or base URL (required) | |
--project | Default Bitbucket project key (Data Center) | |
--repo | Default repository slug | |
--set-active | Set the new context as active | |
--workspace | Default Bitbucket workspace (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Create a Data Center context
bkt context create work --host bitbucket.mycompany.com --project TEAM
# Create a Cloud context with a default repository
bkt context create oss --host bitbucket.org --workspace my-team --repo api-service
# Create a context and immediately make it active
bkt context create staging --host staging.bb.internal --project OPS --set-activebkt context delete
Remove a named context from the configuration. If the deleted context is currently active, the active context is cleared and you will need to select another one with "bkt context use".
Alias: rm
Usage
bkt context delete <name> [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Delete a context by name
bkt context delete old-server
# Delete using the short alias
bkt context rm stagingbkt context list
List all configured contexts along with their host, project or workspace, and default repository. The currently active context is marked with an asterisk (*).
Alias: ls
Usage
bkt context list [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List all contexts
bkt context list
# List contexts using the short alias
bkt context ls
# List contexts as JSON
bkt context list --output jsonbkt context use
Set the named context as the active context. All subsequent commands will resolve their host, project/workspace, and repository defaults from this context unless overridden with explicit flags.
Usage
bkt context use <name> [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Switch to the "work" context
bkt context use work
# Switch to a personal Cloud context
bkt context use personal<!-- auto-generated by cmd/docgen — do not edit -->
bkt extension
Install, list, remove, and execute external bkt CLI extensions.
Extensions are Git repositories that contain an executable following the bkt-<name> naming convention. Once installed, an extension can be invoked directly through "bkt extension exec" or discovered with "bkt extension list". Extensions work identically for both Bitbucket Cloud and Data Center contexts.
bkt extension <command> [flags]Examples
# Install an extension from a Git repository
bkt extension install https://bitbucket.org/myteam/bkt-lint
# List all installed extensions
bkt extension list
# Run an installed extension with arguments
bkt extension exec lint --fixSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| exec | Execute an installed extension | — |
| install | Install an extension from a repository | — |
| list | List installed extensions | — |
| remove | Remove an installed extension | — |
bkt extension exec
Run an installed extension by name, forwarding any additional arguments to the extension executable. The extension runs in its own directory with BKT_EXTENSION_DIR and BKT_EXTENSION_NAME environment variables set. Sensitive bkt configuration variables (tokens, keyring passphrase) are stripped from the environment before the extension process starts.
Usage
bkt extension exec <name> [args...] [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Run an extension with no arguments
bkt extension exec lint
# Pass arguments to the extension
bkt extension exec lint --fix --verbose
# Run an extension that accepts a file path
bkt extension exec formatter src/main.gobkt extension install
Clone a Git repository into the bkt extensions directory and register it as a CLI extension. The repository must contain an executable named bkt-<name> at the top level or inside a bin/ subdirectory. The extension name is inferred from the repository URL by stripping the optional "bkt-" prefix.
If the extension is already installed, the command returns an error. Remove it first with "bkt extension remove" before reinstalling.
Usage
bkt extension install <repository> [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Install from a full HTTPS URL
bkt extension install https://bitbucket.org/myteam/bkt-lint
# Install from an SSH URL
bkt extension install git@bitbucket.org:myteam/bkt-deploy.git
# Install from a GitHub repository
bkt extension install https://github.com/user/bkt-formatterbkt extension list
Display all extensions currently installed in the bkt extensions directory. Each entry shows the extension name and, when available, the relative path to its executable. If no extensions are installed, a hint is printed suggesting the install command.
Alias: ls
Usage
bkt extension list [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List all installed extensions
bkt extension list
# List using the short alias
bkt extension ls
# List in JSON format
bkt extension list --jsonbkt extension remove
Remove a previously installed extension by deleting its directory from the bkt extensions folder. The name argument is the extension name (not the full repository URL). Use "bkt extension list" to see installed extension names.
Alias: rm
Usage
bkt extension remove <name> [flags]Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Remove an extension by name
bkt extension remove lint
# Remove using the short alias
bkt extension rm deployHeadless / CI authentication
Use BKT_TOKEN + BKT_HOST to run bkt in containers and CI pipelines without a prior bkt auth login or bkt context create step.
Quick start
# Data Center — token-only bearer auth (default when no username is set)
export BKT_HOST=https://bitbucket.example.com
export BKT_TOKEN=my-personal-access-token
export BKT_PROJECT=MYPROJ # optional default project
export BKT_REPO=my-service # optional default repo
bkt pr list
# Bitbucket Cloud — basic auth; username is required
export BKT_HOST=https://bitbucket.org
export BKT_TOKEN=my-api-token
export BKT_USERNAME=me@example.com
export BKT_WORKSPACE=my-workspace
export BKT_REPO=my-repo
bkt pr listAuth method rules
| Scenario | Resolved auth method |
|---|---|
DC, no BKT_USERNAME, no BKT_AUTH_METHOD | bearer (default) |
DC, BKT_USERNAME set, no BKT_AUTH_METHOD | basic |
DC, BKT_AUTH_METHOD=bearer | bearer |
DC, BKT_AUTH_METHOD=basic + no BKT_USERNAME | error — set BKT_USERNAME |
| Cloud | always basic; BKT_USERNAME is required |
Environment variables
| Variable | Description |
|---|---|
BKT_TOKEN | Authentication token. Bypasses keyring. |
BKT_HOST | Bitbucket server URL. Required with BKT_TOKEN for config-free use. |
BKT_USERNAME | Username for basic auth. Required for Cloud; optional for DC. |
BKT_AUTH_METHOD | Auth method: basic or bearer. DC defaults to bearer when no username is set. |
BKT_PROJECT | Default Data Center project key. |
BKT_WORKSPACE | Default Bitbucket Cloud workspace. |
BKT_REPO | Default repository slug. |
BKT_CONFIG_DIR | Config directory override. |
BKT_ALLOW_INSECURE_STORE | Allow file-based credential storage. |
BKT_KEYRING_TIMEOUT | Keyring operation timeout (e.g. 2m). |
BKT_OAUTH_CLIENT_ID | OAuth consumer key. Used at runtime when not embedded via ldflags (e.g. source and Nix builds). |
BKT_OAUTH_CLIENT_SECRET | OAuth consumer secret. Same fallback logic as BKT_OAUTH_CLIENT_ID. |
Saved-host behaviour
When BKT_HOST matches a host already in ~/.config/bkt/config.yml, the saved entry is used as the base (preserving fields like username and auth_method). BKT_TOKEN always overrides the stored token. BKT_USERNAME and BKT_AUTH_METHOD, when set, override the saved values.
Bitbucket Pipelines example
# bitbucket-pipelines.yml
pipelines:
default:
- step:
script:
- bkt pr list --mine
variables:
BKT_HOST: https://bitbucket.example.com
BKT_TOKEN: $MY_PAT_SECRET<!-- auto-generated by cmd/docgen — do not edit -->
bkt issue
Create and manage issues in Bitbucket Cloud repositories.
Note: The issue tracker is only available for Bitbucket Cloud. Bitbucket Data Center uses Jira for issue tracking.
bkt issue <command> [flags]Subcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| attachment | Work with issue attachments (Cloud) | — |
| close | Close an issue (Cloud) | --repo, --workspace |
| comment | Add or list comments on an issue (Cloud) | --body, --list, --repo, --workspace |
| create | Create a new issue (Cloud) | --assignee, --body, --component, --kind |
| delete | Delete an issue (Cloud) | --confirm, --repo, --workspace |
| edit | Edit an existing issue (Cloud) | --assignee, --body, --component, --kind |
| list | List issues in a repository (Cloud) | --assignee, --kind, --limit, --milestone |
| reopen | Reopen a closed issue (Cloud) | --repo, --workspace |
| status | Show issues relevant to you (Cloud) | --repo, --workspace |
| view | Display details for an issue (Cloud) | --comments, --repo, --web, --workspace |
bkt issue attachment
Manage file attachments on Bitbucket Cloud issues.
Attachments can be uploaded, downloaded, listed, and deleted from issues.
Alias: attach
bkt issue attachment <command> [flags]| Subcommand | Description |
|---|---|
| delete | Delete an attachment from an issue (Cloud only) |
| download | Download attachments from an issue (Cloud only) |
| list | List attachments on an issue (Cloud only) |
| upload | Upload file attachments to an issue (Cloud only) |
bkt issue attachment delete
Delete a single file attachment from a Bitbucket Cloud issue.
A confirmation prompt is shown before deletion unless --confirm is passed. This action cannot be undone.
Usage
bkt issue attachment delete <issue-id> <filename> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--confirm | Skip confirmation prompt | |
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Delete an attachment (will prompt for confirmation)
bkt issue attachment delete 42 screenshot.png
# Delete without confirmation
bkt issue attachment delete 42 screenshot.png --confirmbkt issue attachment download
Download one or more attachments from an issue.
If a specific filename is provided, only that file is downloaded. Use --all to download all attachments, or --pattern to filter by glob pattern.
Usage
bkt issue attachment download <issue-id> [<filename>] [flags]Flags
| Flag | Short | Description |
|---|---|---|
--all | Download all attachments | |
--dir | Output directory | |
--output | Output filename (single file only) | |
--pattern | Filter by glob pattern (e.g., "*.png") | |
--repo | Repository slug | |
--skip-existing | Skip files that already exist locally | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Download a specific attachment
bkt issue attachment download 42 screenshot.png
# Download all attachments
bkt issue attachment download 42 --all
# Download matching files to a directory
bkt issue attachment download 42 --pattern "*.log" --dir ./logs/
# Download to a specific filename (single file only)
bkt issue attachment download 42 screenshot.png --output local-screenshot.png
# Skip existing files
bkt issue attachment download 42 --all --skip-existingbkt issue attachment list
List all file attachments on a Bitbucket Cloud issue. Each attachment is shown with its filename and URL.
Usage
bkt issue attachment list <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List attachments on issue #42
bkt issue attachment list 42
# Output as JSON
bkt issue attachment list 42 --jsonbkt issue attachment upload
Upload one or more files as attachments to a Bitbucket Cloud issue.
All specified files are validated before any uploads begin. Directories cannot be uploaded.
Usage
bkt issue attachment upload <issue-id> <files>... [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Upload a single file
bkt issue attachment upload 42 screenshot.png
# Upload multiple files
bkt issue attachment upload 42 file1.txt file2.txtbkt issue close
Close an open issue in a Bitbucket Cloud repository by setting its state to "closed". This is a shorthand for 'bkt issue edit <id> --state closed'.
Usage
bkt issue close <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Close issue #42
bkt issue close 42bkt issue comment
Add a new comment to or list existing comments on a Bitbucket Cloud issue.
Use --body to post a comment or --list to display existing comments. When --list is specified, --body is ignored.
Usage
bkt issue comment <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--body | -b | Comment body (ignored if --list is specified) |
--list | List existing comments (takes precedence over --body) | |
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Add a comment
bkt issue comment 42 -b "This is fixed in the latest release"
# List comments
bkt issue comment 42 --listbkt issue create
Create a new issue in a Bitbucket Cloud repository.
You must provide a title. Kind defaults to "bug" if not specified. Other optional fields include body, priority, assignee, milestone, component, and version.
Usage
bkt issue create [flags]Flags
| Flag | Short | Description |
|---|---|---|
--assignee | -a | Assignee UUID (e.g., {abc-123}) |
--body | -b | Issue body/description |
--component | Component name | |
--kind | -k | Issue kind (bug, enhancement, proposal, task) |
--milestone | Milestone name | |
--priority | -p | Priority (trivial, minor, major, critical, blocker) |
--repo | Repository slug | |
--title | -t | Issue title (required) |
--version | Version name | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Create a bug
bkt issue create -t "Login button broken" -b "The login button does not respond"
# Create an enhancement
bkt issue create -t "Add dark mode" -k enhancement -p minor
# Create with assignee (use UUID from user profile)
bkt issue create -t "Fix memory leak" -a "{abc-123-def}"bkt issue delete
Permanently delete an issue from a Bitbucket Cloud repository.
A confirmation prompt is shown before deletion unless --confirm is passed. This action cannot be undone.
Usage
bkt issue delete <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--confirm | Skip confirmation prompt | |
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Delete issue #42 (will prompt for confirmation)
bkt issue delete 42
# Delete without confirmation
bkt issue delete 42 --confirmbkt issue edit
Edit an existing issue's fields in a Bitbucket Cloud repository.
Only the fields you specify via flags are updated; all other fields are left unchanged. You can update title, body, state, kind, priority, assignee, milestone, component, and version.
Usage
bkt issue edit <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--assignee | -a | Update assignee UUID (use empty string to unassign) |
--body | -b | Update body/description |
--component | Update component (use empty string to clear) | |
--kind | -k | Update kind (bug, enhancement, proposal, task) |
--milestone | Update milestone (use empty string to clear) | |
--priority | -p | Update priority (trivial, minor, major, critical, blocker) |
--repo | Repository slug | |
--state | -s | Update state (new, open, resolved, on hold, invalid, duplicate, wontfix, closed) |
--title | -t | Update title |
--version | Update version (use empty string to clear) | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Update title
bkt issue edit 42 --title "New title"
# Change state and priority
bkt issue edit 42 --state resolved --priority critical
# Assign to user
bkt issue edit 42 --assignee {uuid}bkt issue list
List issues in a Bitbucket Cloud repository with optional filters.
Results can be filtered by state, kind, priority, assignee, and milestone. By default only open issues are shown. This command is available for Bitbucket Cloud only.
Alias: ls
Usage
bkt issue list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--assignee | -a | Filter by assignee (UUID, e.g., {abc-123}) |
--kind | -k | Filter by kind (bug, enhancement, proposal, task) |
--limit | -L | Maximum issues to display |
--milestone | Filter by milestone | |
--priority | -p | Filter by priority (trivial, minor, major, critical, blocker) |
--repo | Repository slug | |
--state | -s | Filter by state (new, open, resolved, on hold, invalid, duplicate, wontfix, closed, all); defaults to open |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List all open issues
bkt issue list
# List bugs with major priority
bkt issue list --kind bug --priority major
# List issues assigned to a user
bkt issue list --assignee {uuid}bkt issue reopen
Reopen a previously closed issue in a Bitbucket Cloud repository by setting its state back to "open". This is a shorthand for 'bkt issue edit <id> --state open'.
Usage
bkt issue reopen <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Reopen issue #42
bkt issue reopen 42bkt issue status
Show issues assigned to you, created by you, and recently updated.
This command requires authentication to identify the current user.
Usage
bkt issue status [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug | |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Show your issues
bkt issue statusbkt issue view
Display detailed information about a Bitbucket Cloud issue, including its state, kind, priority, reporter, assignee, and description. Optionally include comments with --comments or open the issue in a browser with --web.
Usage
bkt issue view <issue-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--comments | Show comments | |
--repo | Repository slug | |
--web | -w | Open in browser |
--workspace | Bitbucket workspace |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# View issue #42
bkt issue view 42
# View issue with comments
bkt issue view 42 --comments
# Output as JSON
bkt issue view 42 --json<!-- auto-generated by cmd/docgen — do not edit -->
Other Commands
bkt api
Call Bitbucket REST APIs directly for endpoints that do not yet have first-class commands.
Examples: bkt api /rest/api/1.0/projects bkt api /repositories --workspace my-team --param pagelen=50 bkt api /rest/api/1.0/projects/ABC/repos --method POST --field name=demo --field scmId=git
Usage
bkt api <path> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--field | -F | Add JSON body field (key=value, repeatable) |
--header | -H | Add an HTTP request header (Key: Value) |
--input | -d | JSON string to use as the request body |
--method | -X | HTTP method (default GET, or POST when a body is supplied) |
--param | -P | Append query parameter (key=value) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
<!-- auto-generated by cmd/docgen — do not edit -->
bkt perms
Manage user permissions at the project and repository level on Bitbucket Data Center.
Grant, revoke, and list permissions for individual users. Project-level permissions apply to all repositories within that project, while repository-level permissions override the project defaults for a specific repository.
This command group is available for Data Center contexts only.
bkt perms <command> [flags]Examples
# List who has access to a project
bkt perms project list --project MYPROJ
# Grant a user write access to a specific repository
bkt perms repo grant --project MYPROJ --repo my-service --user jdoe --perm REPO_WRITE
# Revoke a user's project-level permission
bkt perms project revoke --project MYPROJ --user jdoeSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| project | Manage project-level permissions (DC) | — |
| repo | Manage repository-level permissions (DC) | — |
bkt perms project
Manage project-level permissions on Bitbucket Data Center.
Project permissions control default access for all repositories within a project. You can list current permission entries, grant a permission level to a user, or revoke a user's project permission entirely. Valid permission levels are PROJECT_READ, PROJECT_WRITE, and PROJECT_ADMIN.
bkt perms project <command> [flags]Examples
# List all users with permissions on a project
bkt perms project list --project MYPROJ
# Grant admin access to a user
bkt perms project grant --project MYPROJ --user jdoe --perm PROJECT_ADMIN
# Revoke a user's project permission
bkt perms project revoke --project MYPROJ --user jdoe| Subcommand | Description |
|---|---|
| grant | Grant project permissions (DC only) |
| list | List project permissions (DC only) |
| revoke | Revoke project permissions (DC only) |
bkt perms project grant
Grant a permission level to a user on a Bitbucket Data Center project.
The user receives the specified permission for the project and inherits it across all repositories within that project unless overridden at the repository level. Valid values for --perm are PROJECT_READ, PROJECT_WRITE, and PROJECT_ADMIN. If --perm is omitted it defaults to PROJECT_READ.
Usage
bkt perms project grant [flags]Flags
| Flag | Short | Description |
|---|---|---|
--perm | Permission (PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN) | |
--project | Bitbucket project key (required) | |
--user | Username to grant (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Grant read access (default)
bkt perms project grant --project MYPROJ --user jdoe
# Grant write access
bkt perms project grant --project MYPROJ --user jdoe --perm PROJECT_WRITE
# Grant admin access
bkt perms project grant --project MYPROJ --user jdoe --perm PROJECT_ADMINbkt perms project list
List the permission entries for a Bitbucket Data Center project.
Displays each user who has been granted explicit access to the project along with their permission level (PROJECT_READ, PROJECT_WRITE, or PROJECT_ADMIN). Use --limit to control how many entries are returned; set it to 0 to fetch all.
Usage
bkt perms project list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--limit | Maximum entries to display (0 for all) | |
--project | Bitbucket project key (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List permissions for a project
bkt perms project list --project MYPROJ
# List all permissions without a cap
bkt perms project list --project MYPROJ --limit 0
# Output as JSON
bkt perms project list --project MYPROJ --output jsonbkt perms project revoke
Revoke a user's permission on a Bitbucket Data Center project.
Removes the explicit project-level permission entry for the specified user. After revocation the user loses access granted at the project level, though they may still have access through repository-level or global permissions.
Usage
bkt perms project revoke [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key (required) | |
--user | Username to revoke (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Revoke a user's project permission
bkt perms project revoke --project MYPROJ --user jdoe
# Revoke using a different context
bkt perms project revoke --project MYPROJ --user jdoe --context my-dcbkt perms repo
Manage repository-level permissions on Bitbucket Data Center.
Repository permissions override the project defaults for a specific repository. You can list current permission entries, grant a permission level to a user, or revoke a user's repository permission entirely. Valid permission levels are REPO_READ, REPO_WRITE, and REPO_ADMIN.
bkt perms repo <command> [flags]Examples
# List permissions on a repository
bkt perms repo list --project MYPROJ --repo my-service
# Grant write access to a user
bkt perms repo grant --project MYPROJ --repo my-service --user jdoe --perm REPO_WRITE
# Revoke a user's repository permission
bkt perms repo revoke --project MYPROJ --repo my-service --user jdoe| Subcommand | Description |
|---|---|
| grant | Grant repository permissions (DC only) |
| list | List repository permissions (DC only) |
| revoke | Revoke repository permissions (DC only) |
bkt perms repo grant
Grant a permission level to a user on a Bitbucket Data Center repository.
The user receives the specified permission for the repository, overriding any project-level permission they may already have. Valid values for --perm are REPO_READ, REPO_WRITE, and REPO_ADMIN. If --perm is omitted it defaults to REPO_READ.
Usage
bkt perms repo grant [flags]Flags
| Flag | Short | Description |
|---|---|---|
--perm | Permission (REPO_READ, REPO_WRITE, REPO_ADMIN) | |
--project | Bitbucket project key (required) | |
--repo | Repository slug (required) | |
--user | Username to grant (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Grant read access (default)
bkt perms repo grant --project MYPROJ --repo my-service --user jdoe
# Grant write access
bkt perms repo grant --project MYPROJ --repo my-service --user jdoe --perm REPO_WRITE
# Grant admin access
bkt perms repo grant --project MYPROJ --repo my-service --user jdoe --perm REPO_ADMINbkt perms repo list
List the permission entries for a Bitbucket Data Center repository.
Displays each user who has been granted explicit access to the repository along with their permission level (REPO_READ, REPO_WRITE, or REPO_ADMIN). Use --limit to control how many entries are returned; set it to 0 to fetch all.
Usage
bkt perms repo list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--limit | Maximum entries to display (0 for all) | |
--project | Bitbucket project key (required) | |
--repo | Repository slug (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List permissions for a repository
bkt perms repo list --project MYPROJ --repo my-service
# Fetch all permission entries
bkt perms repo list --project MYPROJ --repo my-service --limit 0
# Output as JSON
bkt perms repo list --project MYPROJ --repo my-service --output jsonbkt perms repo revoke
Revoke a user's permission on a Bitbucket Data Center repository.
Removes the explicit repository-level permission entry for the specified user. After revocation the user may still have access through project-level or global permissions.
Usage
bkt perms repo revoke [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key (required) | |
--repo | Repository slug (required) | |
--user | Username to revoke (required) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Revoke a user's repository permission
bkt perms repo revoke --project MYPROJ --repo my-service --user jdoe
# Revoke using a different context
bkt perms repo revoke --project MYPROJ --repo my-service --user jdoe --context my-dc<!-- auto-generated by cmd/docgen — do not edit -->
bkt pipeline
Interact with Bitbucket Cloud Pipelines. Commands are no-ops for Data Center contexts.
bkt pipeline <command> [flags]Subcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| list | List recent pipeline runs (Cloud) | --limit, --repo, --workspace |
| logs | Fetch logs for a pipeline run (Cloud) | --repo, --step, --workspace |
| run | Trigger a new pipeline run (Cloud) | --ref, --repo, --var, --workspace |
| view | Show details for a pipeline run (Cloud) | --repo, --workspace |
bkt pipeline list
List recent pipeline runs for a Bitbucket Cloud repository.
Displays build number, UUID, state, result, target branch, and creation time for each pipeline. By default the most recent 20 runs are shown; use --limit to adjust. This command is available for Bitbucket Cloud contexts only.
Alias: ls
Usage
bkt pipeline list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--limit | Maximum pipelines to display | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List the 20 most recent pipeline runs
bkt pipeline list
# List the last 5 pipeline runs
bkt pipeline list --limit 5
# List pipelines for a specific repository
bkt pipeline list --workspace myteam --repo backend-apibkt pipeline logs
Fetch logs for a pipeline run on Bitbucket Cloud.
Prints the log output for a pipeline step. By default the last step is selected; use --step to target a specific step UUID. The <id> argument accepts either a build number (e.g., 10) or a pipeline UUID. This command is available for Bitbucket Cloud contexts only.
Usage
bkt pipeline logs <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug override | |
--step | Specific step UUID to fetch logs for | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Fetch logs for the latest step of pipeline #42
bkt pipeline logs 42
# Fetch logs for a specific step
bkt pipeline logs 42 --step '{step-uuid-here}'
# Fetch logs using a pipeline UUID
bkt pipeline logs '{a1b2c3d4-e5f6-7890-abcd-ef1234567890}'
# Fetch logs for a pipeline in a specific repository
bkt pipeline logs 10 --workspace myteam --repo backend-apibkt pipeline run
Trigger a new pipeline run on Bitbucket Cloud for the current repository.
The pipeline runs against the specified Git ref (branch, tag, or commit). You can pass custom pipeline variables using the --var flag, which accepts KEY=VALUE pairs and can be repeated. This command is available for Bitbucket Cloud contexts only.
Usage
bkt pipeline run [flags]Flags
| Flag | Short | Description |
|---|---|---|
--ref | Git ref to run the pipeline on | |
--repo | Repository slug override | |
--var | Pipeline variable in KEY=VALUE form (repeatable) | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Run the pipeline on the default branch
bkt pipeline run
# Run the pipeline on a specific branch
bkt pipeline run --ref feature/my-branch
# Run with custom pipeline variables
bkt pipeline run --ref main --var ENV=staging --var DEBUG=true
# Run against a specific repository
bkt pipeline run --workspace myteam --repo backend-api --ref developbkt pipeline view
Show details for a pipeline run on Bitbucket Cloud.
Displays the pipeline state, result, and a breakdown of each step with its UUID, status, and name. The <id> argument accepts either a build number (e.g., 10) or a pipeline UUID. This command is available for Bitbucket Cloud contexts only.
Usage
bkt pipeline view <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# View pipeline run by build number
bkt pipeline view 42
# View pipeline run by UUID
bkt pipeline view '{a1b2c3d4-e5f6-7890-abcd-ef1234567890}'
# View a pipeline in a specific repository
bkt pipeline view 10 --workspace myteam --repo backend-api<!-- auto-generated by cmd/docgen — do not edit -->
bkt pr
Create, list, review, merge, and manage pull requests on Bitbucket Data Center and Bitbucket Cloud. Most subcommands work on both platforms; platform-specific limitations are noted in each subcommand's help.
bkt pr <command> [flags]Examples
# List open pull requests in the current repository
bkt pr list
# View details of a specific pull request
bkt pr view 42
# Create a pull request from the current branch
bkt pr create --title "Add user authentication"
# Approve and merge a pull request
bkt pr approve 42
bkt pr merge 42Subcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| approve | Approve a pull request | --project, --repo, --workspace |
| auto-merge | Manage pull request auto-merge (DC) | — |
| checkout | Check out the pull request branch | --branch, --project, --remote, --repo |
| checks | Show build/CI status for a pull request | --fail-fast, --interval, --max-interval, --project |
| comment | Comment on a pull request | --file, --from-line, --parent, --pending |
| comments | List comments on a pull request | --details, --project, --repo, --state |
| create | Create a new pull request | --body, --close-source, --description, --destination |
| decline | Decline a pull request | --body, --comment, --delete-source, --project |
| diff | Show the diff for a pull request | --project, --repo, --stat, --workspace |
| edit | Edit a pull request | --body, --description, --project, --remove-reviewer |
| list | List pull requests | --limit, --mine, --project, --repo |
| merge | Merge a pull request | --close-source, --message, --project, --repo |
| publish | Mark a draft pull request as ready for review | --project, --repo, --undo, --workspace |
| reaction | Manage comment reactions (DC) | — |
| reopen | Reopen a declined pull request | --project, --repo, --workspace |
| reviewer-group | Manage default reviewer groups (DC) | — |
| suggestion | Apply or preview a code suggestion (DC) | --preview, --project, --repo |
| task | Manage pull request tasks (DC and Cloud) | — |
| view | Show details for a pull request | --project, --repo, --web, --workspace |
bkt pr approve
Approve a pull request as the authenticated user. This adds your approval to the pull request, which may satisfy merge checks that require reviewer approvals.
Works on both Data Center and Cloud.
Usage
bkt pr approve <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Approve a pull request
bkt pr approve 42
# Approve a pull request in a specific repository
bkt pr approve 42 --repo my-servicebkt pr auto-merge
Enable, disable, or check the status of auto-merge for a pull request. When auto-merge is enabled, the pull request is merged automatically once all required conditions (approvals, build checks) are met.
Data Center only. Not yet supported on Cloud.
bkt pr auto-merge <command> [flags]Examples
# Enable auto-merge for a pull request
bkt pr auto-merge enable 42
# Check auto-merge status
bkt pr auto-merge status 42
# Disable auto-merge
bkt pr auto-merge disable 42| Subcommand | Description |
|---|---|
| disable | Disable auto-merge (DC only) |
| enable | Enable auto-merge for a pull request (DC only) |
| status | Show auto-merge configuration (DC only) |
bkt pr auto-merge disable
Disable auto-merge for a pull request on Data Center. The pull request will no longer merge automatically.
Usage
bkt pr auto-merge disable <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Disable auto-merge
bkt pr auto-merge disable 42bkt pr auto-merge enable
Enable auto-merge for a pull request on Data Center. The pull request will be merged automatically when all preconditions are satisfied. You can optionally specify a merge strategy, a custom merge commit message, and whether the source branch should be closed after merge.
Usage
bkt pr auto-merge enable <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--close-source | Close source branch when auto-merge completes | |
--message | Custom merge commit message | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--strategy | Merge strategy ID (leave empty for default) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Enable auto-merge with defaults
bkt pr auto-merge enable 42
# Enable with a specific merge strategy and message
bkt pr auto-merge enable 42 --strategy squash --message "Squash merge feature X"
# Enable but keep the source branch
bkt pr auto-merge enable 42 --close-source=falsebkt pr auto-merge status
Show the current auto-merge configuration for a pull request on Data Center, including whether it is enabled, the merge strategy, commit message, and close-source-branch setting.
Usage
bkt pr auto-merge status <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Check auto-merge status
bkt pr auto-merge status 42bkt pr checkout
Fetch and check out the source branch of a pull request into a local branch. By default the local branch is named pr/<id>.
On Data Center, the PR head is fetched via the refs/pull-requests/<id>/from ref. On Cloud, the source branch name is resolved from the API and fetched directly. For fork-based Cloud pull requests, a remote is automatically added (or reused) for the fork repository.
Usage
bkt pr checkout <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--branch | Local branch name (defaults to pr/<id>) | |
--project | Bitbucket project key override | |
--remote | Git remote name to fetch from | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Check out pull request #42
bkt pr checkout 42
# Check out into a custom branch name
bkt pr checkout 42 --branch feature-review
# Check out from a specific remote
bkt pr checkout 42 --remote upstreambkt pr checks
Display CI/build statuses for the head commit of a pull request. Use --wait to poll until all builds complete, with exponential backoff and jitter. The --fail-fast flag exits on the first failure. Use --web to open the first build's URL in your browser.
On Data Center, statuses are fetched from the commit build-status API using the source branch's latest commit. On Cloud, the source commit hash from the pull request is used.
Exit codes in --wait mode: 0 = all passed, 1 = a build failed, 8 = timed out with builds still pending.
Alias: builds
Usage
bkt pr checks <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--fail-fast | Exit immediately when a check fails (requires --wait) | |
--interval | Initial polling interval when using --wait | |
--max-interval | Maximum polling interval (backoff cap) | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--timeout | Maximum time to wait for builds (0 for no timeout) | |
--wait | Wait for all builds to complete | |
--web | Open the build URL in your browser (first build) | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Show current build status
bkt pr checks 42
# Wait for all builds to finish
bkt pr checks 42 --wait
# Wait with fail-fast and a custom timeout
bkt pr checks 42 --wait --fail-fast --timeout 10m
# Open the first build URL in a browser
bkt pr checks 42 --webbkt pr comment
Add a comment to a pull request. Comments can be general (activity-level), threaded replies (via --parent), or inline on a specific file and line in the diff (via --file with --from-line or --to-line). Use --pending to create a draft review comment that is not visible until submitted.
Works on both Data Center and Cloud.
Usage
bkt pr comment <id> --text <message> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--file | File path in the diff (requires --from-line or --to-line) | |
--from-line | Line in the old file (removed/source side) | |
--parent | Parent comment ID for threaded replies | |
--pending | Create the comment as pending (draft review feedback) | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--text | Comment text | |
--to-line | Line in the new file (added/destination side) | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Add a general comment
bkt pr comment 42 --text "Looks good to me"
# Reply to an existing comment thread
bkt pr comment 42 --text "Fixed in the latest push" --parent 1001
# Add an inline comment on a specific line in the new file
bkt pr comment 42 --text "Nit: rename this variable" --file src/main.go --to-line 55
# Add a pending (draft) inline comment
bkt pr comment 42 --text "Consider error handling here" --file api.go --to-line 30 --pendingbkt pr comments
List all comments on a pull request. On Cloud, use --state to filter by resolution status (resolved, unresolved, or deleted). The --state flag is not supported on Data Center because the DC API does not expose resolution status.
Works on both Data Center and Cloud.
Resolve and reopen subcommands require the top-level thread comment ID, not a reply ID. Use --details when listing comments to inspect thread structure before changing thread state.
bkt pr comments <id> [flags]
bkt pr comments <command> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--details | Show full comment details (file, resolved, task status) | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--state | Filter by state: all, resolved, unresolved, deleted (Cloud only) | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List all comments
bkt pr comments 42
# List only unresolved comments (Cloud only)
bkt pr comments 42 --state unresolved
# List resolved comments (Cloud only)
bkt pr comments 42 --state resolved
# List deleted comments (Cloud only)
bkt pr comments 42 --state deleted
# Delete a comment
bkt pr comments delete 42 1001
# Resolve a comment thread
bkt pr comments resolve 42 1001
# Reopen a resolved comment thread
bkt pr comments reopen 42 1001| Subcommand | Description |
|---|---|
| delete | Delete a pull request comment |
| reopen | Reopen a resolved pull request comment thread |
| resolve | Resolve a pull request comment thread |
bkt pr comments delete
Delete a pull request comment on Bitbucket Cloud or Data Center.
Use bkt pr comments <id> or bkt pr comments <id> --details to find the comment ID before deleting it. On Bitbucket Cloud, deleted comments can still be listed with --state deleted when the API returns them. On Data Center, bkt fetches the current comment version before deleting because the API requires it.
Alias: rm
Usage
bkt pr comments delete <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Delete comment 1001 from pull request 42
bkt pr comments delete 42 1001
# Delete a comment in a specific repository
bkt pr comments delete 42 1001 --repo platform-apibkt pr comments reopen
Reopen a resolved pull request comment thread on Bitbucket Cloud or Data Center.
The comment-id must be the top-level comment for the thread. Replies cannot be reopened directly; pass the parent comment ID instead. Deleted comments cannot be reopened.
Usage
bkt pr comments reopen <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Reopen thread 1001 on pull request 42
bkt pr comments reopen 42 1001
# Reopen a thread in a specific repository
bkt pr comments reopen 42 1001 --repo platform-apibkt pr comments resolve
Resolve a pull request comment thread on Bitbucket Cloud or Data Center.
The comment-id must be the top-level comment for the thread. Replies cannot be resolved directly; pass the parent comment ID instead. Deleted comments cannot be resolved.
Usage
bkt pr comments resolve <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Resolve thread 1001 on pull request 42
bkt pr comments resolve 42 1001
# Resolve a thread in a specific repository
bkt pr comments resolve 42 1001 --repo platform-apibkt pr create
Create a new pull request. The source branch defaults to the current git branch, and the target branch defaults to the remote's default branch (e.g. main). The title defaults to the first unique commit subject on the source branch.
Reviewers can be added with repeatable --reviewer flags. --with-default-reviewers merges the repository's configured default reviewers into the reviewer list. On Cloud, the current user is automatically excluded.
Draft pull requests are supported on Cloud (always) and on Data Center 8.18+ via the --draft flag.
Usage
bkt pr create [flags]Flags
| Flag | Short | Description |
|---|---|---|
--body | -b | Pull request description (alias for --description) |
--close-source | Close source branch on merge | |
--description | Pull request description | |
--destination | Target branch (alias for --target) | |
--draft | -d | Create pull request as a draft (DC 8.18+, Cloud always supported) |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--reviewer | Reviewer username or {UUID} (repeatable) | |
--source | Source branch (defaults to the current branch) | |
--target | Target branch (defaults to the remote's default branch) | |
--title | Pull request title (defaults to the first unique commit subject) | |
--with-default-reviewers | Add repository default reviewers | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Create a pull request with auto-detected title
bkt pr create
# Create with an explicit title and description
bkt pr create --title "Add OAuth2 support" --description "Implements RFC 6749"
# Create with reviewers and close source branch on merge
bkt pr create -t "Fix login bug" --reviewer alice --reviewer bob --close-source
# Create a draft pull request
bkt pr create --title "WIP: new feature" --draftbkt pr decline
Decline (close without merging) a pull request. On Data Center, the optional --delete-source flag also deletes the source branch after declining. This flag is not supported on Cloud.
Works on both Data Center and Cloud.
Alias: close
Usage
bkt pr decline <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--body | Alias for --comment; use --comment instead | |
--comment | -m | Comment explaining why the pull request was declined |
--delete-source | Delete the source branch after declining | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--text | Alias for --comment; use --comment instead | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Decline a pull request
bkt pr decline 42
# Decline with a comment explaining the reason
bkt pr decline 42 --comment "Needs more work before we can merge"
# Same using the close alias
bkt pr close 42
# Decline and delete the source branch (Data Center only)
bkt pr decline 42 --delete-sourcebkt pr diff
Display the full unified diff for a pull request, streamed through the configured pager when available. Use --stat for a compact summary of changed files, additions, and deletions instead of the full patch.
Works on both Data Center and Cloud. On Cloud, --stat also lists per-file change counts.
Usage
bkt pr diff <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--stat | Show diff statistics instead of full patch | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Show the full diff
bkt pr diff 42
# Show diff statistics only
bkt pr diff 42 --statbkt pr edit
Edit a pull request's title, description, and/or reviewers. Also available as 'pr update'.
Alias: update
Usage
bkt pr edit <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--body | -b | Set the new body (alias for --description). |
--description | Set the new description. | |
--project | Bitbucket project key override. | |
--remove-reviewer | Reviewer username or {UUID} to remove (repeatable) | |
--repo | Repository slug override. | |
--reviewer | Reviewer username or {UUID} to add (repeatable) | |
--title | -t | Set the new title. |
--with-default-reviewers | Add repository default reviewers | |
--workspace | Bitbucket workspace override (Cloud). |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Update pull request title
bkt pr edit 123 --title "New feature: user authentication"
# Update pull request description
bkt pr edit 123 --body "This PR adds OAuth2 support"
# Update both title and description
bkt pr edit 123 -t "Fix login bug" -b "Resolves issue with session timeout"
# Add reviewers
bkt pr edit 123 --reviewer alice --reviewer bob
# Remove a reviewer
bkt pr edit 123 --remove-reviewer alice
# Add repository default reviewers
bkt pr edit 123 --with-default-reviewers
# Add and remove reviewers in one call
bkt pr edit 123 --reviewer charlie --remove-reviewer alicebkt pr list
List pull requests for a repository, filtered by state. On Data Center, the project and repo are resolved from the active context (or --project/--repo). On Cloud, the workspace and repo are used instead.
When --mine is set without a specific repository, the command lists pull requests authored by the authenticated user across all repositories. On Data Center this uses the dashboard API; on Cloud it queries the workspace.
Alias: ls
Usage
bkt pr list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--limit | Maximum pull requests to list (0 for all) | |
--mine | Show pull requests authored by the authenticated user | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--state | Filter by state (OPEN, MERGED, DECLINED) | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List open pull requests
bkt pr list
# List merged pull requests
bkt pr list --state MERGED
# List your own pull requests across all repositories
bkt pr list --mine
# List pull requests with a limit
bkt pr list --limit 50 --state OPENbkt pr merge
Merge a pull request. The source branch is closed by default (use --close-source=false to keep it). An optional merge strategy can be specified (e.g. fast-forward, squash) and a custom merge commit message can be provided.
Works on both Data Center and Cloud. On Data Center, the current PR version is used for optimistic locking.
Usage
bkt pr merge <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--close-source | Close source branch on merge | |
--message | Merge commit message override | |
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--strategy | Merge strategy ID (e.g., fast-forward) | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Merge a pull request
bkt pr merge 42
# Merge with a custom commit message
bkt pr merge 42 --message "Release v1.2.0"
# Merge using fast-forward strategy and keep source branch
bkt pr merge 42 --strategy fast-forward --close-source=falsebkt pr publish
Toggle a pull request between draft and published states. By default, this command publishes a draft pull request so it is visible for review. Use --undo to convert a published pull request back to draft.
Works on both Data Center (8.18+) and Cloud. If the pull request is already in the desired state, the command prints a warning and exits without error.
Alias: ready
Usage
bkt pr publish <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--undo | Convert a pull request back to draft | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Publish a draft pull request
bkt pr publish 42
# Convert a pull request back to draft
bkt pr publish 42 --undobkt pr reaction
List, add, or remove emoji reactions on pull request comments.
Data Center only. Not yet supported on Cloud.
bkt pr reaction <command> [flags]Examples
# List reactions on a comment
bkt pr reaction list 42 1001
# Add a thumbs-up reaction
bkt pr reaction add 42 1001 --emoji :thumbsup:
# Remove a reaction
bkt pr reaction remove 42 1001 --emoji :thumbsup:| Subcommand | Description |
|---|---|
| add | Add a reaction to a comment (DC only) |
| list | List comment reactions (DC only) |
| remove | Remove a reaction (DC only) |
bkt pr reaction add
Add an emoji reaction to a pull request comment. Data Center only.
Usage
bkt pr reaction add <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--emoji | Emoji to add (e.g. :thumbsup:) | |
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Add a thumbs-up reaction to comment 1001
bkt pr reaction add 42 1001 --emoji :thumbsup:bkt pr reaction list
List all emoji reactions on a specific pull request comment. Shows each emoji and its count. Data Center only.
Usage
bkt pr reaction list <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List reactions on comment 1001 of PR #42
bkt pr reaction list 42 1001bkt pr reaction remove
Remove an emoji reaction from a pull request comment. Data Center only.
Usage
bkt pr reaction remove <id> <comment-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--emoji | Emoji to remove | |
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Remove a thumbs-up reaction from comment 1001
bkt pr reaction remove 42 1001 --emoji :thumbsup:bkt pr reopen
Reopen a previously declined pull request, returning it to the OPEN state.
Works on both Data Center and Cloud. On Data Center, the current PR version is used for optimistic locking.
Usage
bkt pr reopen <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Reopen a declined pull request
bkt pr reopen 42bkt pr reviewer-group
List, add, or remove default reviewer groups for a repository.
Data Center only. Not yet supported on Cloud.
bkt pr reviewer-group <command> [flags]Examples
# List configured reviewer groups
bkt pr reviewer-group list
# Add a reviewer group
bkt pr reviewer-group add backend-team
# Remove a reviewer group
bkt pr reviewer-group remove backend-team| Subcommand | Description |
|---|---|
| add | Add a default reviewer group (DC only) |
| list | List default reviewer groups (DC only) |
| remove | Remove a default reviewer group (DC only) |
bkt pr reviewer-group add
Add a default reviewer group to the repository. Data Center only.
Usage
bkt pr reviewer-group add <group> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Add a reviewer group
bkt pr reviewer-group add backend-teambkt pr reviewer-group list
List the default reviewer groups configured for a repository. Data Center only.
Usage
bkt pr reviewer-group list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List reviewer groups
bkt pr reviewer-group listbkt pr reviewer-group remove
Remove a default reviewer group from the repository. Data Center only.
Usage
bkt pr reviewer-group remove <group> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Remove a reviewer group
bkt pr reviewer-group remove backend-teambkt pr suggestion
Apply or preview a code suggestion attached to a pull request comment. By default, the suggestion is applied directly. Use --preview to see the suggested change without applying it.
Data Center only. Not yet supported on Cloud.
Usage
bkt pr suggestion <id> <comment-id> <suggestion-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--preview | Preview suggestion without applying | |
--project | Bitbucket project key override | |
--repo | Repository slug override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# Apply a code suggestion
bkt pr suggestion 42 1001 1
# Preview a suggestion without applying
bkt pr suggestion 42 1001 1 --previewbkt pr task
List, create, complete, or reopen tasks on a pull request.
On Bitbucket Data Center, pull request tasks are implemented as blocker comments (Data Center 7.2+). "bkt pr comments --details" surfaces them in review context, while "bkt pr task" is the focused task workflow; the two overlap by design. On Bitbucket Cloud, tasks are a separate first-class pull request resource.
bkt pr task <command> [flags]Examples
# List tasks on a pull request
bkt pr task list 42
# Create a task
bkt pr task create 42 --text "Update the changelog"
# Complete / reopen a task
bkt pr task complete 42 99
bkt pr task reopen 42 99| Subcommand | Description |
|---|---|
| complete | Complete (resolve) a pull request task |
| create | Create a task on a pull request |
| list | List tasks for a pull request |
| reopen | Reopen a resolved pull request task |
bkt pr task complete
Complete (resolve) a pull request task
Usage
bkt pr task complete <id> <task-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override (DC) | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
bkt pr task complete 42 99bkt pr task create
Create a task on a pull request
Usage
bkt pr task create <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override (DC) | |
--repo | Repository slug override | |
--text | Task text | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
bkt pr task create 42 --text "Add unit tests"bkt pr task list
List tasks for a pull request
Usage
bkt pr task list <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override (DC) | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
bkt pr task list 42bkt pr task reopen
Reopen a resolved pull request task
Usage
bkt pr task reopen <id> <task-id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override (DC) | |
--repo | Repository slug override | |
--workspace | Bitbucket Cloud workspace override |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
bkt pr task reopen 42 99bkt pr view
Display the title, state, author, source and target branches, description, and reviewers for a pull request. Use --web to open the pull request in your default browser instead of printing to the terminal.
Works on both Data Center and Cloud.
Usage
bkt pr view <id> [flags]Flags
| Flag | Short | Description |
|---|---|---|
--project | Bitbucket project key override | |
--repo | Repository slug override | |
--web | Open the pull request in your browser | |
--workspace | Bitbucket workspace override (Cloud) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# View pull request details
bkt pr view 42
# Open the pull request in a browser
bkt pr view 42 --web
# View a pull request in a different repository
bkt pr view 10 --repo my-other-repo<!-- auto-generated by cmd/docgen — do not edit -->
bkt project
List and inspect Bitbucket projects. Projects are top-level containers that group related repositories.
Note: Project commands are currently supported for Bitbucket Data Center only. Cloud workspaces use a different organizational model and are managed through other commands.
bkt project <command> [flags]Examples
# List all visible projects
bkt project list
# List projects on a specific host
bkt project list --host my-dc-serverSubcommands
| Subcommand | Description | Key Flags |
|---|---|---|
| list | List Bitbucket Data Center projects (DC) | --host, --limit |
bkt project list
List all projects visible to the authenticated user on a Bitbucket Data Center instance. Each project is displayed with its key, name, description, web URL, and visibility status. Use --limit to control the number of results returned.
This command is only available for Data Center hosts. Attempting to run it against a Cloud context will return an error.
Alias: ls
Usage
bkt project list [flags]Flags
| Flag | Short | Description |
|---|---|---|
--host | Host key or base URL override | |
--limit | Maximum projects to display (0 for all) |
Inherited Flags
| Flag | Short | Description |
|---|---|---|
--context | -c | Active Bitbucket context name |
--format | Output format: json or yaml (alias for --json/--yaml) | |
--jq | Apply a jq expression to JSON output (requires --json or --format json) | |
--json | Output in JSON format when supported | |
--template | Render output using Go templates | |
--yaml | Output in YAML format when supported |
Examples
# List projects (default limit of 30)
bkt project list
# List all projects without a limit
bkt project ls --limit 0
# List projects on a specific Data Center host
bkt project list --host my-dc-server
# List projects in JSON format
bkt project list --jsonRelated skills
How it compares
Use bkt for Bitbucket Data Center server admin; use Git hosting REST clients when managing repositories and pull requests rather than on-prem server secrets and logging.
FAQ
What does bkt do?
Bitbucket CLI for Data Center and Cloud. Use when users need to manage repositories, pull requests, branches, issues, webhooks, or pipelines in Bitbucket. Triggers include "bitbucket", "bkt", "pull request", "PR", "repo
When should I use bkt?
Bitbucket CLI for Data Center and Cloud. Use when users need to manage repositories, pull requests, branches, issues, webhooks, or pipelines in Bitbucket. Triggers include "bitbucket", "bkt", "pull request", "PR", "repo
What are common prerequisites?
--- name: bkt version: 0.28.2 description: Bitbucket CLI for Data Center and Cloud.
Is Bkt safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.