Install
openclaw skills install atlassian-bitbucketBrowse Bitbucket Cloud repos, review pull requests, read diffs, check branches. Use when user mentions PRs, code changes, diffs, branches, Bitbucket, or repo names.
openclaw skills install atlassian-bitbucketBrowse 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.
Script location: {baseDir}/bitbucket-cli.sh
Set these environment variables on your OpenClaw gateway:
ATLASSIAN_EMAIL — the Atlassian account emailBITBUCKET_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.BITBUCKET_WORKSPACE — the workspace slug from your Bitbucket URLs (e.g. mycompany from bitbucket.org/mycompany/repo)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.
Make the script executable: chmod +x {baseDir}/bitbucket-cli.sh
{baseDir}/bitbucket-cli.sh repos
Returns: [{ slug, name, full_name, language, updated, is_private, url }]
{baseDir}/bitbucket-cli.sh prs my-repo
{baseDir}/bitbucket-cli.sh prs my-repo MERGED
State: OPEN (default), MERGED, DECLINED.
Returns: { total, pullrequests: [{ id, title, author, source, destination, state, created, updated, url }] }
{baseDir}/bitbucket-cli.sh pr my-repo 42
Returns: { id, title, description, author, source, destination, state, reviewers, created, updated, comment_count, url }
Use this first to understand scope before reading the full diff.
{baseDir}/bitbucket-cli.sh diffstat my-repo 42
Returns: { files_changed, total_added, total_removed, files: [{ path, status, lines_added, lines_removed }] }
{baseDir}/bitbucket-cli.sh diff my-repo 42
Returns raw unified diff text. For large PRs (500+ lines), read diffstat first.
{baseDir}/bitbucket-cli.sh comments my-repo 42
Returns: { count, comments: [{ id, author, content, inline, created }] }
Inline comments include { path, from, to } showing which file and line.
{baseDir}/bitbucket-cli.sh pr-commits my-repo 42
Returns: [{ hash, message, author, date }]
{baseDir}/bitbucket-cli.sh branches my-repo
{baseDir}/bitbucket-cli.sh branches my-repo "feature"
Returns: [{ name, hash, date, author }]
{baseDir}/bitbucket-cli.sh commits my-repo main
Returns: [{ hash, message, author, date }] (last 10)
{baseDir}/bitbucket-cli.sh file my-repo README.md
{baseDir}/bitbucket-cli.sh file my-repo src/main.py develop
Returns raw file content. Default branch is main — always specify the branch explicitly if the user mentions a specific branch.
{baseDir}/bitbucket-cli.sh ls my-repo
{baseDir}/bitbucket-cli.sh ls my-repo src/
{baseDir}/bitbucket-cli.sh ls my-repo src/ develop
{baseDir}/bitbucket-cli.sh ls my-repo "" develop
Returns: [{ path, type, size }]
Default branch is main. To list root on a different branch, pass empty string as path.
{baseDir}/bitbucket-cli.sh tree my-repo
{baseDir}/bitbucket-cli.sh tree my-repo src/
{baseDir}/bitbucket-cli.sh tree my-repo "" develop
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.
{baseDir}/bitbucket-cli.sh search "class UserService"
{baseDir}/bitbucket-cli.sh search "def process" my-repo
Returns: [{ file, repo, matched_lines }]
Searches across all repos in the workspace, or scoped to a specific repo.
{baseDir}/bitbucket-cli.sh compare my-repo main develop
{baseDir}/bitbucket-cli.sh compare my-repo release/1.0 hotfix/bugfix
Returns raw unified diff between two branches. Use when you need to see differences without an existing PR.
When exploring a repository:
tree to see the full directory structure in one callmain. If the user mentions a branch, pass it to every commandsearch to find specific code instead of reading files one by onediff and file which return raw text).