@proggarapsody/bitbottle 1.11.0 → 1.13.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 (3) hide show
  1. package/README.md +9 -0
  2. package/install.js +57 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -26,6 +26,15 @@ $ bitbottle pr create --title "fix: handle empty diff" --base main
26
26
  npm install -g @proggarapsody/bitbottle
27
27
  ```
28
28
 
29
+ This also registers the bundled AI agent skill (`SKILL.md`) with any
30
+ agent runtimes detected on your machine — Claude Code, Cursor, Codex,
31
+ Gemini CLI, and 50+ others — so your agents know how to drive bitbottle
32
+ correctly. Skip with `BITBOTTLE_SKIP_SKILL_INSTALL=1 npm install -g …`.
33
+ Install or refresh manually:
34
+ ```bash
35
+ npx -y skills add proggarapsody/bitbottle --global -y
36
+ ```
37
+
29
38
  **Go install:**
30
39
  ```bash
31
40
  go install github.com/proggarapsody/bitbottle/cmd/bitbottle@latest
package/install.js CHANGED
@@ -80,4 +80,61 @@ downloadFile(url, archiveDest, (err) => {
80
80
  console.error("Extraction failed:", e.message);
81
81
  process.exit(1);
82
82
  }
83
+
84
+ // Best-effort: register the bitbottle SKILL.md with any AI agent
85
+ // runtimes the user has installed (Claude Code, Cursor, Codex, etc.).
86
+ // Uses vercel-labs/skills which knows the canonical install path for
87
+ // each runtime and symlinks/copies SKILL.md from the GitHub repo.
88
+ //
89
+ // This is fire-and-forget: failures (no network, no agent runtimes,
90
+ // sudo install on root's HOME) must NOT break the binary install.
91
+ installSkill();
83
92
  });
93
+
94
+ function installSkill() {
95
+ // Opt-out via env var.
96
+ if (process.env.BITBOTTLE_SKIP_SKILL_INSTALL === "1") {
97
+ return;
98
+ }
99
+ // Skip in CI — most CI environments install bitbottle as a build
100
+ // dependency, not for interactive agent use. Avoids hanging the
101
+ // pipeline on a no-op skill registration.
102
+ if (process.env.CI || process.env.GITHUB_ACTIONS) {
103
+ return;
104
+ }
105
+ // Skip when running under sudo: postinstall runs as root, so the
106
+ // skill would land in /root/.claude/skills (or similar) instead of
107
+ // the user's home, which silently does nothing useful. Detect via
108
+ // SUDO_USER and bail with a hint.
109
+ if (process.env.SUDO_USER && process.getuid && process.getuid() === 0) {
110
+ console.log(
111
+ "Skipped agent skill registration (running under sudo). " +
112
+ "Re-run as your user: npx -y skills add proggarapsody/bitbottle --global -y"
113
+ );
114
+ return;
115
+ }
116
+
117
+ console.log("Registering bitbottle agent skill (Claude Code, Cursor, Codex, …)…");
118
+ try {
119
+ execSync(
120
+ "npx -y skills add proggarapsody/bitbottle --global -y",
121
+ {
122
+ stdio: "ignore",
123
+ timeout: 60_000,
124
+ env: { ...process.env, npm_config_yes: "true" },
125
+ }
126
+ );
127
+ console.log(
128
+ "Agent skill registered. Set BITBOTTLE_SKIP_SKILL_INSTALL=1 to disable on next install."
129
+ );
130
+ } catch (e) {
131
+ // Non-fatal. Common causes: offline, no agent runtimes installed,
132
+ // npx blocked by corporate proxy, timeout. The CLI still works.
133
+ console.log(
134
+ "Skipped agent skill registration: " +
135
+ (e.message || "unknown error") +
136
+ ". " +
137
+ "Install manually with: npx -y skills add proggarapsody/bitbottle --global -y"
138
+ );
139
+ }
140
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proggarapsody/bitbottle",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "Bitbucket CLI for Server/Data Center and Cloud — npm wrapper for bitbottle",
5
5
  "keywords": [
6
6
  "mcp",