Bitbucket
/install atlassian-bitbucket
\r \r
Bitbucket Cloud (Read-Only)\r
\r
Browse repos, review PRs, read diffs and source code via a bash CLI wrapper. Read-only access — the agent cannot create, merge, or modify anything. No jq required — uses python3 for JSON parsing.\r
\r
Script location: {baseDir}/bitbucket-cli.sh\r
\r
Setup\r
\r Set these environment variables on your OpenClaw gateway:\r \r
ATLASSIAN_EMAIL— the Atlassian account email\rBITBUCKET_API_TOKEN— a scoped API token with Repositories: Read and Pull requests: Read only. Create at id.atlassian.com/manage-profile/security/api-tokens, select Bitbucket as the app.\rBITBUCKET_WORKSPACE— the workspace slug from your Bitbucket URLs (e.g.mycompanyfrombitbucket.org/mycompany/repo)\r \r Security note: Use a separate read-only scoped token for Bitbucket, not the same token as Jira/Confluence. This ensures the agent cannot write to repositories even if instructed to.\r \r Make the script executable:chmod +x {baseDir}/bitbucket-cli.sh\r \r
Commands\r
\r
List repositories\r
\r
{baseDir}/bitbucket-cli.sh repos\r
```\r
\r
Returns: `[{ slug, name, full_name, language, updated, is_private, url }]`\r
\r
### List pull requests\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh prs my-repo\r
{baseDir}/bitbucket-cli.sh prs my-repo MERGED\r
```\r
\r
State: `OPEN` (default), `MERGED`, `DECLINED`.\r
\r
Returns: `{ total, pullrequests: [{ id, title, author, source, destination, state, created, updated, url }] }`\r
\r
### Get PR details\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh pr my-repo 42\r
```\r
\r
Returns: `{ id, title, description, author, source, destination, state, reviewers, created, updated, comment_count, url }`\r
\r
### Get PR diffstat (file change summary)\r
\r
Use this first to understand scope before reading the full diff.\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh diffstat my-repo 42\r
```\r
\r
Returns: `{ files_changed, total_added, total_removed, files: [{ path, status, lines_added, lines_removed }] }`\r
\r
### Get full diff\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh diff my-repo 42\r
```\r
\r
Returns raw unified diff text. For large PRs (500+ lines), read diffstat first.\r
\r
### Get PR comments\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh comments my-repo 42\r
```\r
\r
Returns: `{ count, comments: [{ id, author, content, inline, created }] }`\r
\r
Inline comments include `{ path, from, to }` showing which file and line.\r
\r
### List commits in a PR\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh pr-commits my-repo 42\r
```\r
\r
Returns: `[{ hash, message, author, date }]`\r
\r
### List branches\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh branches my-repo\r
{baseDir}/bitbucket-cli.sh branches my-repo "feature"\r
```\r
\r
Returns: `[{ name, hash, date, author }]`\r
\r
### Recent commits on a branch\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh commits my-repo main\r
```\r
\r
Returns: `[{ hash, message, author, date }]` (last 10)\r
\r
### Read file contents\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh file my-repo README.md\r
{baseDir}/bitbucket-cli.sh file my-repo src/main.py develop\r
```\r
\r
Returns raw file content. Default branch is `main` — always specify the branch explicitly if the user mentions a specific branch.\r
\r
### List directory contents\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh ls my-repo\r
{baseDir}/bitbucket-cli.sh ls my-repo src/\r
{baseDir}/bitbucket-cli.sh ls my-repo src/ develop\r
{baseDir}/bitbucket-cli.sh ls my-repo "" develop\r
```\r
\r
Returns: `[{ path, type, size }]`\r
\r
Default branch is `main`. To list root on a different branch, pass empty string as path.\r
\r
### Recursive directory listing\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh tree my-repo\r
{baseDir}/bitbucket-cli.sh tree my-repo src/\r
{baseDir}/bitbucket-cli.sh tree my-repo "" develop\r
```\r
\r
Returns one line per entry: `d` for directories, `f` for files. Sorted alphabetically. Use this to understand repo structure in a single call instead of calling `ls` on every subdirectory.\r
\r
### Search code\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh search "class UserService"\r
{baseDir}/bitbucket-cli.sh search "def process" my-repo\r
```\r
\r
Returns: `[{ file, repo, matched_lines }]`\r
\r
Searches across all repos in the workspace, or scoped to a specific repo.\r
\r
### Compare branches\r
\r
```bash\r
{baseDir}/bitbucket-cli.sh compare my-repo main develop\r
{baseDir}/bitbucket-cli.sh compare my-repo release/1.0 hotfix/bugfix\r
```\r
\r
Returns raw unified diff between two branches. Use when you need to see differences without an existing PR.\r
\r
## Repository Exploration\r
\r
When exploring a repository:\r
\r
1. **Always start with `tree`** to see the full directory structure in one call\r
2. **Read key files first**: README.md, package.json, requirements.txt, pom.xml, build.gradle, Makefile, Dockerfile, docker-compose.yml\r
3. **Never read every file** — pick the ones relevant to the task\r
4. **Specify the branch** — do not assume `main`. If the user mentions a branch, pass it to every command\r
5. For large repos, use `search` to find specific code instead of reading files one by one\r
\r
## Rules\r
\r
- This skill has READ-ONLY access. Never attempt to create, merge, approve, or decline PRs.\r
- For large diffs, always read diffstat before the full diff.\r
- All output is JSON to stdout (except `diff` and `file` which return raw text).\r
- Results are paginated: repos (max 50), PRs (max 25), branches (max 25), commits (max 10). If you need more, tell the user the results may be incomplete.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install atlassian-bitbucket - 安装完成后,直接呼叫该 Skill 的名称或使用
/atlassian-bitbucket触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Bitbucket 是什么?
Browse Bitbucket Cloud repos, review pull requests, read diffs, check branches. Use when user mentions PRs, code changes, diffs, branches, Bitbucket, or repo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 176 次。
如何安装 Bitbucket?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install atlassian-bitbucket」即可一键安装,无需额外配置。
Bitbucket 是免费的吗?
是的,Bitbucket 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Bitbucket 支持哪些平台?
Bitbucket 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Bitbucket?
由 Vuk Pejović(@pejovicvuk)开发并维护,当前版本 v1.0.2。