@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.
Files changed (2) hide show
  1. package/bin/geniclaw.js +37 -0
  2. 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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thelapyae/geniclaw",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Geniclaw - Gemini + Telegram CLI Assistant",
5
5
  "main": "dist/telegram-client.js",
6
6
  "bin": {