vibebuddy 0.1.0 → 0.2.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/package.json +1 -1
- package/src/bin.js +51 -0
package/package.json
CHANGED
package/src/bin.js
CHANGED
|
@@ -223,6 +223,55 @@ async function cmdInit(flags) {
|
|
|
223
223
|
say();
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
async function cmdApp() {
|
|
227
|
+
if (process.platform !== 'win32') {
|
|
228
|
+
say('the desktop bubble is Windows-first — macOS/Linux builds are coming.');
|
|
229
|
+
say(`meanwhile: ${mint('https://vibebuddy.io')} works everywhere.`);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
say();
|
|
233
|
+
say(bold(' vibebuddy app — installing the desktop bubble'));
|
|
234
|
+
const rel = await fetchJson('https://api.github.com/repos/daobahan/vibebuddy-app/releases/latest', {
|
|
235
|
+
headers: { 'User-Agent': 'vibebuddy-cli' },
|
|
236
|
+
}).catch(() => null);
|
|
237
|
+
const asset = rel?.data?.assets?.find((a) => a.name.endsWith('-setup.exe'));
|
|
238
|
+
if (!asset) {
|
|
239
|
+
say(' no Windows build published yet — check https://github.com/daobahan/vibebuddy-app/releases');
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
say(dim(` downloading ${asset.name} (${Math.round(asset.size / 1024 / 1024)} MB)…`));
|
|
243
|
+
const home = vbHome();
|
|
244
|
+
fs.mkdirSync(home, { recursive: true });
|
|
245
|
+
const setupPath = path.join(home, 'app-setup.exe');
|
|
246
|
+
const resp = await fetch(asset.browser_download_url, { headers: { 'User-Agent': 'vibebuddy-cli' } });
|
|
247
|
+
if (!resp.ok) {
|
|
248
|
+
say(' download failed — try again in a minute.');
|
|
249
|
+
process.exit(1);
|
|
250
|
+
}
|
|
251
|
+
fs.writeFileSync(setupPath, Buffer.from(await resp.arrayBuffer()));
|
|
252
|
+
say(dim(' installing silently…'));
|
|
253
|
+
const inst = spawnSync(setupPath, ['/S'], { stdio: 'ignore', timeout: 180_000 });
|
|
254
|
+
if (inst.status !== 0 && inst.status !== null) {
|
|
255
|
+
say(` installer exited with ${inst.status} — run it manually: ${setupPath}`);
|
|
256
|
+
process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
// find the installed exe (per-user NSIS install)
|
|
259
|
+
const candidates = [
|
|
260
|
+
path.join(process.env.LOCALAPPDATA ?? '', 'VibeBuddy', 'VibeBuddy.exe'),
|
|
261
|
+
path.join(process.env.LOCALAPPDATA ?? '', 'VibeBuddy', 'vibebuddy-app.exe'),
|
|
262
|
+
path.join(process.env.ProgramFiles ?? 'C:\\Program Files', 'VibeBuddy', 'VibeBuddy.exe'),
|
|
263
|
+
];
|
|
264
|
+
const exe = candidates.find((p) => fs.existsSync(p));
|
|
265
|
+
if (exe) {
|
|
266
|
+
const { spawn } = await import('node:child_process');
|
|
267
|
+
spawn(exe, [], { detached: true, stdio: 'ignore' }).unref();
|
|
268
|
+
say(` ${mint('✓')} installed and launched — look for the bubble in the corner of your screen`);
|
|
269
|
+
} else {
|
|
270
|
+
say(` ${mint('✓')} installed — launch "VibeBuddy" from the Start menu`);
|
|
271
|
+
}
|
|
272
|
+
say();
|
|
273
|
+
}
|
|
274
|
+
|
|
226
275
|
async function cmdStatus() {
|
|
227
276
|
const home = vbHome();
|
|
228
277
|
let cfg;
|
|
@@ -246,6 +295,7 @@ const flags = parseFlags(process.argv.slice(2));
|
|
|
246
295
|
const cmd = flags._[0];
|
|
247
296
|
|
|
248
297
|
if (cmd === 'init') await cmdInit(flags);
|
|
298
|
+
else if (cmd === 'app') await cmdApp();
|
|
249
299
|
else if (cmd === 'mcp') (await import('./mcp-template.mjs')).run();
|
|
250
300
|
else if (cmd === 'hook') {
|
|
251
301
|
await (await import('./hook-template.mjs')).run(flags._.slice(1));
|
|
@@ -255,6 +305,7 @@ else {
|
|
|
255
305
|
say('vibebuddy — your agent is busy. come hang out.');
|
|
256
306
|
say('');
|
|
257
307
|
say(' npx vibebuddy init connect this machine to vibebuddy');
|
|
308
|
+
say(' npx vibebuddy app install the desktop bubble (windows)');
|
|
258
309
|
say(' vibebuddy status print your digest');
|
|
259
310
|
say(' vibebuddy mcp run the MCP server (stdio)');
|
|
260
311
|
say('');
|