@proggarapsody/bitbottle 1.9.1 → 1.11.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 +220 -0
  2. package/package.json +7 -2
package/README.md ADDED
@@ -0,0 +1,220 @@
1
+ # bitbottle
2
+
3
+ > Bitbucket CLI for Cloud and Server / Data Center — built with the same philosophy as [GitHub CLI](https://github.com/cli/cli).
4
+
5
+ [![CI](https://github.com/proggarapsody/bitbottle/actions/workflows/ci.yml/badge.svg)](https://github.com/proggarapsody/bitbottle/actions/workflows/ci.yml)
6
+ [![npm](https://img.shields.io/npm/v/@proggarapsody/bitbottle)](https://www.npmjs.com/package/@proggarapsody/bitbottle)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+
9
+ Work with Bitbucket from your terminal — pull requests, repos, branches, tags, commits, pipelines, and raw API access. One tool, both backends, same commands.
10
+
11
+ ```
12
+ $ bitbottle pr list
13
+ #47 feat: seamless audit main ← feat/audit OPEN alice
14
+ #46 fix: 409 on concurrent merge main ← fix/merge-race MERGED bob
15
+
16
+ $ bitbottle pr create --title "fix: handle empty diff" --base main
17
+ ✓ Created PR #48 — https://bitbucket.example.com/projects/PROJ/repos/api/pull-requests/48
18
+ ```
19
+
20
+ ---
21
+
22
+ ## Installation
23
+
24
+ **npm** (recommended — works everywhere Node is installed):
25
+ ```bash
26
+ npm install -g @proggarapsody/bitbottle
27
+ ```
28
+
29
+ **Go install:**
30
+ ```bash
31
+ go install github.com/proggarapsody/bitbottle/cmd/bitbottle@latest
32
+ ```
33
+
34
+ **Homebrew / binary / deb / rpm / Docker** — see the [latest release](https://github.com/proggarapsody/bitbottle/releases/latest).
35
+
36
+ ---
37
+
38
+ ## Authentication
39
+
40
+ ```bash
41
+ # Bitbucket Cloud
42
+ echo "YOUR_APP_PASSWORD" | bitbottle auth login --hostname bitbucket.org --with-token
43
+
44
+ # Bitbucket Server / Data Center (PAT, self-signed cert)
45
+ echo "BBDC-YOUR-PAT" | bitbottle auth login \
46
+ --hostname git.example.com \
47
+ --with-token \
48
+ --git-protocol https \
49
+ --skip-tls-verify
50
+
51
+ # Verify
52
+ bitbottle auth status
53
+ ```
54
+
55
+ Credentials are stored in `~/.config/bitbottle/hosts.yml`. Inside a git repo with a Bitbucket remote the host and project/repo are detected automatically. Outside a repo, use `-R HOST/PROJECT/REPO`.
56
+
57
+ ---
58
+
59
+ ## Commands
60
+
61
+ | Group | Commands |
62
+ |---|---|
63
+ | `auth` | `login` `logout` `status` `token` `refresh` |
64
+ | `pr` | `list` `view` `create` `merge` `approve` `unapprove` `diff` `checkout` `edit` `decline` `ready` `request-review` `comment` |
65
+ | `repo` | `list` `view` `create` `delete` `clone` `set-default` |
66
+ | `branch` | `list` `create` `delete` `checkout` |
67
+ | `tag` | `list` `create` `delete` |
68
+ | `commit` | `log` `view` |
69
+ | `pipeline` | `list` `view` `run` _(Cloud only)_ |
70
+ | `api` | Raw REST passthrough with pagination, `--jq`, variable expansion |
71
+ | `alias` | Custom command shortcuts |
72
+ | `config` | Editor, pager, git protocol per-host |
73
+ | `completion` | `bash` `zsh` `fish` `powershell` |
74
+ | `mcp` | MCP stdio server for AI assistants |
75
+
76
+ 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.
77
+
78
+ ---
79
+
80
+ ## Key Workflows
81
+
82
+ ### Pull Requests
83
+
84
+ ```bash
85
+ # Open PRs in current repo
86
+ bitbottle pr list
87
+
88
+ # Create a PR
89
+ bitbottle pr create --title "feat: add retry logic" --base main
90
+
91
+ # Review
92
+ bitbottle pr diff 42 | delta
93
+ bitbottle pr checkout 42
94
+
95
+ # Approve and merge
96
+ bitbottle pr approve 42
97
+ bitbottle pr merge 42 --squash --delete-branch
98
+
99
+ # Add reviewers
100
+ bitbottle pr request-review 42 --reviewer alice --reviewer bob
101
+ ```
102
+
103
+ ### Repos & Branches
104
+
105
+ ```bash
106
+ bitbottle repo list --limit 20
107
+ bitbottle repo create my-service --project MYPROJ
108
+ bitbottle repo clone MYPROJ/my-service
109
+
110
+ bitbottle branch list
111
+ bitbottle branch create MYPROJ/my-service feature/x --start-at main
112
+ bitbottle branch delete MYPROJ/my-service feature/x
113
+ ```
114
+
115
+ ### Pipelines _(Cloud only)_
116
+
117
+ ```bash
118
+ bitbottle pipeline list MYWORKSPACE/my-service
119
+ bitbottle pipeline run MYWORKSPACE/my-service --branch main
120
+ bitbottle pipeline view MYWORKSPACE/my-service {uuid} --web
121
+ ```
122
+
123
+ ### Raw API
124
+
125
+ ```bash
126
+ # Any endpoint not yet wrapped
127
+ bitbottle api 2.0/user
128
+ bitbottle api --paginate --jq '.[].full_name' '2.0/repositories/{workspace}'
129
+ bitbottle api -X POST -F 'title=hotfix' -F 'source.branch.name=hotfix/x' \
130
+ '2.0/repositories/{workspace}/{repo_slug}/pullrequests'
131
+ ```
132
+
133
+ ### Outside a git repo
134
+
135
+ ```bash
136
+ bitbottle pr list -R git.example.com/PROJ/api
137
+ bitbottle pr merge 42 -R git.example.com/PROJ/api
138
+ ```
139
+
140
+ ---
141
+
142
+ ## MCP Server — AI Assistant Integration
143
+
144
+ `bitbottle mcp serve` exposes all CLI operations as [Model Context Protocol](https://modelcontextprotocol.io) tools. Claude Desktop, Claude Code, and any MCP client can call Bitbucket as native tools — no raw API, no output parsing.
145
+
146
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "bitbottle": {
151
+ "command": "bitbottle",
152
+ "args": ["mcp", "serve"]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ **Claude Code** (`.mcp.json` in project root):
159
+ ```json
160
+ {
161
+ "mcpServers": {
162
+ "bitbottle": {
163
+ "command": "bitbottle",
164
+ "args": ["mcp", "serve"]
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ **Docker** (no local install required):
171
+ ```bash
172
+ docker run --rm -i \
173
+ -v ~/.config/bitbottle:/root/.config/bitbottle \
174
+ proggarapsody/bitbottle mcp serve
175
+ ```
176
+
177
+ The MCP server uses the same `~/.config/bitbottle/hosts.yml` credentials as the CLI — no separate auth setup needed.
178
+
179
+ ---
180
+
181
+ ## Cloud vs Server / Data Center
182
+
183
+ bitbottle automatically routes to the correct backend based on hostname: `bitbucket.org` → Cloud; anything else → Server/DC. Override with `backend_type: cloud|server` in `hosts.yml`.
184
+
185
+ The same commands and flags work on both backends. Differences in API shape, pagination style, and endpoint paths are handled internally — no `--cloud` / `--server` flags needed.
186
+
187
+ ---
188
+
189
+ ## Shell Completion
190
+
191
+ ```bash
192
+ bitbottle completion --shell bash >> ~/.bash_profile
193
+ bitbottle completion --shell zsh >> ~/.zshrc
194
+ bitbottle completion --shell fish > ~/.config/fish/completions/bitbottle.fish
195
+ bitbottle completion --shell powershell >> $PROFILE
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Environment Variables
201
+
202
+ | Variable | Effect |
203
+ |---|---|
204
+ | `BB_TOKEN` | Override auth token |
205
+ | `BB_HOST` | Default hostname |
206
+ | `BB_REPO` | Override `[HOST/]PROJECT/REPO` |
207
+ | `BB_FORCE_TTY` | Force aligned/coloured output in pipes |
208
+ | `NO_COLOR` | Disable colour (standard) |
209
+
210
+ Full list in [`internal/envvars/envvars.go`](internal/envvars/envvars.go).
211
+
212
+ ---
213
+
214
+ ## Contributing
215
+
216
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Run `go test ./...` before sending a PR.
217
+
218
+ ## License
219
+
220
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proggarapsody/bitbottle",
3
- "version": "1.9.1",
3
+ "version": "1.11.0",
4
4
  "description": "Bitbucket CLI for Server/Data Center and Cloud — npm wrapper for bitbottle",
5
5
  "keywords": [
6
6
  "mcp",
@@ -19,5 +19,10 @@
19
19
  },
20
20
  "engines": {
21
21
  "node": ">=18"
22
- }
22
+ },
23
+ "files": [
24
+ "bin/run.js",
25
+ "install.js",
26
+ "README.md"
27
+ ]
23
28
  }