Bitbucket
Work with Bitbucket from chat — browse repositories, inspect files, manage branches, review pull requests, and coordinate repository workflows via the Bitbucket Cloud API with OAuth authentication.
This skill uses ClawLink for hosted connection flows and credentials so you do not need to configure Bitbucket API access yourself.
Setup in 3 Steps
| Step 1: Install | Step 2: Pair Account | Step 3: Connect Bitbucket |
|:---:|:---:|:---:|
|
|
| App-specific connection GIF coming soon |
| Run the install command in OpenClaw | Sign in and approve the device | Open the dashboard and connect Bitbucket |
How It Works
┌─────────────────┐ ┌──────────────┐ ┌──────────────────────┐
│ OpenClaw │────▶│ ClawLink │────▶│ Bitbucket Cloud API │
│ (User Chat) │ │ (OAuth) │ │ (Repos/PRs/Branches)│
└─────────────────┘ └──────────────┘ └──────────────────────┘
│ │ │
│ 1. Install Plugin │ │
│ 2. Pair Device │ │
│ 3. Connect Bitbucket │ │
│ │ 4. Secure Token │
│ │ 5. Proxy Requests │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ SKILL │ │ Dashboard│ │ Bitbucket│
│ File │ │ Auth │ │ Cloud │
└──────────┘ └──────────┘ └──────────┘
Install
Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.
openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
Then tell the user: "OpenClaw has been restarted. Send /new as a standalone message to start a fresh chat, then ask for Bitbucket again."
Quick Start
# List repositories in a workspace
clawlink_call_tool --tool "bitbucket_list_repositories_in_workspace" --params '{"workspace": "your-workspace"}'
# List branches in a repository
clawlink_call_tool --tool "bitbucket_list_branches" --params '{"workspace": "your-workspace", "repo_slug": "your-repo"}'
# Get a pull request
clawlink_call_tool --tool "bitbucket_get_pull_request" --params '{"workspace": "your-workspace", "repo_slug": "your-repo", "pull_request_id": 1}'
Authentication
All Bitbucket tool calls are authenticated automatically by ClawLink using the user's connected Bitbucket account.
No API key is required in chat. ClawLink stores the OAuth token securely and injects it into every Bitbucket API request on the user's behalf.
Getting Connected
- Install the ClawLink plugin (see Install above).
- Pair the plugin with
clawlink_begin_pairingif it is not configured yet. - Open https://claw-link.dev/dashboard?add=bitbucket and connect Bitbucket.
- Call
clawlink_list_integrationsto verify the connection is active.
Connection Management
List Connections
clawlink_list_integrations
Response: Returns all connected integrations. Look for bitbucket in the list.
Verify Connection
clawlink_list_tools --integration bitbucket
Response: Returns the live tool catalog for Bitbucket.
Reconnect
If Bitbucket tools are missing or the connection shows an error:
- Direct the user to https://claw-link.dev/dashboard?add=bitbucket
- After they confirm, call
clawlink_list_integrationsto verify - Then call
clawlink_list_tools --integration bitbucket
Security& Permissions
- Access is scoped to repositories and resources accessible to the connected Bitbucket account.
- All write operations require explicit user confirmation. Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.
- Destructive actions (delete repository, delete branch, delete issue) are marked as high-impact and must be confirmed.
- Repository deletion does not affect forks.
Tool Reference
Repository Operations
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_repositories_in_workspace | List repositories in a workspace | Read |
| bitbucket_list_repositories | List public repositories | Read |
| bitbucket_get_repository | Get repository metadata | Read |
| bitbucket_create_repository | Create a new repository in a workspace | Write |
| bitbucket_delete_repository | Permanently delete a repository | Write |
| bitbucket_browse_repository_path | Get file content or list directory at a revision | Read |
| bitbucket_get_file_from_repository | Get a specific file's content at a commit | Read |
| bitbucket_list_repository_paths | List files and directories under a path | Read |
Branch Operations
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_branches | List branches with optional name filtering | Read |
| bitbucket_get_branch | Get branch metadata and target commit | Read |
| bitbucket_create_branch | Create a new branch from a target commit | Write |
| bitbucket_get_repositories_branching_model | Get the repository's branch workflow configuration | Read |
| bitbucket_get_repositories_effective_branching_model | Get effective branching model (including inheritance) | Read |
Commit Operations
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_commits | List commits with optional branch/path filters | Read |
| bitbucket_get_repositories_commit | Get detailed commit information | Read |
| bitbucket_get_commit_diff | Get the unified diff for a commit or range | Read |
| bitbucket_get_commit_changes | Get changed files in a commit | Read |
| bitbucket_get_commit_build_status | Get build status for a commit | Read |
| bitbucket_get_commit_diffstat | Get diffstat (files changed, lines added/removed) | Read |
Pull Request Operations
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_pull_requests | List pull requests by state (OPEN/MERGED/DECLINED) | Read |
| bitbucket_get_pull_request | Get a single pull request with full details | Read |
| bitbucket_get_pull_request_commits | Get commits included in a PR | Read |
| bitbucket_get_pull_request_diff | Get the unified diff for a PR | Read |
| bitbucket_get_pull_request_diffstat | Get diffstat for a PR | Read |
| bitbucket_create_pull_request | Create a new pull request | Write |
| bitbucket_update_pull_request | Update PR title, description, or reviewers | Write |
| bitbucket_merge_pull_request | Merge a pull request | Write |
| bitbucket_approve_pull_request | Approve a pull request | Write |
| bitbucket_request_pull_request_changes | Request changes on a PR | Write |
| bitbucket_create_pull_request_comment | Add a top-level or threaded comment to a PR | Write |
| bitbucket_delete_pull_request_comment | Delete a PR comment | Write |
| bitbucket_resolve_pull_request_comment | Resolve or reopen a PR comment thread | Write |
Issue Operations
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_issues | List issues with optional state/priority filters | Read |
| bitbucket_create_issue | Create a new issue | Write |
| bitbucket_update_issue | Update issue attributes | Write |
| bitbucket_delete_issue | Permanently delete an issue | Write |
| bitbucket_create_issue_comment | Add a comment to an issue | Write |
User & Workspace
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_get_current_user | Get the authenticated user's profile | Read |
| bitbucket_list_workspaces | List workspaces accessible to the user | Read |
| bitbucket_get_workspace | Get workspace metadata | Read |
| bitbucket_list_workspace_members | List members of a workspace | Read |
| bitbucket_list_workspace_projects | List projects in a workspace | Read |
Pipelines & Deployments
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_list_pipelines | List pipeline runs for a repository | Read |
| bitbucket_get_repositories_pipelines2 | Get a specific pipeline's details | Read |
| bitbucket_list_repositories_environments | List deployment environments | Read |
| bitbucket_list_deployments | List deployment history | Read |
Code Search
| Tool | Description | Mode |
|------|-------------|------|
| bitbucket_get_workspaces_search_code | Search code across all repos in a workspace | Read |
| bitbucket_search_user_repositories_code | Search code in a specific user's repos | Read |
Code Examples
List branches in a repository
clawlink_call_tool --tool "bitbucket_list_branches" \
--params '{
"workspace": "your-workspace",
"repo_slug": "your-repo",
"q": "name~\"feature\""
}'
Create a pull request
clawlink_call_tool --tool "bitbucket_create_pull_request" \
--params '{
"workspace": "your-workspace",
"repo_slug": "your-repo",
"title": "Add new feature",
"source_branch": "feature/new-feature",
"destination_branch": "main",
"description": "This PR adds the new feature as described in issue #123"
}'
Approve a pull request
clawlink_call_tool --tool "bitbucket_approve_pull_request" \
--params '{
"workspace": "your-workspace",
"repo_slug": "your-repo",
"pull_request_id": 42
}'
Get file content from a repository
clawlink_call_tool --tool "bitbucket_get_file_from_repository" \
--params '{
"workspace": "your-workspace",
"repo_slug": "your-repo",
"path": "README.md",
"commit_revision": "main"
}'
Discovery Workflow
- Call
clawlink_list_integrationsto confirm Bitbucket is connected. - Call
clawlink_list_tools --integration bitbucketto see the live catalog. - Treat the returned list as the source of truth. Do not guess or assume what tools exist.
- If the user describes a capability but the exact tool is unclear, call
clawlink_search_toolswith a short query and integrationbitbucket. - If no Bitbucket tools appear, direct the user to https://claw-link.dev/dashboard?add=bitbucket.
Execution Workflow
┌─────────────────────────────────────────────────────────────┐
│ READ OPERATIONS (Safe) │
│ list → get → search → describe → call │
│ │
│ Example: List repos → List branches → Show results │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ WRITE OPERATIONS (Require Confirmation) │
│ list → get → describe → preview → confirm → call │
│ │
│ Example: Describe tool → Preview changes → User approves │
│ → Execute update │
└─────────────────────────────────────────────────────────────┘
- For unfamiliar tools, ambiguous requests, or any write action, call
clawlink_describe_toolfirst. - Use the returned guidance, schema,
whenToUse,askBefore,safeDefaults,examples, andfollowupsto shape the call. - Prefer read, list, search, and get operations before writes when that reduces ambiguity.
- For writes or anything marked as requiring confirmation, call
clawlink_preview_toolfirst. - Execute with
clawlink_call_tool. Pass confirmation only after the preview matches the user's intent. - If the tool call fails, report the real error. Do not invent results or restate the failure as a missing capability unless the live catalog supports that conclusion.
Notes
- Branch names must be unique within a repository and must not include the
refs/heads/prefix. - Pull request IDs are numeric. Use
bitbucket_list_pull_requeststo find PR IDs. - Repository deletion does not affect forks — forks are separate copies.
- Pagination: use the
nextfield in responses to iterate through large result sets. - BBQL (Bitbucket Query Language) supports server-side filtering for branch names.
Error Handling
| Status / Error | Meaning |
|----------------|---------|
| Tool not found | The tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration bitbucket. |
| Missing connection | Bitbucket is not connected. Direct the user to https://claw-link.dev/dashboard?add=bitbucket. |
| BranchNotFound | Branch does not exist. Check the branch name. |
| PullRequestNotFound | Pull request does not exist. Check the PR ID. |
| RepositoryNotFound | Repository does not exist or is not accessible. |
| InvalidArgument | Invalid parameter or missing required field. Review the tool schema with clawlink_describe_tool. |
| Write rejected | User did not confirm a write action. Always confirm before executing writes. |
Troubleshooting: Tools Not Visible
- Check that the ClawLink plugin is installed:
openclaw plugins list - If the plugin is installed but tools are missing, tell the user to send
/newas a standalone message to reload the catalog. - If a fresh chat does not help, run:
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json openclaw gateway restart - After restart, tell the user to send
/newagain and retry.
Troubleshooting: Invalid Tool Call
- Ensure the integration slug is exactly
bitbucket. - Use
clawlink_describe_toolto verify parameter names and types before calling. - For write operations, always call
clawlink_preview_toolfirst.
Resources
- Bitbucket Cloud REST API
- Bitbucket Repository API
- Bitbucket Pull Request API
- ClawLink: https://claw-link.dev/?utm_source=clawhub&utm_medium=referral&utm_content=bitbucket-repos
- ClawLink Docs: https://docs.claw-link.dev/openclaw
- ClawLink Verification: https://claw-link.dev/verify
Related Skills
- GitHub — For GitHub repository operations
- GitLab — For GitLab repository operations
- Jira — For Jira issue tracking
Powered by ClawLink — an integration hub for OpenClaw

Scan to join WeChat group