Skills atlassian-bitbucket-by-altf1be
Atlassian Bitbucket Cloud skill — full CRUD on repos, PRs, pipelines, issues, snippets, workspaces, branches, deployments, and more via Bitbucket REST API 2.0 with API Token auth.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/abdelkrim/atlassian-bitbucket-by-altf1be" ~/.claude/skills/clawdbot-skills-atlassian-bitbucket-by-altf1be && rm -rf "$T"
skills/abdelkrim/atlassian-bitbucket-by-altf1be/SKILL.mdAtlassian Bitbucket Cloud by @altf1be
Full CRUD on repos, PRs, pipelines, issues, snippets, workspaces, branches, deployments, and more via Bitbucket REST API 2.0.
Setup
- Create an API Token at https://id.atlassian.com/manage-profile/security/api-tokens (select the scopes you need).
- Set environment variables (or create
in.env
):{baseDir}
# Required BITBUCKET_EMAIL=you@example.com BITBUCKET_API_TOKEN=your-api-token # Optional BITBUCKET_WORKSPACE=your-default-workspace BITBUCKET_MAX_RESULTS=50 # Legacy (supported until June 9, 2026) # BITBUCKET_USERNAME=your-username # BITBUCKET_APP_PASSWORD=your-app-password
- Install dependencies:
cd {baseDir} && npm install
Common Options
Most commands accept these shared flags:
| Flag | Description |
|---|---|
| Workspace slug (or set ) |
| Repository slug |
| Results per page |
| Page number |
| Fetch all pages |
| Filter query (CQL-style) |
| Sort field |
| Required for all delete operations |
| Raw JSON body for complex payloads |
Commands
1. Repositories (26 commands)
CRUD on repositories, forks, watchers, webhooks, override settings, and permissions.
| Command | Description |
|---|---|
| List all public repositories |
| List repositories in a workspace |
| Get repository details |
| Create a new repository |
| Update repository settings |
| Delete a repository |
| List forks of a repository |
| Fork a repository |
| List repository watchers |
| List repository webhooks |
| Get a webhook by UID |
| Create a repository webhook |
| Update a webhook |
| Delete a webhook |
| Get repository override settings |
| Update repository override settings |
| List group permissions |
| Get a group's permission |
| Update a group's permission |
| Remove a group's permission |
| List user permissions |
| Get a user's permission |
| Update a user's permission |
| Remove a user's permission |
| List current user's repository permissions |
| List current user's repository permissions in a workspace |
# List repos in a workspace bitbucket repo-list -w myworkspace # Get repo details bitbucket repo-get -w myworkspace -r my-repo # Create a new private repo bitbucket repo-create -w myworkspace -r new-repo --is-private true --scm git # Fork a repo bitbucket repo-fork-create -w myworkspace -r upstream-repo --data '{"name":"my-fork"}' # Create a webhook bitbucket hook-create -w myworkspace -r my-repo --url https://example.com/hook --events repo:push # Delete a repo (requires --confirm) bitbucket repo-delete -w myworkspace -r old-repo --confirm
2. Pull Requests (36 commands)
Full lifecycle management of pull requests: create, review, approve, merge, comment, tasks, and default reviewers.
| Command | Description |
|---|---|
| List pull requests |
| Create a pull request |
| Get a pull request by ID |
| Update a pull request |
| Get PR activity log |
| Approve a pull request |
| Remove approval from a PR |
| List PR comments |
| Add a comment to a PR |
| Get a specific PR comment |
| Update a PR comment |
| Delete a PR comment |
| Resolve a PR comment thread |
| Reopen a resolved comment thread |
| List commits in a PR |
| Decline a pull request |
| Get the diff of a PR |
| Get the diffstat of a PR |
| Merge a pull request |
| Check merge task status |
| Get the patch of a PR |
| Request changes on a PR |
| Remove change request from a PR |
| List commit statuses on a PR |
| List tasks on a PR |
| Create a task on a PR |
| Get a specific PR task |
| Update a PR task |
| Delete a PR task |
| List default reviewers |
| Get a default reviewer |
| Add a default reviewer |
| Remove a default reviewer |
| List effective default reviewers |
| Find PRs containing a commit |
| Get activity across all PRs in a repo |
# List open PRs bitbucket pr-list -w myworkspace -r my-repo -q 'state="OPEN"' # Create a PR bitbucket pr-create -w myworkspace -r my-repo --title "Add feature" \ --source feature-branch --destination main # Approve a PR bitbucket pr-approve -w myworkspace -r my-repo --pr-id 42 # Merge a PR bitbucket pr-merge -w myworkspace -r my-repo --pr-id 42 --merge-strategy squash # Add a comment bitbucket pr-comment-create -w myworkspace -r my-repo --pr-id 42 \ --body "Looks good to me!" # Create a task on a PR bitbucket pr-task-create -w myworkspace -r my-repo --pr-id 42 \ --data '{"content":{"raw":"Fix the typo on line 10"}}' # Find PRs for a commit bitbucket pr-for-commit -w myworkspace -r my-repo --commit abc123
3. Commits (16 commands)
Read commit details, approve/unapprove commits, manage commit comments, list diffs and patches.
| Command | Description |
|---|---|
| Get a specific commit |
| Approve a commit |
| Remove commit approval |
| List comments on a commit |
| Add a comment to a commit |
| Get a specific commit comment |
| Update a commit comment |
| Delete a commit comment |
| List commits (GET) |
| List commits (POST, with body filters) |
| List commits from a revision (GET) |
| List commits from a revision (POST) |
| Get diff between two refs |
| Get diffstat between two refs |
| Get merge base of two refs |
| Get patch for a revision |
# Get commit details bitbucket commit-get -w myworkspace -r my-repo --commit abc123def # List recent commits bitbucket commit-list -w myworkspace -r my-repo --pagelen 10 # Get diff between two refs bitbucket diff -w myworkspace -r my-repo --spec "main..feature-branch" # Approve a commit bitbucket commit-approve -w myworkspace -r my-repo --commit abc123def # Comment on a commit bitbucket commit-comment-create -w myworkspace -r my-repo --commit abc123def \ --body "This needs a test."
4. Branches & Tags (9 commands)
List, create, get, and delete branches and tags.
| Command | Description |
|---|---|
| List all refs (branches + tags) |
| List branches |
| Create a branch |
| Get branch details |
| Delete a branch |
| List tags |
| Create an annotated tag |
| Get tag details |
| Delete a tag |
# List branches bitbucket branch-list -w myworkspace -r my-repo # Create a branch bitbucket branch-create -w myworkspace -r my-repo --name feature/new \ --target main # Create a tag bitbucket tag-create -w myworkspace -r my-repo --name v1.0.0 --target main # Delete a branch (requires --confirm) bitbucket branch-delete -w myworkspace -r my-repo --name old-branch --confirm
5. Branch Restrictions (5 commands)
Manage branch permission restrictions (push, merge, delete controls).
| Command | Description |
|---|---|
| List branch restrictions |
| Get a restriction by ID |
| Create a branch restriction |
| Update a branch restriction |
| Delete a branch restriction |
# List restrictions bitbucket restriction-list -w myworkspace -r my-repo # Prevent force-push to main bitbucket restriction-create -w myworkspace -r my-repo \ --data '{"kind":"force","pattern":"main"}' # Delete a restriction (requires --confirm) bitbucket restriction-delete -w myworkspace -r my-repo --id 123 --confirm
6. Branching Model (7 commands)
Get and configure the branching model (Git Flow style) at the repo and project level.
| Command | Description |
|---|---|
| Get repo branching model |
| Get repo branching model settings |
| Update repo branching model settings |
| Get effective branching model (inherited + overrides) |
| Get project branching model |
| Get project branching model settings |
| Update project branching model settings |
# Get effective branching model bitbucket branching-model-effective -w myworkspace -r my-repo # Update branching model settings bitbucket branching-model-settings-update -w myworkspace -r my-repo \ --data '{"development":{"name":"develop"},"production":{"name":"main"}}'
7. Pipelines (68 commands)
Full pipeline lifecycle: run, stop, inspect steps/logs, manage variables, schedules, SSH keys, known hosts, caches, runners, OIDC, and workspace/team/user-level pipeline variables.
| Command | Description |
|---|---|
| List pipelines |
| Get pipeline details |
| Trigger a new pipeline |
| Stop a running pipeline |
| List steps in a pipeline |
| Get a pipeline step |
| Get step log output |
| Get step container log |
| Get test reports for a step |
| Get test cases for a step |
| Get test case failure reasons |
| Get pipeline configuration |
| Update pipeline configuration |
| Update the next build number |
| List repo pipeline variables |
| Get a pipeline variable |
| Create a pipeline variable |
| Update a pipeline variable |
| Delete a pipeline variable |
| List pipeline schedules |
| Get a schedule |
| Create a pipeline schedule |
| Update a pipeline schedule |
| Delete a pipeline schedule |
| List schedule executions |
| Get SSH key pair |
| Update SSH key pair |
| Delete SSH key pair |
| List known hosts |
| Get a known host |
| Add a known host |
| Update a known host |
| Delete a known host |
| List pipeline caches |
| Delete all caches |
| Delete a cache by name |
| Get cache content URI |
| List repo pipeline runners |
| Get a pipeline runner |
| Create a pipeline runner |
| Update a pipeline runner |
| Delete a pipeline runner |
| List deployment environment variables |
| Create a deployment env variable |
| Update a deployment env variable |
| Delete a deployment env variable |
| List team pipeline variables |
| Get a team pipeline variable |
| Create a team pipeline variable |
| Update a team pipeline variable |
| Delete a team pipeline variable |
| List user pipeline variables |
| Get a user pipeline variable |
| Create a user pipeline variable |
| Update a user pipeline variable |
| Delete a user pipeline variable |
| Get workspace OIDC configuration |
| Get workspace OIDC keys |
| List workspace runners |
| Get a workspace runner |
| Create a workspace runner |
| Update a workspace runner |
| Delete a workspace runner |
| List workspace pipeline variables |
| Get a workspace pipeline variable |
| Create a workspace pipeline variable |
| Update a workspace pipeline variable |
| Delete a workspace pipeline variable |
# Trigger a pipeline on main bitbucket pipeline-create -w myworkspace -r my-repo \ --data '{"target":{"ref_type":"branch","type":"pipeline_ref_target","ref_name":"main"}}' # List recent pipelines bitbucket pipeline-list -w myworkspace -r my-repo --pagelen 5 # Get step logs bitbucket pipeline-step-log -w myworkspace -r my-repo \ --pipeline-uuid {uuid} --step-uuid {uuid} # Stop a running pipeline bitbucket pipeline-stop -w myworkspace -r my-repo --pipeline-uuid {uuid} # Create a repo pipeline variable (secured) bitbucket pipeline-var-create -w myworkspace -r my-repo \ --key API_KEY --value secret123 --secured true # Create a workspace-level variable bitbucket ws-pipeline-var-create -w myworkspace \ --key DEPLOY_TOKEN --value tok_abc --secured true # Schedule a pipeline bitbucket pipeline-schedule-create -w myworkspace -r my-repo \ --data '{"cron_pattern":"0 0 * * *","target":{"ref_type":"branch","ref_name":"main"}}'
8. Deployments (16 commands)
Manage deploy keys and deployment environments.
| Command | Description |
|---|---|
| List deploy keys |
| Get a deploy key |
| Add a deploy key |
| Update a deploy key |
| Delete a deploy key |
| List deployments |
| Get a deployment |
| List deployment environments |
| Get an environment |
| Create a deployment environment |
| Update a deployment environment |
| Delete a deployment environment |
| List project deploy keys |
| Get a project deploy key |
| Add a project deploy key |
| Delete a project deploy key |
# List deployment environments bitbucket environment-list -w myworkspace -r my-repo # Create a staging environment bitbucket environment-create -w myworkspace -r my-repo \ --data '{"name":"Staging","environment_type":{"name":"Staging"}}' # Add a deploy key bitbucket deploy-key-create -w myworkspace -r my-repo \ --key "ssh-rsa AAAA..." --label "CI deploy key" # Delete an environment (requires --confirm) bitbucket environment-delete -w myworkspace -r my-repo \ --environment-uuid {uuid} --confirm
9. Commit Statuses (4 commands)
Create and manage build statuses on commits.
| Command | Description |
|---|---|
| List commit statuses |
| Create a commit status |
| Get a commit status |
| Update a commit status |
# Report a build status bitbucket status-create -w myworkspace -r my-repo --commit abc123 \ --state SUCCESSFUL --key build-42 --url https://ci.example.com/42 # List statuses on a commit bitbucket status-list -w myworkspace -r my-repo --commit abc123
10. Issue Tracker (33 commands)
Full issue management: CRUD, comments, attachments, changes, voting, watching, import/export, components, milestones, and versions.
| Command | Description |
|---|---|
| List issues |
| Get an issue |
| Create an issue |
| Update an issue |
| Delete an issue |
| List issue comments |
| Get an issue comment |
| Add a comment to an issue |
| Update an issue comment |
| Delete an issue comment |
| List issue attachments |
| Get an issue attachment |
| Upload an attachment |
| Delete an attachment |
| List issue changes |
| Get an issue change |
| Create an issue change |
| Check if you voted on an issue |
| Vote on an issue |
| Remove your vote |
| Check if you are watching an issue |
| Watch an issue |
| Stop watching an issue |
| Start an issue export |
| Check export status |
| Start an issue import |
| Check import status |
| List components |
| Get a component |
| List milestones |
| Get a milestone |
| List versions |
| Get a version |
# List open bugs bitbucket issue-list -w myworkspace -r my-repo -q 'kind="bug" AND state="open"' # Create an issue bitbucket issue-create -w myworkspace -r my-repo \ --title "Login broken" --kind bug --priority critical # Comment on an issue bitbucket issue-comment-create -w myworkspace -r my-repo --issue-id 7 \ --body "Reproduced on Chrome 120." # Upload an attachment bitbucket issue-attachment-upload -w myworkspace -r my-repo --issue-id 7 \ --file ./screenshot.png # Export all issues bitbucket issue-export -w myworkspace -r my-repo # List milestones bitbucket milestone-list -w myworkspace -r my-repo
11. Snippets (25 commands)
Create and manage code snippets, their revisions, files, diffs, comments, commits, and watchers.
| Command | Description |
|---|---|
| List your snippets |
| Create a snippet |
| List workspace snippets |
| Create a workspace snippet |
| Get a snippet |
| Update a snippet |
| Delete a snippet |
| Get a snippet revision |
| Update a snippet revision |
| Delete a snippet revision |
| Get a file from a snippet |
| Get a file at a specific revision |
| Get diff between snippet revisions |
| Get patch for a snippet revision |
| List snippet comments |
| Get a snippet comment |
| Add a comment to a snippet |
| Update a snippet comment |
| Delete a snippet comment |
| List snippet commits |
| Get a snippet commit |
| Check if watching a snippet |
| Watch a snippet |
| Unwatch a snippet |
| List snippet watchers |
# List your snippets bitbucket snippet-list # Create a snippet bitbucket snippet-create --title "Bash helper" --is-private true \ --file ./helper.sh # List workspace snippets bitbucket snippet-ws-list -w myworkspace # Get a specific file from a snippet bitbucket snippet-file -w myworkspace --snippet-id abc123 --filename helper.sh # Delete a snippet (requires --confirm) bitbucket snippet-delete -w myworkspace --snippet-id abc123 --confirm
12. Workspaces (17 commands)
List workspaces, manage hooks, members, permissions, and list user PRs.
| Command | Description |
|---|---|
| List workspaces you belong to |
| List workspaces for a user |
| Get workspace permissions for a user |
| Get a specific user's workspace permission |
| Get workspace details |
| List workspace webhooks |
| Get a workspace webhook |
| Create a workspace webhook |
| Update a workspace webhook |
| Delete a workspace webhook |
| List workspace members |
| Get a workspace member |
| List workspace permissions |
| List repo-level permissions in workspace |
| Get repo-level permission |
| List projects in a workspace |
| List PRs authored by the current user in a workspace |
# List workspaces bitbucket workspace-list # Get workspace details bitbucket workspace-get -w myworkspace # List workspace members bitbucket workspace-member-list -w myworkspace # List my open PRs across the workspace bitbucket workspace-user-prs -w myworkspace -q 'state="OPEN"' # Create a workspace webhook bitbucket workspace-hook-create -w myworkspace \ --url https://example.com/hook --events repo:push,pullrequest:created
13. Projects (16 commands)
CRUD on projects, default reviewers, and group/user permissions at the project level.
| Command | Description |
|---|---|
| Create a project |
| Get a project |
| Update a project |
| Delete a project |
| List project default reviewers |
| Get a project default reviewer |
| Add a project default reviewer |
| Remove a project default reviewer |
| List project group permissions |
| Get a group's project permission |
| Update a group's project permission |
| Remove a group's project permission |
| List project user permissions |
| Get a user's project permission |
| Update a user's project permission |
| Remove a user's project permission |
# Create a project bitbucket project-create -w myworkspace --key PROJ --name "My Project" # List project default reviewers bitbucket project-default-reviewer-list -w myworkspace --project-key PROJ # Add a default reviewer to a project bitbucket project-default-reviewer-add -w myworkspace --project-key PROJ \ --user-uuid {uuid} # Delete a project (requires --confirm) bitbucket project-delete -w myworkspace --project-key PROJ --confirm
14. Users (4 commands)
Get current user info, list emails, and look up other users.
| Command | Description |
|---|---|
| Get the authenticated user |
| List your email addresses |
| Get a specific email address |
| Get a user by UUID or username |
# Get current user info bitbucket user-get-current # List your emails bitbucket user-emails # Look up another user bitbucket user-get --user-uuid {uuid}
15. SSH Keys (5 commands)
Manage SSH keys on your Bitbucket account.
| Command | Description |
|---|---|
| List SSH keys |
| Get an SSH key |
| Add an SSH key |
| Update an SSH key label |
| Delete an SSH key |
# List SSH keys bitbucket ssh-key-list # Add an SSH key bitbucket ssh-key-create --key "ssh-ed25519 AAAA..." --label "work laptop" # Delete an SSH key (requires --confirm) bitbucket ssh-key-delete --key-id 123 --confirm
16. GPG Keys (4 commands)
Manage GPG keys for commit signature verification.
| Command | Description |
|---|---|
| List GPG keys |
| Get a GPG key |
| Add a GPG key |
| Delete a GPG key |
# List GPG keys bitbucket gpg-key-list # Add a GPG key bitbucket gpg-key-create --key "-----BEGIN PGP PUBLIC KEY BLOCK-----..." # Delete a GPG key (requires --confirm) bitbucket gpg-key-delete --key-id abc123 --confirm
17. Source / File Browsing (4 commands)
Browse repository source files and commit new files.
| Command | Description |
|---|---|
| Get file history |
| List files at the repo root (or a path) |
| Create/update a file via commit |
| Get file contents |
# List files at root bitbucket src-root -w myworkspace -r my-repo # Get file contents bitbucket src-get -w myworkspace -r my-repo --path src/index.js # Get file history bitbucket src-history -w myworkspace -r my-repo --path README.md # Create/update a file bitbucket src-create -w myworkspace -r my-repo \ --path config.yml --message "Add config" --file ./config.yml
18. Downloads (4 commands)
Manage repository download artifacts.
| Command | Description |
|---|---|
| List downloads |
| Get a download |
| Upload a download artifact |
| Delete a download |
# List downloads bitbucket download-list -w myworkspace -r my-repo # Upload an artifact bitbucket download-upload -w myworkspace -r my-repo --file ./release-v1.0.zip # Delete a download (requires --confirm) bitbucket download-delete -w myworkspace -r my-repo --filename release-v1.0.zip --confirm
19. Webhooks (2 commands)
Discover available webhook event types.
| Command | Description |
|---|---|
| List all webhook event subjects |
| List event types for a subject |
# List webhook event subjects bitbucket webhook-events # List event types for a subject bitbucket webhook-event-types --subject repository
20. Search (3 commands)
Search code, accounts, and teams.
| Command | Description |
|---|---|
| Search for code in a workspace |
| Search for accounts |
| Search for teams |
# Search code bitbucket search-code -w myworkspace --search-query "import express" # Search for an account bitbucket search-account --search-query "john"
21. Reports (9 commands)
Manage commit reports and annotations (code quality, security, etc.).
| Command | Description |
|---|---|
| List reports on a commit |
| Get a report |
| Create a report |
| Delete a report |
| List report annotations |
| Get a report annotation |
| Create an annotation |
| Bulk create annotations |
| Delete an annotation |
# Create a code quality report bitbucket report-create -w myworkspace -r my-repo --commit abc123 \ --report-id lint-report --title "ESLint" --report-type BUG \ --data '{"result":"PASSED"}' # Add annotations to a report bitbucket report-annotation-bulk-create -w myworkspace -r my-repo \ --commit abc123 --report-id lint-report \ --data '[{"path":"src/app.js","line":42,"message":"Unused variable","severity":"MEDIUM"}]' # List reports on a commit bitbucket report-list -w myworkspace -r my-repo --commit abc123
22. Properties (12 commands)
Get, set, and delete application properties on commits, repos, PRs, and users.
| Command | Description |
|---|---|
| Get a commit property |
| Set a commit property |
| Delete a commit property |
| Get a repo property |
| Set a repo property |
| Delete a repo property |
| Get a PR property |
| Set a PR property |
| Delete a PR property |
| Get a user property |
| Set a user property |
| Delete a user property |
# Set a repo property bitbucket repo-property-update -w myworkspace -r my-repo \ --app-key myapp --property-name env --data '{"tier":"production"}' # Get a repo property bitbucket repo-property-get -w myworkspace -r my-repo \ --app-key myapp --property-name env # Delete a PR property (requires --confirm) bitbucket pr-property-delete -w myworkspace -r my-repo --pr-id 42 \ --app-key myapp --property-name review-status --confirm
23. Addon (10 commands)
Manage Bitbucket Connect addon lifecycle, linkers, and linker values.
| Command | Description |
|---|---|
| Uninstall the addon |
| Update the addon descriptor |
| List addon linkers |
| Get an addon linker |
| Delete all linker values |
| List linker values |
| Create a linker value |
| Update a linker value |
| Delete a linker value |
| Get a linker value |
# List addon linkers bitbucket addon-linkers # Create a linker value bitbucket addon-linker-value-create --linker-key my-linker \ --data '{"key":"issue-42","href":"https://tracker.example.com/42"}' # Delete a linker value (requires --confirm) bitbucket addon-linker-value-delete --linker-key my-linker --value-id 42 --confirm
Security
- Auth method: Basic auth with App Passwords (BITBUCKET_USERNAME + BITBUCKET_APP_PASSWORD)
- No secrets or tokens printed to stdout
- All delete operations require explicit
flag--confirm - Path traversal prevention for file uploads (
)safePath() - Built-in rate limiting with exponential backoff retry (3 attempts)
- File size validation before upload
- Lazy config validation (only checked when a command runs)
Dependencies
— CLI frameworkcommander
— environment variable loadingdotenv- Node.js built-in
(requires Node >= 18)fetch
Author
Abdelkrim BOUJRAF — ALT-F1 SRL, Brussels X: @altf1be