@proggarapsody/bitbottle 1.19.0 → 1.21.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.
Files changed (2) hide show
  1. package/README.md +58 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -75,7 +75,7 @@ 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` |
78
+ | `pr` | `list` `view` `create` `merge` `approve` `unapprove` `diff` `checkout` `edit` `decline` `reopen` `ready` `request-review` `comment` |
79
79
  | `repo` | `list` `view` `create` `delete` `clone` `set-default` `rename` `fork` _(Cloud)_ |
80
80
  | `branch` | `list` `create` `delete` `checkout` |
81
81
  | `tag` | `list` `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,10 @@ 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
119
125
  ```
120
126
 
121
127
  ### Repos & Branches
@@ -232,6 +238,28 @@ bitbottle project list myworkspace --limit 100
232
238
  Both commands surface a typed unsupported-capability error against
233
239
  Bitbucket Server / Data Center hosts (workspaces are a Cloud concept).
234
240
 
241
+ ### Search _(Cloud only)_
242
+
243
+ ```bash
244
+ # Search across the workspace inferred from the current checkout's pinned default
245
+ bitbottle search code 'TODO'
246
+
247
+ # Explicit workspace, custom limit
248
+ bitbottle search code 'foo bar' --workspace myws --limit 50
249
+
250
+ # Path-restricted query, JSON for scripting
251
+ bitbottle search code 'path:README' --workspace myws --json path,repository
252
+ bitbottle search code 'TODO' --workspace myws --json path --jq '.[].path'
253
+ ```
254
+
255
+ Bitbucket Cloud's query language (`path:`, `lang:`, `repo:`, exact-phrase
256
+ quoting, etc.) is passed through verbatim — bitbottle does not translate
257
+ operators. The matched-segment shape (`pathMatches`, `contentMatches`)
258
+ is preserved on the JSON side so renderers can highlight the matched
259
+ runs. Bitbucket Server / Data Center has no first-class code-search
260
+ REST endpoint; invocations against a Server host return the typed
261
+ `host.unsupported` error.
262
+
235
263
  ### Raw API
236
264
 
237
265
  ```bash
@@ -242,6 +270,35 @@ bitbottle api -X POST -F 'title=hotfix' -F 'source.branch.name=hotfix/x' \
242
270
  '2.0/repositories/{workspace}/{repo_slug}/pullrequests'
243
271
  ```
244
272
 
273
+ ### Context (one-call orientation)
274
+
275
+ `bitbottle context` collapses three previously independent calls
276
+ (`auth status`, `repo view`, `git status`) into a single structured
277
+ snapshot of where you are. Especially useful for AI agents that drive
278
+ bitbottle through MCP — `get_context` is the standard first call.
279
+
280
+ ```bash
281
+ bitbottle context
282
+ # Host: git.example.com
283
+ # Backend: server
284
+ # Project: PROJ
285
+ # Slug: repo
286
+ # Branch: feat/ctx
287
+ # Default branch: main
288
+ # Ahead/Behind: 2 / 0
289
+ # User: alice (Alice Smith)
290
+
291
+ bitbottle context --json host,project,slug,branch,default_branch,ahead,behind,user,backend
292
+ bitbottle context --json user --jq '.user.slug'
293
+ ```
294
+
295
+ Outside a git repo `project`, `slug`, `branch`, and `default_branch`
296
+ are empty; `ahead` and `behind` are omitted from the JSON output
297
+ entirely (and rendered as `(unknown — run 'git fetch')` in the human
298
+ table). They are also omitted whenever `git rev-list` cannot compute
299
+ the counts — `0 / 0` would falsely read as "in sync". `host`, `user`,
300
+ and `backend` still resolve via the configured (or `--hostname`) host.
301
+
245
302
  ### Outside a git repo
246
303
 
247
304
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proggarapsody/bitbottle",
3
- "version": "1.19.0",
3
+ "version": "1.21.0",
4
4
  "description": "Bitbucket CLI for Server/Data Center and Cloud — npm wrapper for bitbottle",
5
5
  "keywords": [
6
6
  "mcp",