minivibe 0.2.2 → 0.2.3

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 (3) hide show
  1. package/agent/agent.js +21 -0
  2. package/package.json +1 -1
  3. package/vibe.js +27 -7
package/agent/agent.js CHANGED
@@ -1340,10 +1340,12 @@ ${colors.cyan}${colors.bold}vibe-agent${colors.reset} - Persistent daemon for re
1340
1340
  ${colors.bold}Usage:${colors.reset}
1341
1341
  vibe-agent Start agent daemon
1342
1342
  vibe-agent --login Sign in with Google (one-time)
1343
+ vibe-agent --logout Sign out and clear credentials
1343
1344
  vibe-agent --status Show agent status
1344
1345
 
1345
1346
  ${colors.bold}Options:${colors.reset}
1346
1347
  --login Sign in via device code flow
1348
+ --logout Sign out and clear saved credentials
1347
1349
  --name <name> Set host display name
1348
1350
  --status Show current status and exit
1349
1351
  --help, -h Show this help
@@ -1365,6 +1367,7 @@ function parseArgs() {
1365
1367
  bridge: null,
1366
1368
  token: null,
1367
1369
  login: false,
1370
+ logout: false,
1368
1371
  name: null,
1369
1372
  status: false,
1370
1373
  help: false
@@ -1382,6 +1385,9 @@ function parseArgs() {
1382
1385
  case '--login':
1383
1386
  options.login = true;
1384
1387
  break;
1388
+ case '--logout':
1389
+ options.logout = true;
1390
+ break;
1385
1391
  case '--name':
1386
1392
  options.name = args[++i];
1387
1393
  break;
@@ -1443,6 +1449,21 @@ async function main() {
1443
1449
  process.exit(0);
1444
1450
  }
1445
1451
 
1452
+ // Logout flow
1453
+ if (options.logout) {
1454
+ try {
1455
+ if (fs.existsSync(AUTH_FILE)) {
1456
+ fs.unlinkSync(AUTH_FILE);
1457
+ log('Logged out successfully', colors.green);
1458
+ } else {
1459
+ log('Not logged in', colors.yellow);
1460
+ }
1461
+ } catch (err) {
1462
+ log(`Logout failed: ${err.message}`, colors.red);
1463
+ }
1464
+ process.exit(0);
1465
+ }
1466
+
1446
1467
  // Login flow
1447
1468
  if (options.login) {
1448
1469
  const httpUrl = bridgeUrl.replace('wss://', 'https://').replace('ws://', 'http://');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minivibe",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "CLI wrapper for Claude Code with mobile remote control via MiniVibe iOS app",
5
5
  "author": "MiniVibe <hello@minivibeapp.com>",
6
6
  "homepage": "https://github.com/minivibeapp/minivibe",
package/vibe.js CHANGED
@@ -428,15 +428,35 @@ For local-only use without remote control, run 'claude' directly.
428
428
  console.log('Token stored successfully');
429
429
  i++;
430
430
  } else if (args[i] === '--logout') {
431
- try {
432
- if (fs.existsSync(TOKEN_FILE)) {
431
+ let loggedOut = false;
432
+ let errors = [];
433
+
434
+ // Try to delete AUTH_FILE
435
+ if (fs.existsSync(AUTH_FILE)) {
436
+ try {
437
+ fs.unlinkSync(AUTH_FILE);
438
+ loggedOut = true;
439
+ } catch (err) {
440
+ errors.push(`auth.json: ${err.message}`);
441
+ }
442
+ }
443
+
444
+ // Try to delete TOKEN_FILE regardless of first result
445
+ if (fs.existsSync(TOKEN_FILE)) {
446
+ try {
433
447
  fs.unlinkSync(TOKEN_FILE);
434
- console.log('Logged out successfully');
435
- } else {
436
- console.log('Not logged in');
448
+ loggedOut = true;
449
+ } catch (err) {
450
+ errors.push(`token: ${err.message}`);
437
451
  }
438
- } catch (err) {
439
- console.error('Logout failed:', err.message);
452
+ }
453
+
454
+ if (errors.length > 0) {
455
+ console.error('Logout partially failed:', errors.join(', '));
456
+ } else if (loggedOut) {
457
+ console.log('Logged out successfully');
458
+ } else {
459
+ console.log('Not logged in');
440
460
  }
441
461
  process.exit(0);
442
462
  } else if (args[i] === '--node-pty') {