@pilatos/bitbucket-cli 1.5.0 → 1.7.1
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 +35 -166
- package/dist/index.js +1203 -766
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="
|
|
2
|
+
<img src="docs/public/favicon.svg" alt="Bitbucket CLI logo" width="80" height="80">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Bitbucket CLI</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>
|
|
8
|
+
<strong>Fast, scriptable CLI for Bitbucket Cloud</strong>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<em>Inspired by GitHub's <code>gh</code> CLI
|
|
12
|
+
<em>Inspired by GitHub's <code>gh</code> CLI - the same great experience for Bitbucket</em>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
<a href="https://github.com/0pilatos0/bitbucket-cli/issues"><img src="https://img.shields.io/github/issues/0pilatos0/bitbucket-cli.svg?style=flat-square" alt="GitHub issues"></a>
|
|
20
20
|
</p>
|
|
21
21
|
|
|
22
|
+
<p align="center">
|
|
23
|
+
<sub>
|
|
24
|
+
<a href="https://bitbucket-cli.paulvanderlei.com">Docs</a> ·
|
|
25
|
+
<a href="https://bitbucket-cli.paulvanderlei.com/getting-started/quickstart/">Quick Start</a> ·
|
|
26
|
+
<a href="https://bitbucket-cli.paulvanderlei.com/commands/auth/">Command Reference</a> ·
|
|
27
|
+
<a href="https://github.com/0pilatos0/bitbucket-cli/issues">Issues</a>
|
|
28
|
+
</sub>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
22
31
|
<p align="center">
|
|
23
32
|
<sub>
|
|
24
33
|
<strong>Note:</strong> This is an <strong>unofficial</strong>, community-maintained CLI tool.<br>
|
|
@@ -28,204 +37,74 @@
|
|
|
28
37
|
|
|
29
38
|
---
|
|
30
39
|
|
|
31
|
-
##
|
|
40
|
+
## At a glance
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- **Automate your workflow** — Script common operations with JSON output
|
|
37
|
-
- **Work faster** — Clone repos, create PRs, and manage code reviews in seconds
|
|
38
|
-
- **Smart context detection** — Automatically detects workspace/repo from git directory
|
|
42
|
+
- Stay in the terminal for repo and PR workflows
|
|
43
|
+
- JSON output for scripting and automation
|
|
44
|
+
- Auto-detects workspace and repo from your git directory
|
|
39
45
|
|
|
40
46
|
---
|
|
41
47
|
|
|
42
|
-
##
|
|
48
|
+
## Install
|
|
43
49
|
|
|
44
50
|
```bash
|
|
45
51
|
npm install -g @pilatos/bitbucket-cli
|
|
46
52
|
```
|
|
47
53
|
|
|
48
|
-
Verify installation:
|
|
49
|
-
|
|
50
54
|
```bash
|
|
51
55
|
bb --version
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
> **
|
|
58
|
+
> **Requires:** [Bun](https://bun.sh) runtime 1.0 or higher (Node.js is not supported)
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
58
62
|
## Quick Start
|
|
59
63
|
|
|
60
64
|
```bash
|
|
61
|
-
# 1. Authenticate with Bitbucket
|
|
62
65
|
bb auth login
|
|
63
|
-
|
|
64
|
-
# 2. Clone a repository
|
|
65
66
|
bb repo clone myworkspace/myrepo
|
|
66
|
-
cd myrepo
|
|
67
|
-
|
|
68
|
-
# 3. Create a feature branch and make changes
|
|
69
|
-
git checkout -b feature/awesome-feature
|
|
70
|
-
|
|
71
|
-
# 4. Create a pull request
|
|
72
|
-
bb pr create --title "Add awesome feature"
|
|
73
|
-
|
|
74
|
-
# 5. List open pull requests
|
|
75
67
|
bb pr list
|
|
76
68
|
```
|
|
77
69
|
|
|
78
70
|
---
|
|
79
71
|
|
|
80
|
-
##
|
|
72
|
+
## Common Commands
|
|
81
73
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
| **Shell Completion** | `install`, `uninstall` |
|
|
74
|
+
```bash
|
|
75
|
+
bb repo list
|
|
76
|
+
bb pr create --title "Add feature"
|
|
77
|
+
bb pr approve 42
|
|
78
|
+
bb config set defaultWorkspace myworkspace
|
|
79
|
+
```
|
|
89
80
|
|
|
90
|
-
**Global
|
|
91
|
-
- `--json` — Output results as JSON for scripting
|
|
92
|
-
- `-w, --workspace` — Specify workspace
|
|
93
|
-
- `-r, --repo` — Specify repository
|
|
81
|
+
**Global options:** `--json`, `--no-color`, `-w, --workspace`, `-r, --repo`
|
|
94
82
|
|
|
95
83
|
---
|
|
96
84
|
|
|
97
|
-
##
|
|
85
|
+
## Docs
|
|
98
86
|
|
|
99
|
-
Full documentation
|
|
87
|
+
Full documentation: **[bitbucket-cli.paulvanderlei.com](https://bitbucket-cli.paulvanderlei.com)**
|
|
100
88
|
|
|
101
89
|
- [Quick Start Guide](https://bitbucket-cli.paulvanderlei.com/getting-started/quickstart/)
|
|
102
90
|
- [Command Reference](https://bitbucket-cli.paulvanderlei.com/commands/auth/)
|
|
103
|
-
- [
|
|
104
|
-
- [
|
|
105
|
-
- [Troubleshooting](https://bitbucket-cli.paulvanderlei.com/help/troubleshooting/)
|
|
106
|
-
- [FAQ](https://bitbucket-cli.paulvanderlei.com/help/faq/)
|
|
91
|
+
- [Guides](https://bitbucket-cli.paulvanderlei.com/guides/scripting/) (Scripting, CI/CD)
|
|
92
|
+
- [Help](https://bitbucket-cli.paulvanderlei.com/help/troubleshooting/) (Troubleshooting, FAQ)
|
|
107
93
|
|
|
108
94
|
---
|
|
109
95
|
|
|
110
96
|
## Authentication
|
|
111
97
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
> **Note**: As of September 9, 2025, Bitbucket app passwords are deprecated. Use API tokens instead.
|
|
115
|
-
|
|
116
|
-
### Create an API Token
|
|
117
|
-
|
|
118
|
-
1. Go to [Bitbucket API Tokens](https://bitbucket.org/account/settings/api-tokens/)
|
|
119
|
-
2. Click **"Create API token"**
|
|
120
|
-
3. Select required scopes (Account, Repositories, Pull requests)
|
|
121
|
-
4. Copy the token
|
|
122
|
-
|
|
123
|
-
### Authenticate
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
bb auth login
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Examples
|
|
132
|
-
|
|
133
|
-
### Daily Workflow
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# Check open PRs
|
|
137
|
-
bb pr list
|
|
138
|
-
|
|
139
|
-
# Review and merge
|
|
140
|
-
bb pr view 42
|
|
141
|
-
bb pr activity 42
|
|
142
|
-
bb pr approve 42
|
|
143
|
-
bb pr merge 42
|
|
144
|
-
|
|
145
|
-
# Manage reviewers
|
|
146
|
-
bb pr reviewers list 42
|
|
147
|
-
bb pr reviewers add 42 teammate
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Draft Pull Requests
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# Create a draft PR for early feedback
|
|
154
|
-
bb pr create --title "WIP: Add new feature" --draft
|
|
155
|
-
|
|
156
|
-
# Mark it ready for review when done
|
|
157
|
-
bb pr ready 123
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Managing PR Reviewers
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# List current reviewers on a PR
|
|
164
|
-
bb pr reviewers list 42
|
|
165
|
-
|
|
166
|
-
# Add reviewers to a PR
|
|
167
|
-
bb pr reviewers add 42 johndoe
|
|
168
|
-
bb pr reviewers add 42 janedoe
|
|
169
|
-
|
|
170
|
-
# Remove a reviewer from a PR
|
|
171
|
-
bb pr reviewers remove 42 johndoe
|
|
172
|
-
|
|
173
|
-
# Get reviewers as JSON for scripting
|
|
174
|
-
bb pr reviewers list 42 --json | jq '.[].display_name'
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Scripting with JSON
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
# Get all open PR titles
|
|
181
|
-
bb pr list --json | jq '.[].title'
|
|
182
|
-
|
|
183
|
-
# Filter repos by name
|
|
184
|
-
bb repo list --json | jq '.[] | select(.name | contains("api"))'
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### CI/CD Usage
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
export BB_USERNAME=myuser
|
|
191
|
-
export BB_API_TOKEN=my-token
|
|
192
|
-
bb auth login
|
|
193
|
-
bb pr list -w workspace -r repo --json
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Development
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
# Clone the repository
|
|
202
|
-
git clone https://github.com/0pilatos0/bitbucket-cli.git
|
|
203
|
-
cd bitbucket-cli
|
|
204
|
-
|
|
205
|
-
# Install dependencies
|
|
206
|
-
bun install
|
|
207
|
-
|
|
208
|
-
# Run in development mode
|
|
209
|
-
bun run dev
|
|
210
|
-
|
|
211
|
-
# Run tests
|
|
212
|
-
bun test
|
|
98
|
+
- Create a token: [Bitbucket API Tokens](https://bitbucket.org/account/settings/api-tokens/)
|
|
99
|
+
- Authenticate: `bb auth login`
|
|
213
100
|
|
|
214
|
-
|
|
215
|
-
bun run build
|
|
216
|
-
```
|
|
101
|
+
> **Note:** Bitbucket app passwords are deprecated. Use API tokens instead.
|
|
217
102
|
|
|
218
103
|
---
|
|
219
104
|
|
|
220
105
|
## Contributing
|
|
221
106
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
1. Fork the repository
|
|
225
|
-
2. Create a feature branch
|
|
226
|
-
3. Make your changes
|
|
227
|
-
4. Run tests (`bun test`)
|
|
228
|
-
5. Submit a Pull Request
|
|
107
|
+
Read the [Contributing Guide](CONTRIBUTING.md) to get started.
|
|
229
108
|
|
|
230
109
|
---
|
|
231
110
|
|
|
@@ -239,14 +118,4 @@ We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md)
|
|
|
239
118
|
|
|
240
119
|
## License
|
|
241
120
|
|
|
242
|
-
MIT License
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
<p align="center">
|
|
247
|
-
<sub>
|
|
248
|
-
Made with care by the community<br>
|
|
249
|
-
<a href="https://github.com/0pilatos0/bitbucket-cli/issues">Report a Bug</a> ·
|
|
250
|
-
<a href="https://github.com/0pilatos0/bitbucket-cli/issues">Request a Feature</a>
|
|
251
|
-
</sub>
|
|
252
|
-
</p>
|
|
121
|
+
MIT License - see [LICENSE](LICENSE) for details.
|