@proggarapsody/bitbottle 1.20.0 → 1.22.0
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 +91 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,8 +75,8 @@ Credentials are stored in `~/.config/bitbottle/hosts.yml`. Inside a git repo wit
|
|
|
75
75
|
| Group | Commands |
|
|
76
76
|
|---|---|
|
|
77
77
|
| `auth` | `login` `logout` `status` `token` `refresh` |
|
|
78
|
-
| `pr` | `list` `view` `create` `merge` `approve` `unapprove` `diff` `checkout` `edit` `decline` `ready` `request-review` `comment` |
|
|
79
|
-
| `repo` | `list` `view` `create` `delete` `clone` `set-default` `rename` `fork` _(Cloud)_ |
|
|
78
|
+
| `pr` | `list` `view` `create` `merge` `approve` `unapprove` `diff` `checkout` `edit` `decline` `reopen` `ready` `request-review` `comment` |
|
|
79
|
+
| `repo` | `list` `view` `create` `delete` `clone` `set-default` `rename` `fork` _(Cloud)_ `file get` `tree` |
|
|
80
80
|
| `branch` | `list` `create` `delete` `checkout` |
|
|
81
81
|
| `tag` | `list` `create` `delete` |
|
|
82
82
|
| `webhook` | `list` `view` `create` `delete` |
|
|
@@ -85,11 +85,13 @@ Credentials are stored in `~/.config/bitbottle/hosts.yml`. Inside a git repo wit
|
|
|
85
85
|
| `workspace` | `list` _(Cloud only)_ |
|
|
86
86
|
| `project` | `list WORKSPACE` _(Cloud only)_ |
|
|
87
87
|
| `issue` | `list` `view` `create` `close` _(Cloud only)_ |
|
|
88
|
+
| `search` | `code QUERY` _(Cloud only)_ |
|
|
88
89
|
| `api` | Raw REST passthrough with pagination, `--jq`, variable expansion |
|
|
89
90
|
| `alias` | Custom command shortcuts |
|
|
90
91
|
| `config` | Editor, pager, git protocol per-host |
|
|
91
92
|
| `completion` | `bash` `zsh` `fish` `powershell` |
|
|
92
93
|
| `mcp` | MCP stdio server for AI assistants |
|
|
94
|
+
| `context` | One-call orientation: host, repo, branch, default branch, ahead/behind, user, backend |
|
|
93
95
|
|
|
94
96
|
All listing commands support `--json fields`, `--jq expr`, `--limit N`, `--hostname HOST`. TTY output is aligned and coloured; piped output is plain tab-separated for scripting.
|
|
95
97
|
|
|
@@ -116,6 +118,15 @@ bitbottle pr merge 42 --squash --delete-branch
|
|
|
116
118
|
|
|
117
119
|
# Add reviewers
|
|
118
120
|
bitbottle pr request-review 42 --reviewer alice --reviewer bob
|
|
121
|
+
|
|
122
|
+
# Decline / reopen (reopen is Bitbucket Server / DC only)
|
|
123
|
+
bitbottle pr decline 42
|
|
124
|
+
bitbottle pr reopen 42
|
|
125
|
+
|
|
126
|
+
# Read review comments — general + inline (file:line) anchors and replies
|
|
127
|
+
bitbottle pr comment list 42 # all comments; LOCATION column shows path:line for inline
|
|
128
|
+
bitbottle pr comment list 42 --inline # only inline review comments
|
|
129
|
+
bitbottle pr comment list 42 --json id,inline,parentId,resolved,updatedAt
|
|
119
130
|
```
|
|
120
131
|
|
|
121
132
|
### Repos & Branches
|
|
@@ -217,6 +228,33 @@ bitbottle repo fork myworkspace/my-service --into otherws --name my-fork
|
|
|
217
228
|
Data Center, which has no fork primitive in its REST API. Both `rename` and
|
|
218
229
|
`fork` accept `--json fields` and `--jq expr` for structured output.
|
|
219
230
|
|
|
231
|
+
### Reading source at a ref
|
|
232
|
+
|
|
233
|
+
Read file content and directory listings at any ref (branch, tag, commit
|
|
234
|
+
hash) without cloning. Both backends; the bytes round-trip cleanly so
|
|
235
|
+
binary files survive `--out`.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Read a file at a ref — straight to stdout
|
|
239
|
+
bitbottle repo file get MYPROJ/my-service README.md --ref main
|
|
240
|
+
|
|
241
|
+
# Pin a tag and write to disk (binary-safe)
|
|
242
|
+
bitbottle repo file get MYPROJ/my-service logo.png --ref v1.2.0 --out logo.png
|
|
243
|
+
|
|
244
|
+
# List a directory at a ref. PATH defaults to the repo root.
|
|
245
|
+
bitbottle repo tree MYPROJ/my-service --ref main
|
|
246
|
+
bitbottle repo tree MYPROJ/my-service cmd --ref main
|
|
247
|
+
|
|
248
|
+
# Structured output for scripts and agents
|
|
249
|
+
bitbottle repo tree MYPROJ/my-service --ref main --json path,type,size
|
|
250
|
+
bitbottle repo tree MYPROJ/my-service --ref main --jq '.[]|select(.type=="dir").path'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`type` is normalised to `file` or `dir` across both backends. Submodules
|
|
254
|
+
surface as `dir` (with the submodule pointer in `hash`) so renderers can
|
|
255
|
+
recurse uniformly without a special case. The MCP equivalents are
|
|
256
|
+
`get_file_content` and `list_tree`.
|
|
257
|
+
|
|
220
258
|
### Workspaces & Projects (Cloud only)
|
|
221
259
|
|
|
222
260
|
```bash
|
|
@@ -232,6 +270,28 @@ bitbottle project list myworkspace --limit 100
|
|
|
232
270
|
Both commands surface a typed unsupported-capability error against
|
|
233
271
|
Bitbucket Server / Data Center hosts (workspaces are a Cloud concept).
|
|
234
272
|
|
|
273
|
+
### Search _(Cloud only)_
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Search across the workspace inferred from the current checkout's pinned default
|
|
277
|
+
bitbottle search code 'TODO'
|
|
278
|
+
|
|
279
|
+
# Explicit workspace, custom limit
|
|
280
|
+
bitbottle search code 'foo bar' --workspace myws --limit 50
|
|
281
|
+
|
|
282
|
+
# Path-restricted query, JSON for scripting
|
|
283
|
+
bitbottle search code 'path:README' --workspace myws --json path,repository
|
|
284
|
+
bitbottle search code 'TODO' --workspace myws --json path --jq '.[].path'
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Bitbucket Cloud's query language (`path:`, `lang:`, `repo:`, exact-phrase
|
|
288
|
+
quoting, etc.) is passed through verbatim — bitbottle does not translate
|
|
289
|
+
operators. The matched-segment shape (`pathMatches`, `contentMatches`)
|
|
290
|
+
is preserved on the JSON side so renderers can highlight the matched
|
|
291
|
+
runs. Bitbucket Server / Data Center has no first-class code-search
|
|
292
|
+
REST endpoint; invocations against a Server host return the typed
|
|
293
|
+
`host.unsupported` error.
|
|
294
|
+
|
|
235
295
|
### Raw API
|
|
236
296
|
|
|
237
297
|
```bash
|
|
@@ -242,6 +302,35 @@ bitbottle api -X POST -F 'title=hotfix' -F 'source.branch.name=hotfix/x' \
|
|
|
242
302
|
'2.0/repositories/{workspace}/{repo_slug}/pullrequests'
|
|
243
303
|
```
|
|
244
304
|
|
|
305
|
+
### Context (one-call orientation)
|
|
306
|
+
|
|
307
|
+
`bitbottle context` collapses three previously independent calls
|
|
308
|
+
(`auth status`, `repo view`, `git status`) into a single structured
|
|
309
|
+
snapshot of where you are. Especially useful for AI agents that drive
|
|
310
|
+
bitbottle through MCP — `get_context` is the standard first call.
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
bitbottle context
|
|
314
|
+
# Host: git.example.com
|
|
315
|
+
# Backend: server
|
|
316
|
+
# Project: PROJ
|
|
317
|
+
# Slug: repo
|
|
318
|
+
# Branch: feat/ctx
|
|
319
|
+
# Default branch: main
|
|
320
|
+
# Ahead/Behind: 2 / 0
|
|
321
|
+
# User: alice (Alice Smith)
|
|
322
|
+
|
|
323
|
+
bitbottle context --json host,project,slug,branch,default_branch,ahead,behind,user,backend
|
|
324
|
+
bitbottle context --json user --jq '.user.slug'
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Outside a git repo `project`, `slug`, `branch`, and `default_branch`
|
|
328
|
+
are empty; `ahead` and `behind` are omitted from the JSON output
|
|
329
|
+
entirely (and rendered as `(unknown — run 'git fetch')` in the human
|
|
330
|
+
table). They are also omitted whenever `git rev-list` cannot compute
|
|
331
|
+
the counts — `0 / 0` would falsely read as "in sync". `host`, `user`,
|
|
332
|
+
and `backend` still resolve via the configured (or `--hostname`) host.
|
|
333
|
+
|
|
245
334
|
### Outside a git repo
|
|
246
335
|
|
|
247
336
|
```bash
|