Automate pull requests, pipelines, branches, and repository management from your terminal. Bearer and Basic auth supported.
Full control over your Bitbucket Cloud workspace
List, create, update, and delete repositories. Bulk archive stale repos with dry-run. Full CRUD for projects and workspaces.
Create, approve, merge, and decline PRs. Add reviewers, post comments, and choose merge strategies (squash, merge commit, fast-forward).
List, trigger, and stop pipelines. View build logs. Trigger specific branches or custom pipelines by ref name.
Set branch restrictions, require minimum approvals, restrict merge strategies. List and manage branch protection rules.
Scoped API tokens with Bearer auth or classic Basic auth. Profile-specific Bitbucket tokens. Environment variable fallback chain.
Create, list, and delete webhooks. Subscribe to repo:push, pullrequest:created, and other events. Manage SSH deploy keys.
Production-ready scripts for Bitbucket automation
# List open pull requests as JSON
atlassian-cli bitbucket --workspace myteam \
pr list api-service \
--state OPEN --output json
# Approve and merge with squash strategy
atlassian-cli bitbucket --workspace myteam \
pr approve api-service 42
atlassian-cli bitbucket --workspace myteam \
pr merge api-service 42 \
--strategy merge_commit
# Create a new pull request
atlassian-cli bitbucket --workspace myteam \
pr create api-service \
--title "Add feature" \
--source feature/new \
--destination main
# List all branches in a repo
atlassian-cli bitbucket --workspace myteam \
branch list api-service
# Delete a merged feature branch
atlassian-cli bitbucket --workspace myteam \
branch delete api-service feature/old --force
# Bulk delete merged branches (dry-run first)
atlassian-cli bitbucket --workspace myteam \
bulk delete-branches api-service \
--exclude feature/keep --dry-run
# Protect main branch with 2 approvals
atlassian-cli bitbucket --workspace myteam \
branch protect api-service \
--pattern "main" \
--kind restrict_merges --approvals 2
# List all repos in a workspace
atlassian-cli bitbucket --workspace myteam \
repo list --output json
# Get repo details
atlassian-cli bitbucket --workspace myteam \
repo get api-service
# List repo permissions
atlassian-cli bitbucket --workspace myteam \
permission list api-service
# Bulk archive repos inactive for 180 days
atlassian-cli bitbucket --workspace myteam \
bulk archive-repos --days 180 --dry-run
# Check current user identity
atlassian-cli bitbucket whoami
Install and authenticate in under a minute
# Install via Homebrew
brew install omar16100/atlassian-cli/atlassian-cli
# Basic auth (email + API token)
atlassian-cli auth login \
--profile bb-work \
--base-url your-domain.atlassian.net \
--email you@company.com
# Bearer token auth (scoped Bitbucket token)
atlassian-cli auth login \
--profile bb-ci \
--bitbucket --bearer \
--workspace myteam
# Verify authentication
atlassian-cli bitbucket whoami --profile bb-ci
# List repos in your workspace
atlassian-cli bitbucket --workspace myteam \
repo list --limit 10
Guides, runbooks, and more