Bitbucket CLI (bkt)
Use bkt for Bitbucket Cloud and Data Center operations. Prefer structured
--json, --yaml, --jq, or --template output for automation.
Start with the requested operation
Run bkt --version only when installation or compatibility is uncertain. Run
bkt auth status when the command needs authentication or the active platform
and context are unknown. Do not make setup a prerequisite for an already
configured read-only request.
Cloud and Data Center have different feature sets. Determine the platform from
the active context or ask when it cannot be inferred. Do not suggest a Cloud-only
command for Data Center, or the reverse.
Read setup and common workflows when installing, authenticating,
creating a context, or learning the main command patterns. For config-free CI or
containers, read headless authentication.
Route to the command reference
Read only the reference for the requested command group:
- pull requests, repositories,
branches, commits, or
statuses
- Cloud issues, pipelines, or
variables
- Data Center administration,
projects, or permissions
- authentication, contexts,
webhooks, extensions,
MCP, skills, or raw API
Mutation and credential boundaries
- Listing, viewing, status, and checks are read-only. Create, edit, approve,
merge, delete, rerun, or permission changes modify Bitbucket; perform them
only when the user requested that change.
- Never place tokens, OAuth secrets, or passwords in commands that could enter
logs or committed files. Use the CLI's supported credential flow or environment
variables described in the auth references.
- Official release binaries embed the Cloud browser-OAuth consumer credentials.
Do not remove that behavior as generic hardening. Source and Nix builds may
require
BKT_OAUTH_CLIENT_ID and BKT_OAUTH_CLIENT_SECRET.
- Before a merge or other consequential write, inspect the exact target,
repository, and current checks. Report the resulting URL or identifier.
References
- 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)
- mcp — Model Context Protocol server for agents
- 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
- skill — Install and manage agent skills
- status — Inspect commit and pull request statuses
- variable — Manage pipeline variables (Cloud)
- webhook — Manage Bitbucket webhooks
- other — api
1---2name: bkt3description: Operate Bitbucket Cloud or Data Center repositories, pull requests, branches, issues, pipelines, permissions, and webhooks with bkt. Use when a request names Bitbucket or bkt; confirm the platform before platform-specific commands.4---5
6# Bitbucket CLI (`bkt`)
7
8Use `bkt` for Bitbucket Cloud and Data Center operations. Prefer structured
9`--json`, `--yaml`, `--jq`, or `--template` output for automation.
10
11## Start with the requested operation
12
13Run `bkt --version` only when installation or compatibility is uncertain. Run
14`bkt auth status` when the command needs authentication or the active platform
15and context are unknown. Do not make setup a prerequisite for an already
16configured read-only request.
17
18Cloud and Data Center have different feature sets. Determine the platform from
19the active context or ask when it cannot be inferred. Do not suggest a Cloud-only
20command for Data Center, or the reverse.
21
22Read [setup and common workflows](rules/guide.md) when installing, authenticating,
23creating a context, or learning the main command patterns. For config-free CI or
24containers, read [headless authentication](rules/headless.md).
25
26## Route to the command reference
27
28Read only the reference for the requested command group:
29
30- [pull requests](rules/pr.md), [repositories](rules/repo.md),
31 [branches](rules/branch.md), [commits](rules/commit.md), or
32 [statuses](rules/status.md)
33- [Cloud issues](rules/issue.md), [pipelines](rules/pipeline.md), or
34 [variables](rules/variable.md)
35- [Data Center administration](rules/admin.md),
36 [projects](rules/project.md), or [permissions](rules/perms.md)
37- [authentication](rules/auth.md), [contexts](rules/context.md),
38 [webhooks](rules/webhook.md), [extensions](rules/extension.md),
39 [MCP](rules/mcp.md), [skills](rules/skill.md), or [raw API](rules/other.md)
40
41## Mutation and credential boundaries
42
43- Listing, viewing, status, and checks are read-only. Create, edit, approve,
44 merge, delete, rerun, or permission changes modify Bitbucket; perform them
45 only when the user requested that change.
46- Never place tokens, OAuth secrets, or passwords in commands that could enter
47 logs or committed files. Use the CLI's supported credential flow or environment
48 variables described in the auth references.
49- Official release binaries embed the Cloud browser-OAuth consumer credentials.
50 Do not remove that behavior as generic hardening. Source and Nix builds may
51 require `BKT_OAUTH_CLIENT_ID` and `BKT_OAUTH_CLIENT_SECRET`.
52- Before a merge or other consequential write, inspect the exact target,
53 repository, and current checks. Report the resulting URL or identifier.
54
55## References
56
57<!-- auto-generated by cmd/docgen — do not edit below this line -->
58
59- [admin](rules/admin.md) — Administrative operations for Bitbucket *(DC)*
60- [auth](rules/auth.md) — Manage Bitbucket authentication credentials
61- [branch](rules/branch.md) — Inspect and manage branches
62- [commit](rules/commit.md) — Work with commits
63- [context](rules/context.md) — Manage Bitbucket CLI contexts
64- [extension](rules/extension.md) — Manage bkt CLI extensions
65- [issue](rules/issue.md) — Work with Bitbucket Cloud issues *(Cloud)*
66- [mcp](rules/mcp.md) — Model Context Protocol server for agents
67- [perms](rules/perms.md) — Manage Bitbucket permissions *(DC)*
68- [pipeline](rules/pipeline.md) — Run and inspect Bitbucket Cloud pipelines *(Cloud)*
69- [pr](rules/pr.md) — Manage pull requests
70- [project](rules/project.md) — Work with Bitbucket projects *(DC)*
71- [repo](rules/repo.md) — Work with Bitbucket repositories
72- [skill](rules/skill.md) — Install and manage agent skills
73- [status](rules/status.md) — Inspect commit and pull request statuses
74- [variable](rules/variable.md) — Manage pipeline variables *(Cloud)*
75- [webhook](rules/webhook.md) — Manage Bitbucket webhooks
76- [other](rules/other.md) — api
77
78<!-- end auto-generated -->