@thelapyae/geniclaw 1.1.8 → 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 -1
  2. package/package.json +2 -2
package/bin/geniclaw.js CHANGED
@@ -113,7 +113,6 @@ async function showMenu() {
113
113
  try {
114
114
  console.log(`Current Model: ${config.geminiModel || 'Default'}`);
115
115
  console.log(`Active Session: šŸ“‚ ${activeSession}`);
116
- console.log(`Active Session: šŸ“‚ ${activeSession}`);
117
116
  console.log(`Active Skill: 🧠 ${activeSkill}`);
118
117
  if (config.geminiApiUrl) console.log(`API URL: šŸ”Œ ${config.geminiApiUrl}`);
119
118
  } catch (e) {}
@@ -136,6 +135,7 @@ async function showMenu() {
136
135
  { name: 'šŸ¤– Change Gemini Model', value: 'model' },
137
136
  { name: 'šŸ”Œ Change API Base URL', value: 'apiUrl' },
138
137
  new inquirer.Separator(),
138
+ { name: '✨ Update GeniClaw', value: 'update' },
139
139
  { name: 'Run Setup Wizard', value: 'setup' },
140
140
  { name: 'Exit', value: 'exit' }
141
141
  ]
@@ -146,6 +146,11 @@ async function showMenu() {
146
146
  process.exit(0);
147
147
  }
148
148
 
149
+ if (action === 'update') {
150
+ await performUpdate();
151
+ return; // Exit after update to allow restart
152
+ }
153
+
149
154
  if (action === 'setup') {
150
155
  await runScript(['setup']);
151
156
  await promptContinue();
@@ -496,6 +501,35 @@ async function showLogsMenu() {
496
501
  await runScript(['logs', logType]);
497
502
  }
498
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
+
499
533
 
500
534
  // CLI Configuration
501
535
  const packageJson = require('../package.json');
@@ -514,6 +548,8 @@ program
514
548
  await manageSessions();
515
549
  } else if (command === 'skills') {
516
550
  await manageSkills();
551
+ } else if (command === 'update') {
552
+ await performUpdate();
517
553
  } else {
518
554
  const args = process.argv.slice(2);
519
555
  await runScript(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thelapyae/geniclaw",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Geniclaw - Gemini + Telegram CLI Assistant",
5
5
  "main": "dist/telegram-client.js",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "commander": "^14.0.3",
26
26
  "dotenv": "^17.2.4",
27
27
  "google-auth-library": "^10.5.0",
28
- "inquirer": "^9.3.8",
28
+ "inquirer": "^8.2.6",
29
29
  "telegraf": "^4.16.3"
30
30
  },
31
31
  "devDependencies": {