sideby 0.31.2 → 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.
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +0 -4
- package/dist/src/cli/commands.js +49 -3
- package/dist/src/cli/json-schemas.js +20 -0
- package/dist/src/cli/main.js +19 -159
- package/dist/src/core/cli-commands.d.ts +56 -0
- package/dist/src/core/cli-commands.js +842 -0
- package/dist/src/core/handoff-chain.d.ts +9 -3
- package/dist/src/core/handoff-chain.js +3 -2
- package/dist/src/core/handoff-run.js +19 -2
- package/dist/src/core/handoff-select.d.ts +15 -5
- package/dist/src/core/handoff-select.js +28 -16
- package/dist/src/core/search-catalog.js +20 -0
- package/dist/src/handoff/hook.js +5 -0
- package/dist/src/panel/i18n.d.ts +14 -0
- package/dist/src/panel/i18n.js +28 -0
- package/dist/src/panel/page-script.js +117 -8
- package/dist/src/panel/page-styles.js +18 -0
- package/dist/src/panel/page.js +3 -0
- package/package.json +1 -1
- package/schemas/commands-list.json +165 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/handoff.md +1 -1
- package/skills/sideby/references/panel.md +10 -0
package/dist/build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"20261030T062005-e5e314"}
|
|
@@ -165,8 +165,4 @@ export declare function cmdTheme(a: ParsedArgs, io: Io): Promise<number>;
|
|
|
165
165
|
export declare function cmdNetwork(a: ParsedArgs, io: Io): Promise<number>;
|
|
166
166
|
/** `sideby unattended …` (spec §3.37, ADR-0058): status, on and off, the Schedule, Pending Decisions and `defer`. */
|
|
167
167
|
export declare function cmdUnattended(a: ParsedArgs, io: Io): Promise<number>;
|
|
168
|
-
/**
|
|
169
|
-
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
170
|
-
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
|
171
|
-
*/
|
|
172
168
|
export declare function cmdCommands(a: ParsedArgs, io: Io): number;
|
package/dist/src/cli/commands.js
CHANGED
|
@@ -5,6 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import { aliasesByAccount } from '../core/accounts.js';
|
|
6
6
|
import { listAppProfiles, openAppProfile, parseProfileRef, removeAppProfile } from '../core/app-profiles.js';
|
|
7
7
|
import { browserReport, openInBrowser, setBrowserChoice, setBrowserSignIns, } from '../core/browser-profiles.js';
|
|
8
|
+
import { CLI_COMMANDS, COMMAND_GROUPS, commonCommands } from '../core/cli-commands.js';
|
|
8
9
|
import { aliasAccount, aliasArgs, aliasRefs, editConfigUpdate } from '../core/config.js';
|
|
9
10
|
import { openDesktopApp, withDesktopApps } from '../core/desktop-app.js';
|
|
10
11
|
import { editSettings } from '../core/edit-settings.js';
|
|
@@ -2411,14 +2412,15 @@ export function readKeyLine(input = process.stdin) {
|
|
|
2411
2412
|
throw new UserError('Run `sideby key` in a terminal or use the Panel key box.', { code: 'tty-required' });
|
|
2412
2413
|
return new Promise((resolve, reject) => {
|
|
2413
2414
|
const raw = input.isRaw;
|
|
2414
|
-
|
|
2415
|
+
// A stdin nobody read yet is not paused but not flowing either; leaving it flowing keeps the process alive.
|
|
2416
|
+
const flowing = input.readableFlowing === true;
|
|
2415
2417
|
let value = '';
|
|
2416
2418
|
const finish = (error) => {
|
|
2417
2419
|
input.off('data', onData);
|
|
2418
2420
|
input.off('end', onEnd);
|
|
2419
2421
|
input.off('error', onError);
|
|
2420
2422
|
input.setRawMode(raw);
|
|
2421
|
-
if (
|
|
2423
|
+
if (!flowing)
|
|
2422
2424
|
input.pause();
|
|
2423
2425
|
if (error)
|
|
2424
2426
|
reject(error);
|
|
@@ -4241,10 +4243,54 @@ export async function cmdUnattended(a, io) {
|
|
|
4241
4243
|
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
4242
4244
|
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
|
4243
4245
|
*/
|
|
4246
|
+
/** One command of the Command List as `sideby commands --json` gives it (spec §3.38). */
|
|
4247
|
+
function commandOut(cmd) {
|
|
4248
|
+
const place = cmd.feature ? SEARCH_CATALOG.find((e) => e.id === cmd.feature) : undefined;
|
|
4249
|
+
return {
|
|
4250
|
+
id: cmd.id,
|
|
4251
|
+
usage: cmd.usage,
|
|
4252
|
+
description: cmd.summary.en,
|
|
4253
|
+
example: cmd.example ?? null,
|
|
4254
|
+
featureId: place?.id ?? null,
|
|
4255
|
+
panel: place?.panel.en ?? null,
|
|
4256
|
+
};
|
|
4257
|
+
}
|
|
4258
|
+
/** Rows of `command description`; a command too long for the column gets the description on the next line. */
|
|
4259
|
+
function commandRows(rows) {
|
|
4260
|
+
const col = Math.min(44, Math.max(...rows.map(([u]) => u.length)) + 2);
|
|
4261
|
+
return rows.flatMap(([u, d]) => u.length + 2 <= col ? [` ${u.padEnd(col)}${d}`] : [` ${u}`, ` ${' '.repeat(col)}${d}`]);
|
|
4262
|
+
}
|
|
4263
|
+
/** `sideby commands` with no words: every command by task, the common ones first, each with an example there. */
|
|
4264
|
+
function listCommands(a, io) {
|
|
4265
|
+
const common = commonCommands();
|
|
4266
|
+
if (a.flags.has('json')) {
|
|
4267
|
+
json(io, {
|
|
4268
|
+
common: common.map((cmd) => cmd.id),
|
|
4269
|
+
groups: COMMAND_GROUPS.map((g) => ({
|
|
4270
|
+
id: g.id,
|
|
4271
|
+
title: g.title.en,
|
|
4272
|
+
commands: CLI_COMMANDS.filter((cmd) => cmd.group === g.id).map(commandOut),
|
|
4273
|
+
})).filter((g) => g.commands.length),
|
|
4274
|
+
});
|
|
4275
|
+
return 0;
|
|
4276
|
+
}
|
|
4277
|
+
const out = [
|
|
4278
|
+
c.bold('Common'),
|
|
4279
|
+
...commandRows(common.map((cmd) => [cmd.example ?? cmd.usage, cmd.summary.en])),
|
|
4280
|
+
];
|
|
4281
|
+
for (const g of COMMAND_GROUPS) {
|
|
4282
|
+
const cmds = CLI_COMMANDS.filter((cmd) => cmd.group === g.id);
|
|
4283
|
+
if (cmds.length)
|
|
4284
|
+
out.push('', c.bold(g.title.en), ...commandRows(cmds.map((cmd) => [cmd.usage, cmd.summary.en])));
|
|
4285
|
+
}
|
|
4286
|
+
out.push('', c.dim('`sideby <command> --help` explains one; `sideby commands <words>` finds where a feature lives in the Panel. In the Panel: Commands, or press ?.'));
|
|
4287
|
+
io.out(out.join('\n'));
|
|
4288
|
+
return 0;
|
|
4289
|
+
}
|
|
4244
4290
|
export function cmdCommands(a, io) {
|
|
4245
4291
|
const query = a.positionals.join(' ').trim();
|
|
4246
4292
|
if (!query)
|
|
4247
|
-
|
|
4293
|
+
return listCommands(a, io);
|
|
4248
4294
|
const results = searchCatalog(query, SEARCH_CATALOG).map(({ entry }) => ({
|
|
4249
4295
|
id: entry.id,
|
|
4250
4296
|
kind: entry.kind,
|
|
@@ -881,6 +881,26 @@ export const OUTPUT_SCHEMAS = {
|
|
|
881
881
|
cliCommand: Type.Union([Str, Type.Null()]),
|
|
882
882
|
})),
|
|
883
883
|
}, { title: 'sideby commands --json' }),
|
|
884
|
+
'commands-list': Type.Object({
|
|
885
|
+
schemaVersion: Version,
|
|
886
|
+
common: Type.Array(Str, { description: 'Ids of the common commands, most common first.' }),
|
|
887
|
+
groups: Type.Array(Type.Object({
|
|
888
|
+
id: Type.String({ description: "A task group such as 'accounts' or 'quota'; an open set." }),
|
|
889
|
+
title: Str,
|
|
890
|
+
commands: Type.Array(Type.Object({
|
|
891
|
+
id: Type.String({ description: "Stable, such as 'run' or 'handoff.enable'." }),
|
|
892
|
+
usage: Type.String({ description: 'The command line as `sideby --help` shows it.' }),
|
|
893
|
+
description: Str,
|
|
894
|
+
example: Type.Union([Str, Type.Null()]),
|
|
895
|
+
featureId: Type.Union([Str, Type.Null()], {
|
|
896
|
+
description: 'The `sideby commands <words>` result id of its place in the Panel, or null.',
|
|
897
|
+
}),
|
|
898
|
+
panel: Type.Union([Str, Type.Null()], {
|
|
899
|
+
description: 'Where it lives in the Panel, such as "Settings → General → Language", or null.',
|
|
900
|
+
}),
|
|
901
|
+
})),
|
|
902
|
+
})),
|
|
903
|
+
}, { title: 'sideby commands --json (no words): the Command List' }),
|
|
884
904
|
'app-install': Type.Object({
|
|
885
905
|
schemaVersion: Version,
|
|
886
906
|
platform: AppPlatform,
|
package/dist/src/cli/main.js
CHANGED
|
@@ -4,157 +4,11 @@
|
|
|
4
4
|
import { realpathSync } from 'node:fs';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
6
|
const MIN_NODE = [22, 18];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sideby key <account> [--var <NAME>] enter an API key without echo
|
|
13
|
-
sideby try <account> [--model <m>] try the Host with a short paid request
|
|
14
|
-
sideby list accounts (same as \`sideby list\`)
|
|
15
|
-
sideby list --all also list hidden families and accounts
|
|
16
|
-
sideby run <account> [-- args] start the host CLI for one account
|
|
17
|
-
sideby new <family> <name>|--next [--api] [--alias <short>]
|
|
18
|
-
create an account (families: claude, codex, grok, pi);
|
|
19
|
-
--next picks the next name and short command (cc008);
|
|
20
|
-
--alias also adds a short command such as cc008
|
|
21
|
-
sideby pin|unpin <account|short command> [--json]
|
|
22
|
-
pin or unpin a Same Login (at most 3 per family)
|
|
23
|
-
sideby hide|unhide <family|account> [--json]
|
|
24
|
-
hide a family or an account from the Panel, menu bar and list
|
|
25
|
-
sideby order [--json] show display order, with pinned and hidden accounts marked
|
|
26
|
-
sideby order <family> <name>... set account order within a family
|
|
27
|
-
sideby order --families <id>... set family order
|
|
28
|
-
sideby order --reset restore default order, keeping pins and hidden ones
|
|
29
|
-
sideby quota check <family> on|off turn quota fetching on or off
|
|
30
|
-
sideby update --auto on|off set Auto Update without running an update
|
|
31
|
-
sideby update --skill [--yes] update only the installed sideby skill to this version
|
|
32
|
-
sideby commands <words> find where a page, setting or action lives in the Panel,
|
|
33
|
-
and the command that does the same (read-only)
|
|
34
|
-
sideby families [family] what each host's accounts share with the main account,
|
|
35
|
-
where they live and how they sign in
|
|
36
|
-
sideby alias add <short> <account> [-- args]
|
|
37
|
-
add a short command, optionally with host arguments
|
|
38
|
-
(sideby alias add pi-kimi pi:main -- --model kimi-coding/k3)
|
|
39
|
-
sideby alias add <short> --pick <family> [--yes]
|
|
40
|
-
add a pick command: each run starts the account with the
|
|
41
|
-
most quota left (sideby alias add cc --pick claude)
|
|
42
|
-
sideby alias rm <short> remove a short command
|
|
43
|
-
sideby alias list list short commands and pick commands
|
|
44
|
-
sideby login <account> sign in to an account
|
|
45
|
-
sideby resume <family> [-- args] run the host; a session resumed by id (claude --resume <id>,
|
|
46
|
-
codex resume <id>) starts in the account that holds it
|
|
47
|
-
sideby next <family> [--dry-run] [--include-api] [--ignore-network] [--unattended] [-- args]
|
|
48
|
-
recommend the account with the most quota left (claude, codex, grok)
|
|
49
|
-
and start it; --dry-run only recommends
|
|
50
|
-
sideby doctor [target] [--fix] [--force]
|
|
51
|
-
check shared items and permissions; --fix repairs safe issues
|
|
52
|
-
sideby quota [account|family] [--refresh]
|
|
53
|
-
quota and 7-day token usage; --refresh asks every fetching family again now
|
|
54
|
-
sideby quota setup claude [--yes] turn on Claude quota (shows the change first)
|
|
55
|
-
sideby quota teardown claude undo it, restoring the original file
|
|
56
|
-
sideby tune [account|family] estimate the cheapest auto-compact threshold per model
|
|
57
|
-
from your last 7 days of sessions (read-only)
|
|
58
|
-
sideby model <account> [<model>|default] [--effort <level>|default] [--yes]
|
|
59
|
-
show or set the model and effort sideby starts this account with
|
|
60
|
-
sideby remote-control [on|off|undo] [--yes]
|
|
61
|
-
whether Claude sessions connect to claude.ai by themselves;
|
|
62
|
-
off stops that for every account (shows the change first)
|
|
63
|
-
sideby handoff status what Auto Handoff still needs on this machine
|
|
64
|
-
sideby handoff rules every rule that decides when it hands over and to whom,
|
|
65
|
-
and where each account's work would go now
|
|
66
|
-
sideby handoff enable [--yes] turn it on (shows the config change first); --same-family,
|
|
67
|
-
--order claude=codex001,cc002, --threshold n, --prepare-at n,
|
|
68
|
-
--other-ai [--ai-order codex,grok], --api (billed per use)
|
|
69
|
-
sideby handoff disable [--yes] turn it off, keeping the other settings
|
|
70
|
-
sideby handoff ready [--brief <f>] inside a session sideby started with Auto Handoff: hand over to
|
|
71
|
-
the next account when this turn ends (config \`handoff\`);
|
|
72
|
-
--to <account> names it, also one this chain already used
|
|
73
|
-
sideby handoff setup grok [--yes] add sideby's hook file so Grok can hand over at its limit
|
|
74
|
-
sideby handoff teardown grok remove it
|
|
75
|
-
sideby ui [--port n] [--no-open] open the local panel
|
|
76
|
-
sideby ui --background same, without a terminal: keeps running after this command exits
|
|
77
|
-
sideby ui --stop stop the background panel
|
|
78
|
-
sideby desktop <account> open the desktop app (Claude Desktop, the Codex app) as this
|
|
79
|
-
account, next to the others (macOS)
|
|
80
|
-
sideby desktop grok-bot:<name> open a Grok Bot window, a new one for a new name (macOS)
|
|
81
|
-
sideby sessions [<account>|<family>] which session each account runs now, needing you first
|
|
82
|
-
sideby sessions copy <account|session-id> [--as reference|id|resume]
|
|
83
|
-
copy one for another AI: a reference to its record (default),
|
|
84
|
-
its id or its resume command
|
|
85
|
-
sideby sessions open-run <account|session-id>
|
|
86
|
-
open the run report of the dispatched task that session works for
|
|
87
|
-
sideby history [<words>...] find any past session of any account, by project, AI, time
|
|
88
|
-
or what was said (--project, --family, --account, --since,
|
|
89
|
-
--tools also searches tool output)
|
|
90
|
-
sideby history show <id> read one session; history projects lists the projects
|
|
91
|
-
sideby history index [--clear] the local search index: how far it is built, or delete it
|
|
92
|
-
sideby send <account|session> "<text>" [--image <path>]...
|
|
93
|
-
tell another session something (a screenshot too): Claude
|
|
94
|
-
sessions get it at once, others through a line you paste
|
|
95
|
-
sideby messages [--to <account|session>]
|
|
96
|
-
the messages you sent and whether each was delivered or read
|
|
97
|
-
sideby messages inbound [accept|undo] [--yes]
|
|
98
|
-
whether Claude sessions show messages from other sessions at once
|
|
99
|
-
sideby edit <account> [--path] open the account's own settings file (settings.json,
|
|
100
|
-
config.toml) in your editor
|
|
101
|
-
sideby network [check] stop Claude and Codex when requests would leave from a country
|
|
102
|
-
you did not allow (network on|off|allow <CC>... [--yes])
|
|
103
|
-
sideby unattended [on|off] nobody is here: sessions sideby starts do not stop to ask; on takes
|
|
104
|
-
--for 4h, --until 07:30 or --slot-end (schedule add|remove|preset weeknights,
|
|
105
|
-
pending [done <id>|--all], defer "<text>"); run --unattended for one session
|
|
106
|
-
sideby browser [--enable [--yes]] which Chrome browser user signed in to each account's website
|
|
107
|
-
(read on this computer only; off until you enable it)
|
|
108
|
-
sideby browser open <account> [--profile <name>]
|
|
109
|
-
open claude.ai, chatgpt.com or grok.com in that browser user
|
|
110
|
-
sideby browser set <account> <name> | --auto
|
|
111
|
-
choose that browser user yourself, or let sideby find it again
|
|
112
|
-
sideby app install [--url <url>] add a sideby app that opens the panel (macOS, Linux)
|
|
113
|
-
sideby app uninstall remove that app
|
|
114
|
-
sideby shell-init zsh|bash print shell functions, e.g. eval "$(sideby shell-init zsh)"
|
|
115
|
-
sideby shell-init [zsh|bash] --write
|
|
116
|
-
rewrite the config's shellInitFile with them
|
|
117
|
-
sideby shell-init setup [zsh|bash] [--yes|--undo]
|
|
118
|
-
make new terminals load your short commands: adds one line to
|
|
119
|
-
~/.zshrc (or ~/.bashrc), shown first; --undo takes it out
|
|
120
|
-
sideby plugins list loaded plugins and load errors
|
|
121
|
-
sideby plugins new <id> create a local Family Plugin skeleton
|
|
122
|
-
sideby plugins check <id|path> check a plugin and show fixes
|
|
123
|
-
sideby update [--yes] update sideby to the newest version (shows the command first)
|
|
124
|
-
sideby autostart [on|off] [--yes] start the panel in the background at login (macOS, Linux, WSL;
|
|
125
|
-
shows the file first)
|
|
126
|
-
sideby menubar [on|off] [--yes] show quota in the macOS menu bar; click an account to start it
|
|
127
|
-
sideby menubar hotkey [<keys>|off] show or change the shortcut that opens that menu (⌥X)
|
|
128
|
-
sideby theme [list] the Panel's Themes; use <name> switches, use --undo goes back, use default clears
|
|
129
|
-
sideby theme check|preview <name|file> contrast report, or one look in the Panel without switching
|
|
130
|
-
sideby theme import <file> | export <name> | remove <name> your own Themes (JSON, colors only)
|
|
131
|
-
sideby config get [<key>] every setting with its value and meaning, or one setting
|
|
132
|
-
sideby config set <key> <value> [--yes]
|
|
133
|
-
change any setting (sideby config set panel.theme dark)
|
|
134
|
-
sideby config unset <key> [--yes] back to the default
|
|
135
|
-
sideby local [on|off] [--yes] for sideby developers: switch the global sideby between the
|
|
136
|
-
last local build (pnpm local) and the npm package
|
|
137
|
-
|
|
138
|
-
Options:
|
|
139
|
-
--json machine-readable output (list, new, next, alias, doctor, quota, tune, model, remote-control, handoff,
|
|
140
|
-
families, commands, plugins, app, desktop, sessions, history, send, messages, edit, browser, update, local, ask,
|
|
141
|
-
terminal, key, try, autostart, menubar, config, network, unattended)
|
|
142
|
-
-h, --help show this help; \`sideby <command> --help\` for new, alias, login, doctor, families, commands, desktop, edit, browser,
|
|
143
|
-
autostart, menubar, config, sessions, history, send, messages, network, unattended
|
|
144
|
-
-v, --version show the version
|
|
145
|
-
|
|
146
|
-
An <account> is <family>:<name> (claude:work) or just <name> when it is unique.
|
|
147
|
-
|
|
148
|
-
For AI agents:
|
|
149
|
-
Add --json and read the result; JSON Schemas ship in the package under schemas/.
|
|
150
|
-
Install the skill: npx skills add Adonis0123/sideby -g
|
|
151
|
-
Setup steps and the full contract: https://github.com/Adonis0123/sideby/blob/main/llms.txt
|
|
152
|
-
Run everything else yourself, but hand the user these as one line each: \`sideby login <account>\`
|
|
153
|
-
(browser sign-in), filling in proxy.env, and \`sideby run\` or \`sideby next\` (interactive sessions).
|
|
154
|
-
Exit 10 means a change was shown: ask the user, then run it again with --yes.
|
|
155
|
-
|
|
156
|
-
Updates: once a day sideby asks the npm registry for its newest version and says so after a command.
|
|
157
|
-
Turn it off with NO_UPDATE_NOTIFIER=1 or config "update": { "check": false }; "auto": true installs by itself.`;
|
|
7
|
+
/** `sideby --help`, generated from the Command List (spec §3.38) so it never drifts from the Panel and `sideby commands`. */
|
|
8
|
+
async function generalHelp() {
|
|
9
|
+
const { cliHelp } = await import('../core/cli-commands.js');
|
|
10
|
+
return cliHelp();
|
|
11
|
+
}
|
|
158
12
|
/** `sideby <command> --help` for the commands agents use to set up and repair accounts (spec §3.16). */
|
|
159
13
|
const COMMAND_HELP = {
|
|
160
14
|
ask: 'sideby ask [<text>] [--task free|fix|quota|account|host|plugin|terminal|handoff|theme|menubar|hotkey|network] [--account <ref>] [--terminal <id>] [--attach <file>]... [--print] [--json]\nsideby ask --run <id> [--state-dir <dir>]\nsideby ask --spec - [--print] --json\nsideby ask --choices --json\nOpen a task in your terminal. --spec reads a Task Spec (one JSON object, at most 1 MB) from stdin, as a Portal sends it; --choices lists the accounts and terminals a task can use. --attach adds an image (PNG, JPEG, GIF, WebP; up to 20 MB) or a video (MP4, MOV, WebM; up to 200 MB), at most 5. --print prints only the prompt. If opening fails, paste the command into a terminal.',
|
|
@@ -537,17 +391,23 @@ Examples:
|
|
|
537
391
|
sideby browser set codex:main "Profile 7"
|
|
538
392
|
Exit: 0 shown, changed, chosen or opened; 1 not macOS, Chrome not installed, no or several browser users to choose from, or
|
|
539
393
|
Chrome did not open; 10 --enable/--disable without --yes; 2 malformed command line.`,
|
|
540
|
-
commands: `sideby commands
|
|
394
|
+
commands: `sideby commands [--json]
|
|
395
|
+
sideby commands <words>... [--json]
|
|
396
|
+
|
|
397
|
+
With no words: every command, grouped by task (Accounts, Start and open, Quota and usage, ...), the common ones first,
|
|
398
|
+
each with one line on what it does and an example. The Panel shows the same list under Commands (or press ?).
|
|
541
399
|
|
|
542
|
-
|
|
543
|
-
says where it lives in the Panel (Settings → General → Language) and the command that does the same,
|
|
544
|
-
one. The Panel's Search (Cmd/Ctrl+K) searches the same list. It finds features, not sessions: for those
|
|
545
|
-
\`sideby history <words>\`.
|
|
400
|
+
With words: find a feature of sideby by name, in English or Chinese: a page of the Panel, a setting or an action.
|
|
401
|
+
Each result says where it lives in the Panel (Settings → General → Language) and the command that does the same,
|
|
402
|
+
when there is one. The Panel's Search (Cmd/Ctrl+K) searches the same list. It finds features, not sessions: for those
|
|
403
|
+
use \`sideby history <words>\`.
|
|
546
404
|
|
|
547
405
|
Examples:
|
|
406
|
+
sideby commands
|
|
407
|
+
sideby commands --json
|
|
548
408
|
sideby commands language
|
|
549
409
|
sideby commands 深色 --json
|
|
550
|
-
Exit: 0, also when nothing matches; 2
|
|
410
|
+
Exit: 0, also when nothing matches; 2 malformed command line.`,
|
|
551
411
|
families: `sideby families [family] [--json]
|
|
552
412
|
|
|
553
413
|
For each host (built in or from a plugin): where its accounts live, the variable that selects one, how to sign
|
|
@@ -756,7 +616,7 @@ export async function main(argv) {
|
|
|
756
616
|
return 0;
|
|
757
617
|
}
|
|
758
618
|
if (first === '-h' || first === '--help' || first === 'help') {
|
|
759
|
-
console.log((rest[0] !== undefined && first === 'help' && COMMAND_HELP[rest[0]]) ||
|
|
619
|
+
console.log((rest[0] !== undefined && first === 'help' && COMMAND_HELP[rest[0]]) || (await generalHelp()));
|
|
760
620
|
return 0;
|
|
761
621
|
}
|
|
762
622
|
const cmd = first === undefined || first.startsWith('--') ? 'list' : first;
|
|
@@ -800,7 +660,7 @@ export async function main(argv) {
|
|
|
800
660
|
}
|
|
801
661
|
}
|
|
802
662
|
if (parsed.flags.has('help')) {
|
|
803
|
-
console.log(COMMAND_HELP[cmd] ??
|
|
663
|
+
console.log(COMMAND_HELP[cmd] ?? (await generalHelp()));
|
|
804
664
|
return 0;
|
|
805
665
|
}
|
|
806
666
|
// parseArgs keeps the last value of an option; `ask --attach` may be given several times.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Words } from './search-catalog.ts';
|
|
2
|
+
export type CommandGroupId = 'accounts' | 'start' | 'shortcuts' | 'quota' | 'handoff' | 'sessions' | 'health' | 'panel' | 'settings' | 'help';
|
|
3
|
+
export interface CommandGroup {
|
|
4
|
+
id: CommandGroupId;
|
|
5
|
+
title: Words;
|
|
6
|
+
}
|
|
7
|
+
export interface CliCommand {
|
|
8
|
+
/** Stable: `sideby commands --json` and the Panel name it. */
|
|
9
|
+
id: string;
|
|
10
|
+
group: CommandGroupId;
|
|
11
|
+
/** The command line as `sideby --help` shows it. */
|
|
12
|
+
usage: string;
|
|
13
|
+
/** What `sideby --help` prints next to it, in English; it may name more options than `summary`. */
|
|
14
|
+
help: string;
|
|
15
|
+
/** One line for the Command List. */
|
|
16
|
+
summary: Words;
|
|
17
|
+
/** A line that runs as it is, with the demo names (`claude:work`, `cc008`). */
|
|
18
|
+
example?: string;
|
|
19
|
+
/** Its place in the "Common" group, 1 first. */
|
|
20
|
+
common?: number;
|
|
21
|
+
/** The Search Catalog id of its place in the Panel, for "Open in Panel". */
|
|
22
|
+
feature?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Task groups, in the order `sideby --help`, `sideby commands` and the Panel show them. */
|
|
25
|
+
export declare const COMMAND_GROUPS: readonly CommandGroup[];
|
|
26
|
+
export declare const CLI_COMMANDS: readonly CliCommand[];
|
|
27
|
+
/** The common commands, in the order the "Common" group shows them. */
|
|
28
|
+
export declare function commonCommands(list?: readonly CliCommand[]): CliCommand[];
|
|
29
|
+
/** The commands `main.ts` dispatches for a usage line: `run`; `pin` and `unpin` for `pin|unpin`; `list` for `sideby`. */
|
|
30
|
+
export declare function commandWords(usage: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Commands matching `query`, in catalog order. Every word of the query must appear in the usage, the example, the
|
|
33
|
+
* description in either language or the group's title; an empty query matches everything. Runs in the Panel too.
|
|
34
|
+
*/
|
|
35
|
+
export declare function filterCommands<T extends {
|
|
36
|
+
usage: string;
|
|
37
|
+
group: string;
|
|
38
|
+
summary: {
|
|
39
|
+
en: string;
|
|
40
|
+
zh: string;
|
|
41
|
+
};
|
|
42
|
+
example?: string;
|
|
43
|
+
}>(query: string, list: readonly T[], groups: readonly {
|
|
44
|
+
id: string;
|
|
45
|
+
title: {
|
|
46
|
+
en: string;
|
|
47
|
+
zh: string;
|
|
48
|
+
};
|
|
49
|
+
}[]): readonly T[];
|
|
50
|
+
/** `sideby --help`: the commands grouped by task, from the Command List, then the options and the notes. */
|
|
51
|
+
export declare function cliHelp(list?: readonly CliCommand[]): string;
|
|
52
|
+
/** What the Panel embeds: everything but the `--help` text, which only the terminal shows. */
|
|
53
|
+
export declare function commandListForPage(): {
|
|
54
|
+
groups: readonly CommandGroup[];
|
|
55
|
+
commands: Omit<CliCommand, 'help'>[];
|
|
56
|
+
};
|