bitbucketdc-cli
v1.0.42
Published
Command-line interface for [Bitbucket Data Center](https://developer.atlassian.com/server/bitbucket/rest/v819/intro/). Covers pull requests, commits, files, branches, tags, projects, repos, and comparisons.
Readme
bitbucketdc-cli
Command-line interface for Bitbucket Data Center. Covers pull requests, commits, files, branches, tags, projects, repos, and comparisons.
Install
npm install -g bitbucketdc-cliSetup
export BITBUCKET_URL="https://bitbucket.example.com" # Base URL of your Bitbucket instance
export BITBUCKET_TOKEN="your-personal-access-token" # HTTP Access Token from BitbucketCommands
All commands output JSON. Add --pretty to pretty-print.
pr
| Command | Description |
|---------|-------------|
| bitbucketdc pr inbox | List pull requests in your reviewer inbox |
| bitbucketdc pr get <project> <repo> <prId> | Get pull request details |
| bitbucketdc pr changes <project> <repo> <prId> | List changed files |
| bitbucketdc pr diff <project> <repo> <prId> | Get full diff (--format: text/json, --path to filter, --whitespace: show/ignore-all, --context-lines) |
| bitbucketdc pr activities <project> <repo> <prId> | List activities/events on a PR |
| bitbucketdc pr create <project> <repo> | Create a PR (auto-fetches default reviewers) |
| bitbucketdc pr comment <project> <repo> <prId> | Add a general comment |
| bitbucketdc pr file-comment <project> <repo> <prId> | Add a comment on a specific file |
| bitbucketdc pr line-comment <project> <repo> <prId> | Add an inline comment on a specific line |
| bitbucketdc pr delete-comment <project> <repo> <prId> <commentId> | Delete a comment |
| bitbucketdc pr edit-comment <project> <repo> <prId> <commentId> | Edit a comment |
| bitbucketdc pr reaction-add <project> <repo> <prId> <commentId> | Add emoji reaction to a comment |
| bitbucketdc pr reaction-remove <project> <repo> <prId> <commentId> | Remove emoji reaction from a comment |
| bitbucketdc pr review <project> <repo> <prId> <status> | Set review status (APPROVED, NEEDS_WORK, UNAPPROVED) |
| bitbucketdc pr update <project> <repo> <prId> | Update PR title/description |
| bitbucketdc pr can-merge <project> <repo> <prId> | Check merge eligibility |
| bitbucketdc pr merge <project> <repo> <prId> | Merge a PR (--strategy: merge-commit, squash, ff-only) |
| bitbucketdc pr decline <project> <repo> <prId> | Decline/close a PR |
| bitbucketdc pr delete <project> <repo> <prId> | Delete a PR |
| bitbucketdc pr linked-issues <project> <repo> <prId> | List Jira issues formally linked to the PR (per Bitbucket, not regex-parsed from the title) |
commit
| Command | Description |
|---------|-------------|
| bitbucketdc commit list | List commit history on a ref, optionally scoped by path or range |
| bitbucketdc commit get | Get metadata for a single commit |
| bitbucketdc commit changes | List changed files in a commit (--commit <ref>) |
| bitbucketdc commit diff | Get diff for a commit (--commit <ref>, --path to filter) |
| bitbucketdc commit build-status | List build statuses posted against a commit hash (--hash) |
compare
| Command | Description |
|---------|-------------|
| bitbucketdc compare changes <project> <repo> | List changed files between refs (--from, --to) |
| bitbucketdc compare diff <project> <repo> | Get diff between refs |
file
| Command | Description |
|---------|-------------|
| bitbucketdc file list <project> <repo> | List files and directories (--path, --at ref) |
| bitbucketdc file show <project> <repo> <path> | Show file content (--at ref) |
branch
| Command | Description |
|---------|-------------|
| bitbucketdc branch list | List branches with optional filters (--filter, --order-by, --details, --base) |
tag
| Command | Description |
|---------|-------------|
| bitbucketdc tag list | List tags with optional filters (--filter, --order-by) |
project
| Command | Description |
|---------|-------------|
| bitbucketdc project list | List Bitbucket projects |
repo
| Command | Description |
|---------|-------------|
| bitbucketdc repo list | List repositories (--project, --name filter) |
| bitbucketdc repo get | Get full repository metadata (includes defaultBranch, project, links) |
| bitbucketdc repo default-branch | Read the default branch configured for a repository |
| bitbucketdc repo clone <project> <repo> | Clone a repository |
| bitbucketdc repo attachment download <project> <repo> <path> | Download a repo attachment |
Pagination
List commands accept --limit to control page size. Responses include nextPage — pass it back as --start to fetch the next page. When nextPage is null, there are no more results.
Examples
# Check your PR inbox
bitbucketdc pr inbox
# Get a PR with full details
bitbucketdc pr get AI my-repo 42
# Review the diff
bitbucketdc pr diff AI my-repo 42 --context-lines 5
# Diff a single file within a PR
bitbucketdc pr diff AI my-repo 42 --path src/index.ts --format json
# Approve a PR
bitbucketdc pr review AI my-repo 42 APPROVED
# Leave an inline comment on a specific line
bitbucketdc pr line-comment --project AI --repo my-repo --id 42 --path src/index.ts --line 15 --line-type ADDED --file-type TO --body "Nitpick: rename this variable"
# Create a PR (auto-adds default reviewers)
bitbucketdc pr create AI my-repo --from feature/x --to main --title "Add feature X"
# Merge with squash
bitbucketdc pr merge AI my-repo 42 --strategy squash
# Browse files at a specific branch
bitbucketdc file list AI my-repo --path src/ --at develop
# Show file content
bitbucketdc file show AI my-repo src/config.ts --at main
# Search repos by name within a project
bitbucketdc repo list --project AI --name "tool"
# Inspect repo metadata and default branch
bitbucketdc repo get --project AI --repo delivery
bitbucketdc repo default-branch --project AI --repo delivery
# List release branches
bitbucketdc branch list --project AI --repo delivery --filter operator-release/
# Walk recent commit history
bitbucketdc commit list --project AI --repo delivery --until main --limit 10Breaking changes in this release
repo list --project-keyrenamed to--project(matches the flag naming used across every other command).file list/file show— the--branchalias has been removed. Use--at <ref>instead.pr file-diffhas been removed. Usepr diff --path <path> --format jsonto get the JSON diff for a single file within a PR.commit getnow takes--commit <ref>(consistent withcommit changesandcommit diff) instead of a positional argument.
