{"id":35324410,"url":"https://github.com/otaviosoaresp/bitbucket-cli","last_synced_at":"2026-04-07T23:31:44.638Z","repository":{"id":325699838,"uuid":"1102096854","full_name":"otaviosoaresp/bitbucket-cli","owner":"otaviosoaresp","description":" Command-line interface for Bitbucket Cloud. Manage pull requests, comments, approvals, and merges directly from your terminal. Built with TypeScript following the same architecture as   linear-cli.","archived":false,"fork":false,"pushed_at":"2025-11-22T20:15:55.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-22T22:10:32.704Z","etag":null,"topics":["atlassian","bitbucket","bitbucket-api","bitbucket-cli","bitbucket-cloud","cli","command-line","developer-tools","git","nodejs","pr-management","productivity","pull-requests","terminal","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/otaviosoaresp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T20:13:00.000Z","updated_at":"2025-11-22T20:18:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/otaviosoaresp/bitbucket-cli","commit_stats":null,"previous_names":["otaviosoaresp/bitbucket-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/otaviosoaresp/bitbucket-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviosoaresp%2Fbitbucket-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviosoaresp%2Fbitbucket-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviosoaresp%2Fbitbucket-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviosoaresp%2Fbitbucket-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otaviosoaresp","download_url":"https://codeload.github.com/otaviosoaresp/bitbucket-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviosoaresp%2Fbitbucket-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31533823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atlassian","bitbucket","bitbucket-api","bitbucket-cli","bitbucket-cloud","cli","command-line","developer-tools","git","nodejs","pr-management","productivity","pull-requests","terminal","typescript"],"created_at":"2025-12-31T01:04:44.215Z","updated_at":"2026-04-07T23:31:44.628Z","avatar_url":"https://github.com/otaviosoaresp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitbucket CLI\n\nCommand-line interface for Bitbucket Cloud. Manage pull requests, repositories, and more directly from your terminal.\n\n## Features\n\n- List, view, create, and manage pull requests\n- Interactive PR creation with templates\n- Git integration (auto-detect workspace and repo from remotes)\n- Approve and merge PRs from the command line\n- Comment management\n- Customizable PR templates\n\n## Installation\n\n```bash\nnpm install -g bitbucket-cli\n```\n\nOr install locally for development:\n\n```bash\ncd bitbucket-cli\nnpm install\nnpm run build\nnpm link\n```\n\n## Authentication\n\nBefore using the CLI, you need to authenticate with your Atlassian API token.\n\n```bash\nbitbucket auth login\n```\n\n### Creating an API Token\n\n1. Go to **https://id.atlassian.com/manage-profile/security/api-tokens**\n2. Click **\"Create API token\"**\n3. Give it a label (e.g., \"Bitbucket CLI\")\n4. Copy the generated token (shown only once)\n\n**Required scopes for the token:**\n- `read:user:bitbucket`\n- `read:pullrequest:bitbucket`\n- `read:project:bitbucket`\n- `read:me`\n- `read:account`\n- `write:pullrequest:bitbucket`\n\nThe login command will:\n1. Prompt you to enter your Atlassian account email\n2. Prompt you to enter the API token\n3. Validate the credentials\n4. Save them to `~/.config/bitbucket-cli/config.json`\n5. Optionally set a default workspace\n\n### Alternative: Environment Variables\n\nYou can also set your credentials via environment variables:\n\n```bash\nexport BITBUCKET_USERNAME=your_email@example.com\nexport BITBUCKET_API_TOKEN=your_token_here\nexport BITBUCKET_WORKSPACE=your_workspace_slug\n```\n\n## Usage\n\nThe CLI can be invoked using either `bitbucket` or `bb` (shorthand).\n\n### Authentication\n\n```bash\n# Login to Bitbucket\nbitbucket auth login\n```\n\n### Pull Requests\n\n#### List Pull Requests\n\n```bash\n# List all open PRs in current repository\nbitbucket pr list\n\n# List with filters\nbitbucket pr list --state MERGED --limit 10\n\n# List for specific workspace/repo\nbitbucket pr list --workspace myworkspace --repo myrepo\n```\n\nOptions:\n- `--state \u003cstate\u003e`: Filter by state (OPEN, MERGED, DECLINED, SUPERSEDED)\n- `--author \u003cusername\u003e`: Filter by author username\n- `--limit \u003cnumber\u003e`: Limit number of results (default: 50)\n- `--workspace \u003cworkspace\u003e`: Workspace slug\n- `--repo \u003crepo\u003e`: Repository slug\n\n#### View Pull Request\n\n```bash\n# View PR details\nbitbucket pr view 123\n\n# View PR in specific workspace/repo\nbitbucket pr view 123 --workspace myworkspace --repo myrepo\n```\n\nShows:\n- PR title, state, author\n- Source and destination branches\n- Description\n- Commit list\n- Diff statistics\n- Reviewers and approval status\n- PR URL\n\n#### Create Pull Request\n\n```bash\n# Create PR with title and description\nbitbucket pr create --title \"Feature: Add new component\" --description \"Description here\"\n\n# Create PR interactively (recommended)\nbitbucket pr create -i\n\n# Create PR with custom template\nbitbucket pr create -i --template feature\n\n# Create from specific branch\nbitbucket pr create -i --source feature/my-branch --destination develop\n```\n\nOptions:\n- `-i, --interactive`: Interactive mode (prompts for input)\n- `--title \u003ctitle\u003e`: PR title\n- `--description \u003cdescription\u003e`: PR description\n- `--source \u003cbranch\u003e`: Source branch (defaults to current branch)\n- `--destination \u003cbranch\u003e`: Destination branch (defaults to main)\n- `--template \u003cname\u003e`: Use a specific template\n- `--workspace \u003cworkspace\u003e`: Workspace slug\n- `--repo \u003crepo\u003e`: Repository slug\n\n#### Update Pull Request\n\n```bash\n# Update PR title\nbitbucket pr update 123 --title \"New title\"\n\n# Update PR description\nbitbucket pr update 123 --description \"Updated description\"\n\n# Update destination branch\nbitbucket pr update 123 --destination develop\n\n# Update multiple fields\nbitbucket pr update 123 --title \"New title\" --description \"New description\"\n```\n\nOptions:\n- `--title \u003ctitle\u003e`: New PR title\n- `--description \u003cdescription\u003e`: New PR description\n- `--destination \u003cbranch\u003e`: New destination branch\n- `--workspace \u003cworkspace\u003e`: Workspace slug\n- `--repo \u003crepo\u003e`: Repository slug\n\n#### Comment on Pull Request\n\n```bash\n# List comments\nbitbucket pr comment 123\n\n# Add a comment\nbitbucket pr comment 123 --body \"Looks good to me!\"\n```\n\n#### Approve Pull Request\n\n```bash\n# Approve a PR\nbitbucket pr approve 123\n\n# Unapprove a PR\nbitbucket pr approve 123 --unapprove\n```\n\n#### Merge Pull Request\n\n```bash\n# Merge a PR\nbitbucket pr merge 123\n\n# Merge with specific strategy\nbitbucket pr merge 123 --strategy squash\n\n# Merge and close source branch\nbitbucket pr merge 123 --close-source-branch\n\n# Merge with custom message\nbitbucket pr merge 123 --message \"Merged feature X\"\n```\n\nOptions:\n- `--strategy \u003cstrategy\u003e`: Merge strategy (merge_commit, squash, fast_forward)\n- `--message \u003cmessage\u003e`: Custom merge commit message\n- `--close-source-branch`: Close source branch after merge\n\n## Templates\n\nTemplates allow you to pre-populate PR descriptions with a standard format.\n\n### Template Location\n\nTemplates are stored in `~/.config/bitbucket-cli/templates/` as Markdown files.\n\n### Default Template\n\nThe CLI comes with a default template. You can customize it by editing:\n\n```bash\n~/.config/bitbucket-cli/templates/default.md\n```\n\n### Creating Custom Templates\n\n1. Create a new `.md` file in the templates directory:\n\n```bash\nvi ~/.config/bitbucket-cli/templates/feature.md\n```\n\n2. Add your template content with optional variables:\n\n```markdown\n## Feature: {{branch}}\n\n### Summary\nBrief description of the feature\n\n### Changes\n- Change 1\n- Change 2\n\n### Testing\nHow to test this feature\n\n### Notes\nAdditional context\n```\n\n3. Use it when creating a PR:\n\n```bash\nbitbucket pr create -i --template feature\n```\n\n### Template Variables\n\nAvailable variables:\n- `{{branch}}`: Current branch name\n- `{{workspace}}`: Workspace slug\n- `{{repo}}`: Repository slug\n\n## Git Integration\n\nThe CLI automatically detects your workspace and repository from git remotes:\n\n```bash\n# If your remote is: git@bitbucket.org:myworkspace/myrepo.git\n# These are equivalent:\nbitbucket pr list\nbitbucket pr list --workspace myworkspace --repo myrepo\n```\n\nThis works for both SSH and HTTPS remotes.\n\n## Configuration\n\nConfiguration is stored in `~/.config/bitbucket-cli/config.json`:\n\n```json\n{\n  \"apiToken\": \"your_token\",\n  \"workspace\": \"default_workspace\",\n  \"defaultRepo\": \"default_repo\"\n}\n```\n\nPriority order:\n1. Command-line options (`--workspace`, `--repo`)\n2. Environment variables (`BITBUCKET_API_TOKEN`, `BITBUCKET_WORKSPACE`)\n3. Git remote (auto-detected)\n4. Config file\n\n## Examples\n\n### Complete PR Workflow\n\n```bash\n# 1. Create a feature branch\ngit checkout -b feature/new-component\n\n# 2. Make changes and commit\ngit add .\ngit commit -m \"Add new component\"\n\n# 3. Push to Bitbucket\ngit push -u origin feature/new-component\n\n# 4. Create PR interactively\nbitbucket pr create -i\n\n# 5. List your PRs\nbitbucket pr list --author your-username\n\n# 6. View PR details\nbitbucket pr view 123\n\n# 7. After review, merge\nbitbucket pr merge 123 --strategy squash --close-source-branch\n```\n\n### Quick Commands\n\n```bash\n# List open PRs\nbb pr list\n\n# View specific PR\nbb pr view 123\n\n# Approve PR\nbb pr approve 123\n\n# Create PR from current branch\nbb pr create -i\n```\n\n## Development\n\n### Build\n\n```bash\nnpm run build\n```\n\n### Watch Mode\n\n```bash\nnpm run dev\n```\n\n### Run Locally\n\n```bash\nnpm start -- pr list\n```\n\n## Requirements\n\n- Node.js \u003e= 18.0.0\n- Bitbucket Cloud account\n- API token with appropriate permissions\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviosoaresp%2Fbitbucket-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotaviosoaresp%2Fbitbucket-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviosoaresp%2Fbitbucket-cli/lists"}