@proggarapsody/bitbottle 1.12.0 → 1.13.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 +9 -0
- package/install.js +63 -0
- 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,67 @@ 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
|
+
const env = { ...process.env, npm_config_yes: "true" };
|
|
119
|
+
const skillsCmd = (cmd) =>
|
|
120
|
+
execSync(cmd, { stdio: "ignore", timeout: 60_000, env });
|
|
121
|
+
try {
|
|
122
|
+
// Remove first so reinstalls actually pick up new SKILL.md content.
|
|
123
|
+
// `skills add` is idempotent and skips when the skill already exists,
|
|
124
|
+
// which means a fresh `npm i -g` after a release would NOT refresh
|
|
125
|
+
// the skill — defeating the whole point of postinstall. Removing
|
|
126
|
+
// first guarantees `add` writes the latest content.
|
|
127
|
+
try {
|
|
128
|
+
skillsCmd("npx -y skills remove bitbottle -g -y");
|
|
129
|
+
} catch (_) {
|
|
130
|
+
// not installed yet; that's fine
|
|
131
|
+
}
|
|
132
|
+
skillsCmd("npx -y skills add proggarapsody/bitbottle --global -y");
|
|
133
|
+
console.log(
|
|
134
|
+
"Agent skill registered. Set BITBOTTLE_SKIP_SKILL_INSTALL=1 to disable on next install."
|
|
135
|
+
);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
// Non-fatal. Common causes: offline, no agent runtimes installed,
|
|
138
|
+
// npx blocked by corporate proxy, timeout. The CLI still works.
|
|
139
|
+
console.log(
|
|
140
|
+
"Skipped agent skill registration: " +
|
|
141
|
+
(e.message || "unknown error") +
|
|
142
|
+
". " +
|
|
143
|
+
"Install manually with: npx -y skills add proggarapsody/bitbottle --global -y"
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|