sideby 0.31.1 → 0.31.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.
@@ -0,0 +1,842 @@
1
+ // The Command List (spec §3.38, ADR-0061): every `sideby` command a person or their AI runs, grouped by task, with a
2
+ // one-line description in English and Chinese, an example and, where the Panel has a place for it, the Search Catalog
3
+ // entry that takes the user there. `sideby --help` is generated from it, `sideby commands` lists it and the Panel
4
+ // embeds it, so the three never drift apart. Internal entries sideby runs itself (hooks, `update-check`) are not in it.
5
+ import { catalogNorm } from './search-catalog.js';
6
+ /** Task groups, in the order `sideby --help`, `sideby commands` and the Panel show them. */
7
+ export const COMMAND_GROUPS = [
8
+ { id: 'accounts', title: { en: 'Accounts', zh: '账号' } },
9
+ { id: 'start', title: { en: 'Start and open', zh: '启动与打开' } },
10
+ { id: 'shortcuts', title: { en: 'Short commands', zh: '短命令' } },
11
+ { id: 'quota', title: { en: 'Quota and usage', zh: '额度与用量' } },
12
+ { id: 'handoff', title: { en: 'Auto Handoff', zh: '自动接力' } },
13
+ { id: 'sessions', title: { en: 'Sessions and messages', zh: '会话与消息' } },
14
+ { id: 'health', title: { en: 'Health and safety', zh: '健康与安全' } },
15
+ { id: 'panel', title: { en: 'Panel and app', zh: '面板与应用' } },
16
+ { id: 'settings', title: { en: 'Settings and updates', zh: '设置与更新' } },
17
+ { id: 'help', title: { en: 'Help, AI and plugins', zh: '帮助、AI 与插件' } },
18
+ ];
19
+ export const CLI_COMMANDS = [
20
+ // ---------- Accounts ----------
21
+ {
22
+ id: 'list',
23
+ group: 'accounts',
24
+ usage: 'sideby',
25
+ help: 'list accounts (same as `sideby list`)',
26
+ summary: {
27
+ en: 'List your accounts with quota, sign-in and model',
28
+ zh: '列出账号,带额度、登录状态和模型',
29
+ },
30
+ example: 'sideby list',
31
+ common: 1,
32
+ feature: 'page.accounts',
33
+ },
34
+ {
35
+ id: 'list.all',
36
+ group: 'accounts',
37
+ usage: 'sideby list --all',
38
+ help: 'also list hidden families and accounts',
39
+ summary: { en: 'Also list hidden tools and accounts', zh: '连隐藏的工具和账号一起列出' },
40
+ },
41
+ {
42
+ id: 'new',
43
+ group: 'accounts',
44
+ usage: 'sideby new <family> <name>|--next [--api] [--alias <short>]',
45
+ help: 'create an account (families: claude, codex, grok, pi); --next picks the next name and short command (cc008); --alias also adds a short command such as cc008',
46
+ summary: { en: 'Create an account; --next picks the name for you', zh: '新建账号;--next 自动起名' },
47
+ example: 'sideby new claude --next',
48
+ common: 4,
49
+ feature: 'action.new-account',
50
+ },
51
+ {
52
+ id: 'login',
53
+ group: 'accounts',
54
+ usage: 'sideby login <account>',
55
+ help: 'sign in to an account',
56
+ summary: { en: 'Sign in to an account in the browser', zh: '在浏览器里登录一个账号' },
57
+ example: 'sideby login claude:work',
58
+ common: 5,
59
+ },
60
+ {
61
+ id: 'key',
62
+ group: 'accounts',
63
+ usage: 'sideby key <account> [--var <NAME>]',
64
+ help: 'enter an API key without echo',
65
+ summary: { en: 'Enter an API key without showing it', zh: '输入 API 密钥,屏幕上不显示' },
66
+ example: 'sideby key claude:deepseek',
67
+ },
68
+ {
69
+ id: 'try',
70
+ group: 'accounts',
71
+ usage: 'sideby try <account> [--model <m>]',
72
+ help: 'try the Host with a short paid request',
73
+ summary: {
74
+ en: 'Check an account works with a short paid request',
75
+ zh: '发一个很短的付费请求,看账号能不能用',
76
+ },
77
+ example: 'sideby try claude:deepseek',
78
+ },
79
+ {
80
+ id: 'model',
81
+ group: 'accounts',
82
+ usage: 'sideby model <account> [<model>|default] [--effort <level>|default] [--yes]',
83
+ help: 'show or set the model and effort sideby starts this account with',
84
+ summary: {
85
+ en: 'Show or set the model and effort an account starts with',
86
+ zh: '查看或设置账号启动时用的模型和推理强度',
87
+ },
88
+ example: 'sideby model claude:work',
89
+ },
90
+ {
91
+ id: 'edit',
92
+ group: 'accounts',
93
+ usage: 'sideby edit <account> [--path]',
94
+ help: "open the account's own settings file (settings.json, config.toml) in your editor",
95
+ summary: {
96
+ en: "Open an account's own settings file in your editor",
97
+ zh: '用编辑器打开账号自己的设置文件',
98
+ },
99
+ example: 'sideby edit claude:work',
100
+ },
101
+ {
102
+ id: 'families',
103
+ group: 'accounts',
104
+ usage: 'sideby families [family]',
105
+ help: "what each host's accounts share with the main account, where they live and how they sign in",
106
+ summary: {
107
+ en: "What each tool's accounts share with the main account",
108
+ zh: '每个工具的账号和主账号共享哪些东西',
109
+ },
110
+ example: 'sideby families claude',
111
+ },
112
+ {
113
+ id: 'pin',
114
+ group: 'accounts',
115
+ usage: 'sideby pin|unpin <account|short command> [--json]',
116
+ help: 'pin or unpin a Same Login (at most 3 per family)',
117
+ summary: { en: 'Pin an account to the top, or unpin it', zh: '把账号置顶或取消置顶' },
118
+ example: 'sideby pin claude:work',
119
+ feature: 'setting.order',
120
+ },
121
+ {
122
+ id: 'hide',
123
+ group: 'accounts',
124
+ usage: 'sideby hide|unhide <family|account> [--json]',
125
+ help: 'hide a family or an account from the Panel, menu bar and list',
126
+ summary: {
127
+ en: 'Hide a tool or an account from the Panel, menu bar and list',
128
+ zh: '在面板、状态栏和列表里隐藏某个工具或账号',
129
+ },
130
+ example: 'sideby hide pi',
131
+ feature: 'setting.order',
132
+ },
133
+ {
134
+ id: 'order',
135
+ group: 'accounts',
136
+ usage: 'sideby order [--json]',
137
+ help: 'show display order, with pinned and hidden accounts marked',
138
+ summary: {
139
+ en: 'Show the display order, with pins and hidden ones',
140
+ zh: '查看显示顺序,标出置顶和隐藏的',
141
+ },
142
+ feature: 'setting.order',
143
+ },
144
+ {
145
+ id: 'order.accounts',
146
+ group: 'accounts',
147
+ usage: 'sideby order <family> <name>...',
148
+ help: 'set account order within a family',
149
+ summary: { en: "Set the order of one tool's accounts", zh: '设置某个工具里账号的顺序' },
150
+ example: 'sideby order claude work main',
151
+ },
152
+ {
153
+ id: 'order.families',
154
+ group: 'accounts',
155
+ usage: 'sideby order --families <id>...',
156
+ help: 'set family order',
157
+ summary: { en: 'Set the order of the tools', zh: '设置工具的顺序' },
158
+ example: 'sideby order --families codex claude',
159
+ },
160
+ {
161
+ id: 'order.reset',
162
+ group: 'accounts',
163
+ usage: 'sideby order --reset',
164
+ help: 'restore default order, keeping pins and hidden ones',
165
+ summary: {
166
+ en: 'Go back to the default order, keeping pins and hidden ones',
167
+ zh: '恢复默认顺序,保留置顶和隐藏',
168
+ },
169
+ },
170
+ // ---------- Start and open ----------
171
+ {
172
+ id: 'run',
173
+ group: 'start',
174
+ usage: 'sideby run <account> [-- args]',
175
+ help: 'start the host CLI for one account',
176
+ summary: { en: 'Start the AI tool as one account', zh: '用某个账号启动 AI 工具' },
177
+ example: 'sideby run claude:work',
178
+ common: 2,
179
+ },
180
+ {
181
+ id: 'next',
182
+ group: 'start',
183
+ usage: 'sideby next <family> [--dry-run] [--include-api] [--ignore-network] [--unattended] [-- args]',
184
+ help: 'recommend the account with the most quota left (claude, codex, grok) and start it; --dry-run only recommends',
185
+ summary: { en: 'Start the account with the most quota left', zh: '启动剩余额度最多的账号' },
186
+ example: 'sideby next claude',
187
+ common: 3,
188
+ },
189
+ {
190
+ id: 'resume',
191
+ group: 'start',
192
+ usage: 'sideby resume <family> [-- args]',
193
+ help: 'run the host; a session resumed by id (claude --resume <id>, codex resume <id>) starts in the account that holds it',
194
+ summary: {
195
+ en: 'Resume a session by id in the account that holds it',
196
+ zh: '按 id 恢复会话,自动用存着它的账号',
197
+ },
198
+ },
199
+ {
200
+ id: 'desktop',
201
+ group: 'start',
202
+ usage: 'sideby desktop <account>',
203
+ help: 'open the desktop app (Claude Desktop, the Codex app) as this account, next to the others (macOS)',
204
+ summary: { en: 'Open the desktop app as this account (macOS)', zh: '用这个账号打开桌面应用(macOS)' },
205
+ example: 'sideby desktop claude:work',
206
+ },
207
+ {
208
+ id: 'desktop.grok-bot',
209
+ group: 'start',
210
+ usage: 'sideby desktop grok-bot:<name>',
211
+ help: 'open a Grok Bot window, a new one for a new name (macOS)',
212
+ summary: { en: 'Open a Grok Bot window (macOS)', zh: '打开一个 Grok Bot 窗口(macOS)' },
213
+ example: 'sideby desktop grok-bot:002',
214
+ },
215
+ {
216
+ id: 'browser',
217
+ group: 'start',
218
+ usage: 'sideby browser [--enable [--yes]]',
219
+ help: "which Chrome browser user signed in to each account's website (read on this computer only; off until you enable it)",
220
+ summary: {
221
+ en: "Which Chrome user is signed in to each account's website",
222
+ zh: '每个账号的网站登录在哪个 Chrome 用户里',
223
+ },
224
+ example: 'sideby browser --enable',
225
+ },
226
+ {
227
+ id: 'browser.open',
228
+ group: 'start',
229
+ usage: 'sideby browser open <account> [--profile <name>]',
230
+ help: 'open claude.ai, chatgpt.com or grok.com in that browser user',
231
+ summary: {
232
+ en: "Open the account's website in the right Chrome user",
233
+ zh: '在对应的 Chrome 用户里打开账号的网站',
234
+ },
235
+ example: 'sideby browser open cc008',
236
+ },
237
+ {
238
+ id: 'browser.set',
239
+ group: 'start',
240
+ usage: 'sideby browser set <account> <name> | --auto',
241
+ help: 'choose that browser user yourself, or let sideby find it again',
242
+ summary: {
243
+ en: 'Choose the Chrome user yourself, or let sideby find it',
244
+ zh: '自己指定 Chrome 用户,或让 sideby 重新找',
245
+ },
246
+ },
247
+ // ---------- Short commands ----------
248
+ {
249
+ id: 'alias.add',
250
+ group: 'shortcuts',
251
+ usage: 'sideby alias add <short> <account> [-- args]',
252
+ help: 'add a short command, optionally with host arguments (sideby alias add pi-kimi pi:main -- --model kimi-coding/k3)',
253
+ summary: { en: 'Add a short command that starts an account', zh: '加一个启动某个账号的短命令' },
254
+ example: 'sideby alias add cc008 claude:008',
255
+ },
256
+ {
257
+ id: 'alias.pick',
258
+ group: 'shortcuts',
259
+ usage: 'sideby alias add <short> --pick <family> [--yes]',
260
+ help: 'add a pick command: each run starts the account with the most quota left (sideby alias add cc --pick claude)',
261
+ summary: {
262
+ en: 'Add a pick command: it starts the account with the most quota left',
263
+ zh: '加一个挑选命令:每次启动剩余额度最多的账号',
264
+ },
265
+ example: 'sideby alias add cc --pick claude',
266
+ feature: 'setting.pick',
267
+ },
268
+ {
269
+ id: 'alias.rm',
270
+ group: 'shortcuts',
271
+ usage: 'sideby alias rm <short>',
272
+ help: 'remove a short command',
273
+ summary: { en: 'Remove a short command', zh: '删除一个短命令' },
274
+ example: 'sideby alias rm cc008',
275
+ },
276
+ {
277
+ id: 'alias.list',
278
+ group: 'shortcuts',
279
+ usage: 'sideby alias list',
280
+ help: 'list short commands and pick commands',
281
+ summary: { en: 'List short commands and pick commands', zh: '列出短命令和挑选命令' },
282
+ },
283
+ {
284
+ id: 'shell-init',
285
+ group: 'shortcuts',
286
+ usage: 'sideby shell-init zsh|bash',
287
+ help: 'print shell functions, e.g. eval "$(sideby shell-init zsh)"',
288
+ summary: {
289
+ en: 'Print the shell functions behind your short commands',
290
+ zh: '输出短命令背后的 shell 函数',
291
+ },
292
+ example: 'eval "$(sideby shell-init zsh)"',
293
+ },
294
+ {
295
+ id: 'shell-init.write',
296
+ group: 'shortcuts',
297
+ usage: 'sideby shell-init [zsh|bash] --write',
298
+ help: "rewrite the config's shellInitFile with them",
299
+ summary: { en: "Rewrite the config's shellInitFile with them", zh: '用它们重写配置里的 shellInitFile' },
300
+ },
301
+ {
302
+ id: 'shell-init.setup',
303
+ group: 'shortcuts',
304
+ usage: 'sideby shell-init setup [zsh|bash] [--yes|--undo]',
305
+ help: 'make new terminals load your short commands: adds one line to ~/.zshrc (or ~/.bashrc), shown first; --undo takes it out',
306
+ summary: { en: 'Make new terminals load your short commands', zh: '让新开的终端自动加载短命令' },
307
+ example: 'sideby shell-init setup',
308
+ },
309
+ // ---------- Quota and usage ----------
310
+ {
311
+ id: 'quota',
312
+ group: 'quota',
313
+ usage: 'sideby quota [account|family] [--refresh]',
314
+ help: 'quota and 7-day token usage; --refresh asks every fetching family again now',
315
+ summary: { en: 'Quota left and 7-day token usage', zh: '剩余额度和 7 天的 token 用量' },
316
+ example: 'sideby quota claude',
317
+ common: 6,
318
+ feature: 'page.accounts',
319
+ },
320
+ {
321
+ id: 'quota.setup',
322
+ group: 'quota',
323
+ usage: 'sideby quota setup claude [--yes]',
324
+ help: 'turn on Claude quota (shows the change first)',
325
+ summary: { en: 'Turn on Claude quota (shows the change first)', zh: '开启 Claude 额度(先给你看改动)' },
326
+ },
327
+ {
328
+ id: 'quota.teardown',
329
+ group: 'quota',
330
+ usage: 'sideby quota teardown claude',
331
+ help: 'undo it, restoring the original file',
332
+ summary: { en: 'Undo the Claude quota setup', zh: '撤销 Claude 额度设置,恢复原文件' },
333
+ },
334
+ {
335
+ id: 'quota.check',
336
+ group: 'quota',
337
+ usage: 'sideby quota check <family> on|off',
338
+ help: 'turn quota fetching on or off',
339
+ summary: { en: "Turn a tool's quota checks on or off", zh: '开关某个工具的额度查询' },
340
+ example: 'sideby quota check grok off',
341
+ feature: 'setting.quota-checks',
342
+ },
343
+ {
344
+ id: 'tune',
345
+ group: 'quota',
346
+ usage: 'sideby tune [account|family]',
347
+ help: 'estimate the cheapest auto-compact threshold per model from your last 7 days of sessions (read-only)',
348
+ summary: {
349
+ en: 'Estimate the cheapest auto-compact size per model',
350
+ zh: '按模型估算最省钱的自动压缩大小',
351
+ },
352
+ example: 'sideby tune claude',
353
+ feature: 'page.tuning',
354
+ },
355
+ // ---------- Auto Handoff ----------
356
+ {
357
+ id: 'handoff.status',
358
+ group: 'handoff',
359
+ usage: 'sideby handoff status',
360
+ help: 'what Auto Handoff still needs on this machine',
361
+ summary: { en: 'What Auto Handoff still needs on this computer', zh: '自动接力在这台电脑上还缺什么' },
362
+ feature: 'page.handoff',
363
+ },
364
+ {
365
+ id: 'handoff.rules',
366
+ group: 'handoff',
367
+ usage: 'sideby handoff rules',
368
+ help: "every rule that decides when it hands over and to whom, and where each account's work would go now",
369
+ summary: { en: 'When it hands over, and to which account', zh: '什么时候接力、交给哪个账号' },
370
+ },
371
+ {
372
+ id: 'handoff.enable',
373
+ group: 'handoff',
374
+ usage: 'sideby handoff enable [--yes]',
375
+ help: 'turn it on (shows the config change first); --same-family, --order claude=codex001,cc002, --threshold n, --prepare-at n, --other-ai [--ai-order codex,grok], --api (billed per use)',
376
+ summary: { en: 'Turn on Auto Handoff (shows the change first)', zh: '开启自动接力(先给你看改动)' },
377
+ example: 'sideby handoff enable',
378
+ feature: 'action.handoff-on',
379
+ },
380
+ {
381
+ id: 'handoff.disable',
382
+ group: 'handoff',
383
+ usage: 'sideby handoff disable [--yes]',
384
+ help: 'turn it off, keeping the other settings',
385
+ summary: { en: 'Turn Auto Handoff off, keeping its settings', zh: '关闭自动接力,保留其他设置' },
386
+ },
387
+ {
388
+ id: 'handoff.ready',
389
+ group: 'handoff',
390
+ usage: 'sideby handoff ready [--brief <f>]',
391
+ help: 'inside a session sideby started with Auto Handoff: hand over to the next account when this turn ends (config `handoff`); --to <account> names it, also one this chain already used',
392
+ summary: {
393
+ en: 'Inside a session: hand the task to the next account',
394
+ zh: '在会话里:把任务交给下一个账号',
395
+ },
396
+ example: 'sideby handoff ready --to cc008',
397
+ },
398
+ {
399
+ id: 'handoff.setup',
400
+ group: 'handoff',
401
+ usage: 'sideby handoff setup grok [--yes]',
402
+ help: "add sideby's hook file so Grok can hand over at its limit",
403
+ summary: {
404
+ en: 'Let Grok hand over at its limit (adds a hook file)',
405
+ zh: '让 Grok 到上限时也能接力(加一个 hook 文件)',
406
+ },
407
+ },
408
+ {
409
+ id: 'handoff.teardown',
410
+ group: 'handoff',
411
+ usage: 'sideby handoff teardown grok',
412
+ help: 'remove it',
413
+ summary: { en: "Remove Grok's handoff hook file", zh: '删掉 Grok 的接力 hook 文件' },
414
+ },
415
+ // ---------- Sessions and messages ----------
416
+ {
417
+ id: 'sessions',
418
+ group: 'sessions',
419
+ usage: 'sideby sessions [<account>|<family>]',
420
+ help: 'which session each account runs now, needing you first',
421
+ summary: { en: 'Which session each account runs now', zh: '每个账号现在在跑哪个会话' },
422
+ example: 'sideby sessions',
423
+ feature: 'page.sessions',
424
+ },
425
+ {
426
+ id: 'sessions.copy',
427
+ group: 'sessions',
428
+ usage: 'sideby sessions copy <account|session-id> [--as reference|id|resume]',
429
+ help: 'copy one for another AI: a reference to its record (default), its id or its resume command',
430
+ summary: {
431
+ en: 'Copy a session for another AI: a reference, its id or resume command',
432
+ zh: '把会话复制给另一个 AI:引用、id 或恢复命令',
433
+ },
434
+ example: 'sideby sessions copy cc008 --as resume',
435
+ },
436
+ {
437
+ id: 'sessions.open-run',
438
+ group: 'sessions',
439
+ usage: 'sideby sessions open-run <account|session-id>',
440
+ help: 'open the run report of the dispatched task that session works for',
441
+ summary: {
442
+ en: 'Open the run report of the task a session works for',
443
+ zh: '打开会话所属派发任务的进度报告',
444
+ },
445
+ },
446
+ {
447
+ id: 'history',
448
+ group: 'sessions',
449
+ usage: 'sideby history [<words>...]',
450
+ help: 'find any past session of any account, by project, AI, time or what was said (--project, --family, --account, --since, --tools also searches tool output)',
451
+ summary: { en: 'Find any past session of any account', zh: '查找任一账号的历史会话' },
452
+ example: 'sideby history login page --since 7d',
453
+ common: 7,
454
+ feature: 'page.sessions',
455
+ },
456
+ {
457
+ id: 'history.show',
458
+ group: 'sessions',
459
+ usage: 'sideby history show <id>',
460
+ help: 'read one session; history projects lists the projects',
461
+ summary: { en: 'Read one past session', zh: '阅读一个历史会话' },
462
+ },
463
+ {
464
+ id: 'history.index',
465
+ group: 'sessions',
466
+ usage: 'sideby history index [--clear]',
467
+ help: 'the local search index: how far it is built, or delete it',
468
+ summary: {
469
+ en: 'The local search index: how far it is built, or delete it',
470
+ zh: '本地搜索索引:建到哪了,或删掉它',
471
+ },
472
+ },
473
+ {
474
+ id: 'send',
475
+ group: 'sessions',
476
+ usage: 'sideby send <account|session> "<text>" [--image <path>]...',
477
+ help: 'tell another session something (a screenshot too): Claude sessions get it at once, others through a line you paste',
478
+ summary: { en: 'Tell another running session something', zh: '给另一个正在跑的会话发消息' },
479
+ example: 'sideby send cc008 "the build is green"',
480
+ },
481
+ {
482
+ id: 'messages',
483
+ group: 'sessions',
484
+ usage: 'sideby messages [--to <account|session>]',
485
+ help: 'the messages you sent and whether each was delivered or read',
486
+ summary: { en: 'Messages you sent, and whether each arrived', zh: '你发过的消息,以及是否送达或已读' },
487
+ },
488
+ {
489
+ id: 'messages.inbound',
490
+ group: 'sessions',
491
+ usage: 'sideby messages inbound [accept|undo] [--yes]',
492
+ help: 'whether Claude sessions show messages from other sessions at once',
493
+ summary: {
494
+ en: 'Whether Claude sessions show messages from others at once',
495
+ zh: 'Claude 会话是否马上显示别的会话发来的消息',
496
+ },
497
+ feature: 'action.inbound',
498
+ },
499
+ // ---------- Health and safety ----------
500
+ {
501
+ id: 'doctor',
502
+ group: 'health',
503
+ usage: 'sideby doctor [target] [--fix] [--force]',
504
+ help: 'check shared items and permissions; --fix repairs safe issues',
505
+ summary: {
506
+ en: 'Check shared items and permissions; --fix repairs them',
507
+ zh: '检查共享项和权限;--fix 修复',
508
+ },
509
+ example: 'sideby doctor --fix',
510
+ common: 8,
511
+ feature: 'action.health-check',
512
+ },
513
+ {
514
+ id: 'remote-control',
515
+ group: 'health',
516
+ usage: 'sideby remote-control [on|off|undo] [--yes]',
517
+ help: 'whether Claude sessions connect to claude.ai by themselves; off stops that for every account (shows the change first)',
518
+ summary: {
519
+ en: 'Whether Claude sessions connect to claude.ai by themselves',
520
+ zh: 'Claude 会话是否自己连上 claude.ai',
521
+ },
522
+ example: 'sideby remote-control off',
523
+ feature: 'setting.remote-control',
524
+ },
525
+ {
526
+ id: 'network',
527
+ group: 'health',
528
+ usage: 'sideby network [check]',
529
+ help: 'stop Claude and Codex when requests would leave from a country you did not allow (network on|off|allow <CC>... [--yes])',
530
+ summary: {
531
+ en: 'Stop Claude and Codex when requests leave from a country you did not allow',
532
+ zh: '请求从你没允许的国家或地区发出时,拦下 Claude 和 Codex',
533
+ },
534
+ example: 'sideby network check',
535
+ feature: 'setting.network',
536
+ },
537
+ {
538
+ id: 'unattended',
539
+ group: 'health',
540
+ usage: 'sideby unattended [on|off]',
541
+ help: 'nobody is here: sessions sideby starts do not stop to ask; on takes --for 4h, --until 07:30 or --slot-end (schedule add|remove|preset weeknights, pending [done <id>|--all], defer "<text>"); run --unattended for one session',
542
+ summary: { en: 'Nobody is here: sessions do not stop to ask', zh: '无人值守:会话不停下来问你' },
543
+ example: 'sideby unattended on --until 07:30',
544
+ feature: 'page.unattended',
545
+ },
546
+ // ---------- Panel and app ----------
547
+ {
548
+ id: 'ui',
549
+ group: 'panel',
550
+ usage: 'sideby ui [--port n] [--no-open]',
551
+ help: 'open the local panel',
552
+ summary: { en: 'Open the Panel in your browser', zh: '在浏览器里打开面板' },
553
+ example: 'sideby ui',
554
+ common: 9,
555
+ },
556
+ {
557
+ id: 'ui.background',
558
+ group: 'panel',
559
+ usage: 'sideby ui --background',
560
+ help: 'same, without a terminal: keeps running after this command exits',
561
+ summary: { en: 'Run the Panel in the background', zh: '在后台运行面板' },
562
+ },
563
+ {
564
+ id: 'ui.stop',
565
+ group: 'panel',
566
+ usage: 'sideby ui --stop',
567
+ help: 'stop the background panel',
568
+ summary: { en: 'Stop the background Panel', zh: '停止后台运行的面板' },
569
+ },
570
+ {
571
+ id: 'app.install',
572
+ group: 'panel',
573
+ usage: 'sideby app install [--url <url>]',
574
+ help: 'add a sideby app that opens the panel (macOS, Linux)',
575
+ summary: { en: 'Add a sideby app that opens the Panel', zh: '添加一个打开面板的 sideby 应用' },
576
+ },
577
+ {
578
+ id: 'app.uninstall',
579
+ group: 'panel',
580
+ usage: 'sideby app uninstall',
581
+ help: 'remove that app',
582
+ summary: { en: 'Remove the sideby app', zh: '删除 sideby 应用' },
583
+ },
584
+ {
585
+ id: 'menubar',
586
+ group: 'panel',
587
+ usage: 'sideby menubar [on|off] [--yes]',
588
+ help: 'show quota in the macOS menu bar; click an account to start it',
589
+ summary: { en: 'Show quota in the macOS menu bar', zh: '在 macOS 状态栏显示额度' },
590
+ example: 'sideby menubar on',
591
+ feature: 'setting.menubar',
592
+ },
593
+ {
594
+ id: 'menubar.hotkey',
595
+ group: 'panel',
596
+ usage: 'sideby menubar hotkey [<keys>|off]',
597
+ help: 'show or change the shortcut that opens that menu (⌥X)',
598
+ summary: { en: 'Show or change the menu bar shortcut', zh: '查看或修改状态栏快捷键' },
599
+ feature: 'setting.hotkey',
600
+ },
601
+ {
602
+ id: 'autostart',
603
+ group: 'panel',
604
+ usage: 'sideby autostart [on|off] [--yes]',
605
+ help: 'start the panel in the background at login (macOS, Linux, WSL; shows the file first)',
606
+ summary: { en: 'Start the Panel in the background at login', zh: '登录电脑后在后台启动面板' },
607
+ example: 'sideby autostart on',
608
+ feature: 'setting.autostart',
609
+ },
610
+ {
611
+ id: 'theme',
612
+ group: 'panel',
613
+ usage: 'sideby theme [list]',
614
+ help: "the Panel's Themes; use <name> switches, use --undo goes back, use default clears",
615
+ summary: { en: "The Panel's themes; use <name> switches to one", zh: '面板的主题;use <名字> 切换' },
616
+ example: 'sideby theme use teal',
617
+ feature: 'setting.theme',
618
+ },
619
+ {
620
+ id: 'theme.check',
621
+ group: 'panel',
622
+ usage: 'sideby theme check|preview <name|file>',
623
+ help: 'contrast report, or one look in the Panel without switching',
624
+ summary: {
625
+ en: "Check a theme's contrast, or preview it in the Panel",
626
+ zh: '检查主题对比度,或在面板里预览',
627
+ },
628
+ },
629
+ {
630
+ id: 'theme.files',
631
+ group: 'panel',
632
+ usage: 'sideby theme import <file> | export <name> | remove <name>',
633
+ help: 'your own Themes (JSON, colors only)',
634
+ summary: { en: 'Import, export or remove your own themes', zh: '导入、导出或删除自己的主题' },
635
+ },
636
+ // ---------- Settings and updates ----------
637
+ {
638
+ id: 'config.get',
639
+ group: 'settings',
640
+ usage: 'sideby config get [<key>]',
641
+ help: 'every setting with its value and meaning, or one setting',
642
+ summary: { en: 'Every setting with its value and meaning', zh: '每项设置的取值和含义' },
643
+ example: 'sideby config get panel.theme',
644
+ },
645
+ {
646
+ id: 'config.set',
647
+ group: 'settings',
648
+ usage: 'sideby config set <key> <value> [--yes]',
649
+ help: 'change any setting (sideby config set panel.theme dark)',
650
+ summary: { en: 'Change any setting', zh: '修改任意一项设置' },
651
+ example: 'sideby config set panel.theme dark',
652
+ },
653
+ {
654
+ id: 'config.unset',
655
+ group: 'settings',
656
+ usage: 'sideby config unset <key> [--yes]',
657
+ help: 'back to the default',
658
+ summary: { en: 'Put a setting back to its default', zh: '把一项设置恢复默认' },
659
+ },
660
+ {
661
+ id: 'terminal',
662
+ group: 'settings',
663
+ usage: 'sideby terminal [--set <id>|--custom <t>|--unset]',
664
+ help: 'choose your terminal',
665
+ summary: { en: 'Choose the terminal sideby opens tasks in', zh: '选择 sideby 打开任务用的终端' },
666
+ feature: 'setting.terminal',
667
+ },
668
+ {
669
+ id: 'update',
670
+ group: 'settings',
671
+ usage: 'sideby update [--yes]',
672
+ help: 'update sideby to the newest version (shows the command first)',
673
+ summary: { en: 'Update sideby to the newest version', zh: '把 sideby 更新到最新版本' },
674
+ example: 'sideby update',
675
+ feature: 'action.update',
676
+ },
677
+ {
678
+ id: 'update.auto',
679
+ group: 'settings',
680
+ usage: 'sideby update --auto on|off',
681
+ help: 'set Auto Update without running an update',
682
+ summary: { en: 'Turn Auto Update on or off', zh: '开关自动更新' },
683
+ },
684
+ {
685
+ id: 'update.skill',
686
+ group: 'settings',
687
+ usage: 'sideby update --skill [--yes]',
688
+ help: 'update only the installed sideby skill to this version',
689
+ summary: { en: 'Update only the installed sideby skill', zh: '只更新已安装的 sideby 技能' },
690
+ feature: 'setting.skill',
691
+ },
692
+ {
693
+ id: 'local',
694
+ group: 'settings',
695
+ usage: 'sideby local [on|off] [--yes]',
696
+ help: 'for sideby developers: switch the global sideby between the last local build (pnpm local) and the npm package',
697
+ summary: {
698
+ en: 'For sideby developers: use the local build or the npm package',
699
+ zh: '给 sideby 开发者:在本地构建和 npm 包之间切换',
700
+ },
701
+ },
702
+ // ---------- Help, AI and plugins ----------
703
+ {
704
+ id: 'commands',
705
+ group: 'help',
706
+ usage: 'sideby commands',
707
+ help: 'list every command by task, the common ones first (in the Panel: Commands, or press ?)',
708
+ summary: { en: 'List every command by task', zh: '按任务列出所有命令' },
709
+ example: 'sideby commands',
710
+ feature: 'action.commands',
711
+ },
712
+ {
713
+ id: 'commands.find',
714
+ group: 'help',
715
+ usage: 'sideby commands <words>',
716
+ help: 'find where a page, setting or action lives in the Panel, and the command that does the same (read-only)',
717
+ summary: {
718
+ en: 'Find where a feature lives in the Panel, and its command',
719
+ zh: '查某个功能在面板哪里,以及对应的命令',
720
+ },
721
+ example: 'sideby commands language',
722
+ },
723
+ {
724
+ id: 'ask',
725
+ group: 'help',
726
+ usage: 'sideby ask [<text>] [--print]',
727
+ help: 'let your AI handle a sideby task',
728
+ summary: { en: 'Let your AI handle a sideby task', zh: '让你的 AI 处理一件 sideby 的事' },
729
+ feature: 'action.ask-ai',
730
+ },
731
+ {
732
+ id: 'plugins',
733
+ group: 'help',
734
+ usage: 'sideby plugins',
735
+ help: 'list loaded plugins and load errors',
736
+ summary: { en: 'List loaded plugins and load errors', zh: '列出已加载的插件和加载错误' },
737
+ },
738
+ {
739
+ id: 'plugins.new',
740
+ group: 'help',
741
+ usage: 'sideby plugins new <id>',
742
+ help: 'create a local Family Plugin skeleton',
743
+ summary: { en: 'Create a plugin that adds a tool', zh: '新建一个支持新工具的插件骨架' },
744
+ },
745
+ {
746
+ id: 'plugins.check',
747
+ group: 'help',
748
+ usage: 'sideby plugins check <id|path>',
749
+ help: 'check a plugin and show fixes',
750
+ summary: { en: 'Check a plugin and show fixes', zh: '检查插件并给出修法' },
751
+ },
752
+ ];
753
+ /** The common commands, in the order the "Common" group shows them. */
754
+ export function commonCommands(list = CLI_COMMANDS) {
755
+ return list.filter((c) => c.common).sort((a, b) => (a.common ?? 0) - (b.common ?? 0));
756
+ }
757
+ /** The commands `main.ts` dispatches for a usage line: `run`; `pin` and `unpin` for `pin|unpin`; `list` for `sideby`. */
758
+ export function commandWords(usage) {
759
+ return (usage.split(' ')[1] ?? 'list').split('|');
760
+ }
761
+ /**
762
+ * Commands matching `query`, in catalog order. Every word of the query must appear in the usage, the example, the
763
+ * description in either language or the group's title; an empty query matches everything. Runs in the Panel too.
764
+ */
765
+ export function filterCommands(query, list, groups) {
766
+ const words = catalogNorm(query).split(' ').filter(Boolean);
767
+ if (!words.length)
768
+ return list;
769
+ return list.filter((c) => {
770
+ const g = groups.find((x) => x.id === c.group);
771
+ const text = catalogNorm([c.usage, c.example || '', c.summary.en, c.summary.zh, g ? g.title.en : '', g ? g.title.zh : ''].join(' '));
772
+ return words.every((w) => text.includes(w));
773
+ });
774
+ }
775
+ const HELP_COL = 38;
776
+ const HELP_WIDTH = 118;
777
+ function wrapHelp(text) {
778
+ const lines = [];
779
+ let line = '';
780
+ for (const word of text.split(' ')) {
781
+ if (line && line.length + 1 + word.length > HELP_WIDTH - HELP_COL) {
782
+ lines.push(line);
783
+ line = word;
784
+ }
785
+ else
786
+ line = line ? `${line} ${word}` : word;
787
+ }
788
+ if (line)
789
+ lines.push(line);
790
+ return lines;
791
+ }
792
+ /** One command as `sideby --help` prints it: the usage, then its description from column 38, wrapped. */
793
+ function helpEntry(c) {
794
+ const head = ` ${c.usage}`;
795
+ const pad = ' '.repeat(HELP_COL);
796
+ const sameLine = head.length < HELP_COL;
797
+ const lines = wrapHelp(c.help);
798
+ const out = sameLine ? [head.padEnd(HELP_COL) + lines[0]] : [head, pad + lines[0]];
799
+ for (const l of lines.slice(1))
800
+ out.push(pad + l);
801
+ return out.join('\n');
802
+ }
803
+ /** `sideby --help`: the commands grouped by task, from the Command List, then the options and the notes. */
804
+ export function cliHelp(list = CLI_COMMANDS) {
805
+ const parts = [
806
+ 'sideby — run every AI coding account side by side',
807
+ '',
808
+ 'Usage, by task (`sideby commands` lists them with examples; `sideby <command> --help` explains one):',
809
+ ];
810
+ for (const g of COMMAND_GROUPS) {
811
+ const cmds = list.filter((c) => c.group === g.id);
812
+ if (!cmds.length)
813
+ continue;
814
+ parts.push('', `${g.title.en}:`, ...cmds.map(helpEntry));
815
+ }
816
+ parts.push('', HELP_TAIL);
817
+ return parts.join('\n');
818
+ }
819
+ const HELP_TAIL = `Options:
820
+ --json machine-readable output (list, new, next, alias, doctor, quota, tune, model, remote-control, handoff,
821
+ families, commands, plugins, app, desktop, sessions, history, send, messages, edit, browser, update, local, ask,
822
+ terminal, key, try, autostart, menubar, config, network, unattended)
823
+ -h, --help show this help; \`sideby <command> --help\` for new, alias, login, doctor, families, commands, desktop, edit, browser,
824
+ autostart, menubar, config, sessions, history, send, messages, network, unattended
825
+ -v, --version show the version
826
+
827
+ An <account> is <family>:<name> (claude:work) or just <name> when it is unique.
828
+
829
+ For AI agents:
830
+ Add --json and read the result; JSON Schemas ship in the package under schemas/.
831
+ Install the skill: npx skills add Adonis0123/sideby -g
832
+ Setup steps and the full contract: https://github.com/Adonis0123/sideby/blob/main/llms.txt
833
+ Run everything else yourself, but hand the user these as one line each: \`sideby login <account>\`
834
+ (browser sign-in), filling in proxy.env, and \`sideby run\` or \`sideby next\` (interactive sessions).
835
+ Exit 10 means a change was shown: ask the user, then run it again with --yes.
836
+
837
+ Updates: once a day sideby asks the npm registry for its newest version and says so after a command.
838
+ Turn it off with NO_UPDATE_NOTIFIER=1 or config "update": { "check": false }; "auto": true installs by itself.`;
839
+ /** What the Panel embeds: everything but the `--help` text, which only the terminal shows. */
840
+ export function commandListForPage() {
841
+ return { groups: COMMAND_GROUPS, commands: CLI_COMMANDS.map(({ help: _help, ...rest }) => rest) };
842
+ }