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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install atlassian-bitbucket - After installation, invoke the skill by name or use
/atlassian-bitbucket - Provide required inputs per the skill's parameter spec and get structured output
What is Bitbucket?
Browse Bitbucket Cloud repos, review pull requests, read diffs, check branches. Use when user mentions PRs, code changes, diffs, branches, Bitbucket, or repo... It is an AI Agent Skill for Claude Code / OpenClaw, with 176 downloads so far.
How do I install Bitbucket?
Run "/install atlassian-bitbucket" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Bitbucket free?
Yes, Bitbucket is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Bitbucket support?
Bitbucket is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Bitbucket?
It is built and maintained by Vuk Pejović (@pejovicvuk); the current version is v1.0.2.