@thelapyae/geniclaw 1.1.9 ā 1.1.10
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/geniclaw.js +37 -0
- package/package.json +1 -1
package/bin/geniclaw.js
CHANGED
|
@@ -135,6 +135,7 @@ async function showMenu() {
|
|
|
135
135
|
{ name: 'š¤ Change Gemini Model', value: 'model' },
|
|
136
136
|
{ name: 'š Change API Base URL', value: 'apiUrl' },
|
|
137
137
|
new inquirer.Separator(),
|
|
138
|
+
{ name: '⨠Update GeniClaw', value: 'update' },
|
|
138
139
|
{ name: 'Run Setup Wizard', value: 'setup' },
|
|
139
140
|
{ name: 'Exit', value: 'exit' }
|
|
140
141
|
]
|
|
@@ -145,6 +146,11 @@ async function showMenu() {
|
|
|
145
146
|
process.exit(0);
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
if (action === 'update') {
|
|
150
|
+
await performUpdate();
|
|
151
|
+
return; // Exit after update to allow restart
|
|
152
|
+
}
|
|
153
|
+
|
|
148
154
|
if (action === 'setup') {
|
|
149
155
|
await runScript(['setup']);
|
|
150
156
|
await promptContinue();
|
|
@@ -495,6 +501,35 @@ async function showLogsMenu() {
|
|
|
495
501
|
await runScript(['logs', logType]);
|
|
496
502
|
}
|
|
497
503
|
|
|
504
|
+
async function performUpdate() {
|
|
505
|
+
console.log('š Checking for updates and installing latest version...');
|
|
506
|
+
console.log('š¦ Running: npm install -g @thelapyae/geniclaw@latest');
|
|
507
|
+
|
|
508
|
+
try {
|
|
509
|
+
execSync('npm install -g @thelapyae/geniclaw@latest', { stdio: 'inherit' });
|
|
510
|
+
console.log('\nā
Update completed! Please restart geniclaw.');
|
|
511
|
+
process.exit(0);
|
|
512
|
+
} catch (error) {
|
|
513
|
+
console.error('\nā Update failed.');
|
|
514
|
+
console.error('Error details:', error.message);
|
|
515
|
+
console.log('Try running with sudo: sudo geniclaw update');
|
|
516
|
+
|
|
517
|
+
const { trySudo } = await inquirer.prompt([
|
|
518
|
+
{ type: 'confirm', name: 'trySudo', message: 'Try again with sudo?', default: false }
|
|
519
|
+
]);
|
|
520
|
+
|
|
521
|
+
if (trySudo) {
|
|
522
|
+
try {
|
|
523
|
+
execSync('sudo npm install -g @thelapyae/geniclaw@latest', { stdio: 'inherit' });
|
|
524
|
+
console.log('\nā
Update completed! Please restart geniclaw.');
|
|
525
|
+
process.exit(0);
|
|
526
|
+
} catch (e) {
|
|
527
|
+
console.error('\nā Sudo update also failed.');
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
498
533
|
|
|
499
534
|
// CLI Configuration
|
|
500
535
|
const packageJson = require('../package.json');
|
|
@@ -513,6 +548,8 @@ program
|
|
|
513
548
|
await manageSessions();
|
|
514
549
|
} else if (command === 'skills') {
|
|
515
550
|
await manageSkills();
|
|
551
|
+
} else if (command === 'update') {
|
|
552
|
+
await performUpdate();
|
|
516
553
|
} else {
|
|
517
554
|
const args = process.argv.slice(2);
|
|
518
555
|
await runScript(args);
|