lystbot 0.1.1 → 0.2.1

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/package.json +1 -1
  2. package/src/index.js +33 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lystbot",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "LystBot CLI - Manage your lists from the terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -5,13 +5,14 @@ const { randomUUID } = require('crypto');
5
5
  const readline = require('readline');
6
6
  const config = require('./config');
7
7
  const api = require('./api');
8
+ const pkg = require('../package.json');
8
9
 
9
10
  const program = new Command();
10
11
 
11
12
  program
12
13
  .name('lystbot')
13
14
  .description('📋 LystBot CLI - Manage your lists from the terminal')
14
- .version('0.1.0')
15
+ .version(pkg.version)
15
16
  .option('--api <url>', 'Use custom API URL')
16
17
  .hook('preAction', () => {
17
18
  const opts = program.opts();
@@ -50,12 +51,43 @@ program
50
51
  const lists = await api.request('GET', '/lists');
51
52
  const count = (lists.lists || lists).length;
52
53
  console.log(`✅ Logged in! Found ${count} list${count !== 1 ? 's' : ''} on your account.`);
54
+ console.log('');
55
+ console.log('💡 Set your bot name so users see who\'s making changes:');
56
+ console.log(' lystbot profile --name "My Agent" --emoji "🤖"');
53
57
  } catch {
54
58
  // Key might still be valid but lists endpoint could fail for other reasons
55
59
  console.log('✅ API key stored. Run `lystbot lists` to verify.');
56
60
  }
57
61
  });
58
62
 
63
+ // ── profile ────────────────────────────────────────────
64
+ program
65
+ .command('profile')
66
+ .description('View or update your bot profile (name, emoji)')
67
+ .option('--name <name>', 'Set bot display name')
68
+ .option('--emoji <emoji>', 'Set bot emoji')
69
+ .action(async (options) => {
70
+ config.getApiKey();
71
+ const updates = {};
72
+ if (options.name) updates.name = options.name;
73
+ if (options.emoji) updates.signature_emoji = options.emoji;
74
+
75
+ if (Object.keys(updates).length === 0) {
76
+ console.log('🤖 Bot Profile');
77
+ console.log('');
78
+ console.log('Set your name and emoji so users see who\'s making changes:');
79
+ console.log(' lystbot profile --name "My Agent" --emoji "🤖"');
80
+ console.log('');
81
+ console.log('Without a name, you\'ll show up as "Bot" in the app.');
82
+ return;
83
+ }
84
+
85
+ await api.request('PATCH', '/agents/me', updates);
86
+ console.log(`✅ Profile updated!`);
87
+ if (options.name) console.log(` Name: ${options.name}`);
88
+ if (options.emoji) console.log(` Emoji: ${options.emoji}`);
89
+ });
90
+
59
91
  // ── logout ─────────────────────────────────────────────
60
92
  program
61
93
  .command('logout')