bitbucketdc-cli 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# bitbucketdc-cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for [Bitbucket Data Center](https://developer.atlassian.com/server/bitbucket/rest/v819/intro/). 33 commands across 6 domains — pull requests, commits, files, projects, repos, and comparisons.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g bitbucketdc-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export BITBUCKET_URL="https://bitbucket.example.com" # Base URL of your Bitbucket instance
|
|
15
|
+
export BITBUCKET_TOKEN="your-personal-access-token" # HTTP Access Token from Bitbucket
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
All commands output JSON. Add `--pretty` to pretty-print.
|
|
21
|
+
|
|
22
|
+
### pr
|
|
23
|
+
|
|
24
|
+
| Command | Description |
|
|
25
|
+
|---------|-------------|
|
|
26
|
+
| `bitbucketdc pr inbox` | List pull requests in your reviewer inbox |
|
|
27
|
+
| `bitbucketdc pr get <project> <repo> <prId>` | Get pull request details |
|
|
28
|
+
| `bitbucketdc pr changes <project> <repo> <prId>` | List changed files |
|
|
29
|
+
| `bitbucketdc pr diff <project> <repo> <prId>` | Get full diff (`--format`: text/json, `--whitespace`: show/ignore-all, `--context-lines`) |
|
|
30
|
+
| `bitbucketdc pr file-diff <project> <repo> <prId> <path>` | Get diff for a specific file |
|
|
31
|
+
| `bitbucketdc pr activities <project> <repo> <prId>` | List activities/events on a PR |
|
|
32
|
+
| `bitbucketdc pr create <project> <repo>` | Create a PR (auto-fetches default reviewers) |
|
|
33
|
+
| `bitbucketdc pr comment <project> <repo> <prId>` | Add a general comment |
|
|
34
|
+
| `bitbucketdc pr file-comment <project> <repo> <prId>` | Add a comment on a specific file |
|
|
35
|
+
| `bitbucketdc pr line-comment <project> <repo> <prId>` | Add an inline comment on a specific line |
|
|
36
|
+
| `bitbucketdc pr delete-comment <project> <repo> <prId> <commentId>` | Delete a comment |
|
|
37
|
+
| `bitbucketdc pr edit-comment <project> <repo> <prId> <commentId>` | Edit a comment |
|
|
38
|
+
| `bitbucketdc pr reaction-add <project> <repo> <prId> <commentId>` | Add emoji reaction to a comment |
|
|
39
|
+
| `bitbucketdc pr reaction-remove <project> <repo> <prId> <commentId>` | Remove emoji reaction from a comment |
|
|
40
|
+
| `bitbucketdc pr review <project> <repo> <prId> <status>` | Set review status (APPROVED, NEEDS_WORK, UNAPPROVED) |
|
|
41
|
+
| `bitbucketdc pr update <project> <repo> <prId>` | Update PR title/description |
|
|
42
|
+
| `bitbucketdc pr can-merge <project> <repo> <prId>` | Check merge eligibility |
|
|
43
|
+
| `bitbucketdc pr merge <project> <repo> <prId>` | Merge a PR (`--strategy`: merge-commit, squash, ff-only) |
|
|
44
|
+
| `bitbucketdc pr decline <project> <repo> <prId>` | Decline/close a PR |
|
|
45
|
+
| `bitbucketdc pr delete <project> <repo> <prId>` | Delete a PR |
|
|
46
|
+
|
|
47
|
+
### commit
|
|
48
|
+
|
|
49
|
+
| Command | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| `bitbucketdc commit changes <project> <repo> <commitId>` | List changed files in a commit |
|
|
52
|
+
| `bitbucketdc commit diff <project> <repo> <commitId>` | Get diff for a commit (`--path` to filter) |
|
|
53
|
+
|
|
54
|
+
### compare
|
|
55
|
+
|
|
56
|
+
| Command | Description |
|
|
57
|
+
|---------|-------------|
|
|
58
|
+
| `bitbucketdc compare changes <project> <repo>` | List changed files between refs (`--from`, `--to`) |
|
|
59
|
+
| `bitbucketdc compare diff <project> <repo>` | Get diff between refs |
|
|
60
|
+
|
|
61
|
+
### file
|
|
62
|
+
|
|
63
|
+
| Command | Description |
|
|
64
|
+
|---------|-------------|
|
|
65
|
+
| `bitbucketdc file list <project> <repo>` | List files and directories (`--path`, `--at` ref) |
|
|
66
|
+
| `bitbucketdc file show <project> <repo> <path>` | Show file content (`--at` ref) |
|
|
67
|
+
|
|
68
|
+
### project
|
|
69
|
+
|
|
70
|
+
| Command | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| `bitbucketdc project list` | List Bitbucket projects |
|
|
73
|
+
|
|
74
|
+
### repo
|
|
75
|
+
|
|
76
|
+
| Command | Description |
|
|
77
|
+
|---------|-------------|
|
|
78
|
+
| `bitbucketdc repo list` | List repositories (`--project`, `--name` filter) |
|
|
79
|
+
| `bitbucketdc repo clone <project> <repo>` | Clone a repository |
|
|
80
|
+
| `bitbucketdc repo attachment download <project> <repo> <path>` | Download a repo attachment |
|
|
81
|
+
|
|
82
|
+
## Pagination
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
## Examples
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Check your PR inbox
|
|
90
|
+
bitbucketdc pr inbox
|
|
91
|
+
|
|
92
|
+
# Get a PR with full details
|
|
93
|
+
bitbucketdc pr get AI my-repo 42
|
|
94
|
+
|
|
95
|
+
# Review the diff
|
|
96
|
+
bitbucketdc pr diff AI my-repo 42 --context-lines 5
|
|
97
|
+
|
|
98
|
+
# Diff a single file
|
|
99
|
+
bitbucketdc pr file-diff AI my-repo 42 src/index.ts
|
|
100
|
+
|
|
101
|
+
# Approve a PR
|
|
102
|
+
bitbucketdc pr review AI my-repo 42 APPROVED
|
|
103
|
+
|
|
104
|
+
# Leave an inline comment on a specific line
|
|
105
|
+
bitbucketdc pr line-comment AI my-repo 42 --path src/index.ts --line 15 --line-type ADDED --text "Nitpick: rename this variable"
|
|
106
|
+
|
|
107
|
+
# Create a PR (auto-adds default reviewers)
|
|
108
|
+
bitbucketdc pr create AI my-repo --from feature/x --to main --title "Add feature X"
|
|
109
|
+
|
|
110
|
+
# Merge with squash
|
|
111
|
+
bitbucketdc pr merge AI my-repo 42 --strategy squash
|
|
112
|
+
|
|
113
|
+
# Browse files at a specific branch
|
|
114
|
+
bitbucketdc file list AI my-repo --path src/ --at develop
|
|
115
|
+
|
|
116
|
+
# Show file content
|
|
117
|
+
bitbucketdc file show AI my-repo src/config.ts --at main
|
|
118
|
+
|
|
119
|
+
# Search repos by name within a project
|
|
120
|
+
bitbucketdc repo list --project AI --name "tool"
|
|
121
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitbucketdc-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"commander": "^13.1.0",
|
|
15
|
-
"bitbucket-data-center-client": "1.4.
|
|
15
|
+
"bitbucket-data-center-client": "1.4.17"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/node": "24.10.4",
|