vibecodingmachine-cli 1.0.21 ā 1.0.22
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/bin/vibecodingmachine.js +31 -1
- package/package.json +1 -1
package/bin/vibecodingmachine.js
CHANGED
|
@@ -25,6 +25,8 @@ if (fs.existsSync(envAuthPath)) {
|
|
|
25
25
|
|
|
26
26
|
const { program } = require('commander');
|
|
27
27
|
const chalk = require('chalk');
|
|
28
|
+
const inquirer = require('inquirer');
|
|
29
|
+
const { execSync } = require('child_process');
|
|
28
30
|
// const path = require('path'); // Moved to top for .env.auth loading
|
|
29
31
|
const packageJson = require('../package.json');
|
|
30
32
|
|
|
@@ -233,7 +235,35 @@ async function checkForUpdates() {
|
|
|
233
235
|
// Display update notification
|
|
234
236
|
console.log(chalk.cyan(`\nš¦ Update available: v${updateInfo.currentVersion} ā v${updateInfo.latestVersion}`));
|
|
235
237
|
console.log(chalk.gray(` Published: ${updateInfo.publishedDate}`));
|
|
236
|
-
|
|
238
|
+
|
|
239
|
+
// Prompt user to update
|
|
240
|
+
const answer = await inquirer.prompt([
|
|
241
|
+
{
|
|
242
|
+
type: 'confirm',
|
|
243
|
+
name: 'shouldUpdate',
|
|
244
|
+
message: 'Would you like to update now?',
|
|
245
|
+
default: true
|
|
246
|
+
}
|
|
247
|
+
]);
|
|
248
|
+
|
|
249
|
+
if (answer.shouldUpdate) {
|
|
250
|
+
console.log(chalk.cyan('\nš Updating VibeCodingMachine CLI...\n'));
|
|
251
|
+
try {
|
|
252
|
+
// Run npm install with inherited stdio to show progress
|
|
253
|
+
execSync('npm install -g vibecodingmachine-cli@latest', {
|
|
254
|
+
stdio: 'inherit',
|
|
255
|
+
encoding: 'utf8'
|
|
256
|
+
});
|
|
257
|
+
console.log(chalk.green('\nā
Successfully updated to v' + updateInfo.latestVersion + '!'));
|
|
258
|
+
console.log(chalk.gray(' Please restart your command to use the new version.\n'));
|
|
259
|
+
process.exit(0);
|
|
260
|
+
} catch (error) {
|
|
261
|
+
console.log(chalk.red('\nā Update failed:'), error.message);
|
|
262
|
+
console.log(chalk.yellow(' You can manually update with: ') + chalk.bold.white('npm install -g vibecodingmachine-cli@latest\n'));
|
|
263
|
+
}
|
|
264
|
+
} else {
|
|
265
|
+
console.log(chalk.gray(' You can update later with: ') + chalk.bold.white('npm install -g vibecodingmachine-cli@latest\n'));
|
|
266
|
+
}
|
|
237
267
|
}
|
|
238
268
|
} catch (error) {
|
|
239
269
|
// Silently fail - don't block CLI usage
|