sideby 0.18.0 → 0.19.0
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/README.md +8 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.js +159 -13
- package/dist/src/cli/json-schemas.js +39 -1
- package/dist/src/cli/main.js +23 -6
- package/dist/src/core/ask.d.ts +14 -0
- package/dist/src/core/ask.js +16 -1
- package/dist/src/core/browser-profiles.js +7 -32
- package/dist/src/core/config.d.ts +14 -0
- package/dist/src/core/config.js +64 -1
- package/dist/src/core/pick-commands.d.ts +42 -0
- package/dist/src/core/pick-commands.js +44 -0
- package/dist/src/core/shell-init.js +3 -1
- package/dist/src/core/shell-setup.d.ts +40 -0
- package/dist/src/core/shell-setup.js +54 -0
- package/dist/src/core/skill-check.d.ts +2 -0
- package/dist/src/core/skill-check.js +2 -0
- package/dist/src/core/terminal.d.ts +21 -4
- package/dist/src/core/terminal.js +149 -9
- package/dist/src/core/update.js +2 -2
- package/dist/src/core/windows-dirs.d.ts +19 -0
- package/dist/src/core/windows-dirs.js +39 -0
- package/dist/src/panel/handler.d.ts +18 -0
- package/dist/src/panel/handler.js +69 -1
- package/dist/src/panel/i18n.d.ts +39 -0
- package/dist/src/panel/i18n.js +78 -0
- package/dist/src/panel/page-script.js +182 -3
- package/dist/src/panel/page-styles.js +3 -0
- package/dist/src/panel/page.js +6 -1
- package/dist/src/runtime.d.ts +35 -1
- package/dist/src/runtime.js +96 -3
- package/package.json +2 -2
- package/schemas/alias-list.json +119 -0
- package/schemas/alias.json +27 -1
- package/schemas/config.json +11 -0
- package/schemas/new.json +19 -0
- package/schemas/shell-init-setup.json +124 -0
- package/skills/sideby/SKILL.md +6 -3
- package/skills/sideby/references/accounts.md +10 -0
- package/skills/sideby/references/setup.md +1 -1
package/dist/src/runtime.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { type HandoffDecision } from './core/handoff-select.ts';
|
|
|
9
9
|
import { type DoctorHistory } from './core/last-doctor.ts';
|
|
10
10
|
import { type HostLaunch, type PreparedLaunch } from './core/launch.ts';
|
|
11
11
|
import { type Paths } from './core/paths.ts';
|
|
12
|
+
import { type PickChoice } from './core/pick-commands.ts';
|
|
12
13
|
import { type QuotaFetchMode } from './core/quota-fetch.ts';
|
|
13
14
|
import { type RemoteControlChange, type RemoteControlGroup } from './core/remote-control.ts';
|
|
14
15
|
import { type Shell, type ShellInitWrite } from './core/shell-init.ts';
|
|
@@ -41,9 +42,16 @@ export interface AliasResult {
|
|
|
41
42
|
export interface AliasEditResult {
|
|
42
43
|
ok: boolean;
|
|
43
44
|
alias: string;
|
|
44
|
-
|
|
45
|
+
/** `confirm`: a Pick Command would hide a command on PATH, so nothing was written until the user agrees. */
|
|
46
|
+
status: 'added' | 'exists' | 'removed' | 'absent' | 'confirm';
|
|
47
|
+
/** `pick` for a Pick Command, `account` for an Alias; absent for `absent`. */
|
|
48
|
+
kind?: 'account' | 'pick';
|
|
45
49
|
/** The Account ref the alias starts (for `rm`, started before it was removed). */
|
|
46
50
|
account?: string;
|
|
51
|
+
/** The Family a Pick Command picks in. */
|
|
52
|
+
family?: string;
|
|
53
|
+
/** The command on PATH a Pick Command of this name hides in the shell (`/usr/bin/cc`). */
|
|
54
|
+
shadows?: string;
|
|
47
55
|
/** Host arguments the alias adds to `sideby run`; absent when there are none. */
|
|
48
56
|
args?: string[];
|
|
49
57
|
/** One entry per file in config `shellInitFile`; absent when none is configured. */
|
|
@@ -198,6 +206,32 @@ export interface Runtime {
|
|
|
198
206
|
addAlias(alias: string, target: string, args?: readonly string[]): Promise<AliasEditResult>;
|
|
199
207
|
/** Removes a short command from the config, then rewrites every `shellInitFile`. */
|
|
200
208
|
removeAlias(alias: string): Promise<AliasEditResult>;
|
|
209
|
+
/**
|
|
210
|
+
* Adds a Pick Command (spec §3.13, ADR-0035), then rewrites every `shellInitFile`. Without `opts.yes` it only
|
|
211
|
+
* returns `confirm`, with the command on PATH the name would hide, and writes nothing. Refuses a name taken by an
|
|
212
|
+
* Alias or another Family.
|
|
213
|
+
*/
|
|
214
|
+
addPickCommand(name: string, family: string, opts?: {
|
|
215
|
+
yes?: boolean;
|
|
216
|
+
}): Promise<AliasEditResult>;
|
|
217
|
+
/** The Family a Pick Command picks in, or undefined when `name` is not one. */
|
|
218
|
+
pickCommandFamily(name: string): string | undefined;
|
|
219
|
+
/** The Account the Pick Command `name` starts now, or why it starts nothing (ADR-0035). */
|
|
220
|
+
pickChoice(name: string): Promise<{
|
|
221
|
+
name: string;
|
|
222
|
+
family: string;
|
|
223
|
+
choice: PickChoice;
|
|
224
|
+
}>;
|
|
225
|
+
/**
|
|
226
|
+
* The Pick Command to offer for a Family: the existing one, else a free name following its Aliases (or cc, cx, gk),
|
|
227
|
+
* with the command on PATH it would hide, or `name: null` when no such name is free (the user types one); null when
|
|
228
|
+
* the Family has fewer than two Subscription Accounts. `all` saves discovering the Accounts again.
|
|
229
|
+
*/
|
|
230
|
+
pickSuggestion(family: string, all?: readonly Account[]): Promise<{
|
|
231
|
+
name: string | null;
|
|
232
|
+
exists: boolean;
|
|
233
|
+
shadows?: string;
|
|
234
|
+
} | null>;
|
|
201
235
|
/** Why `alias` cannot start `ref` (shell-safe, not reserved, not taken by another Account), or null. */
|
|
202
236
|
aliasProblem(alias: string, ref: string): string | null;
|
|
203
237
|
/** What `sideby shell-init <shell>` prints, from the Accounts on disk and the config aliases. */
|
package/dist/src/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The one service layer the CLI and the Panel share. Frozen contract for v0.1 (plan: 审核修订).
|
|
2
2
|
import { aliasesByAccount, discoverAccounts, resolveRef } from './core/accounts.js';
|
|
3
|
-
import { addConfigAlias, aliasAccount, aliasArgs, aliasProblem, aliasRefs, editConfigDisplay, editConfigQuotaCheck, handoffSettings, loadConfig, removeConfigAlias, } from './core/config.js';
|
|
3
|
+
import { addConfigAlias, addConfigPickCommand, aliasAccount, aliasArgs, aliasProblem, aliasRefs, editConfigDisplay, editConfigQuotaCheck, handoffSettings, loadConfig, removeConfigAlias, removeConfigPickCommand, } from './core/config.js';
|
|
4
4
|
import { createAccount } from './core/create.js';
|
|
5
5
|
import { bindDesktopDeps, checkAppData } from './core/desktop-app.js';
|
|
6
6
|
import { applyFixes, runDoctor } from './core/doctor.js';
|
|
@@ -14,6 +14,7 @@ import { mergeDoctorHistory, readDoctorHistory, writeDoctorHistory, } from './co
|
|
|
14
14
|
import { accountEnv, brokenOnPath, launchCommand, prepareLaunch, which, } from './core/launch.js';
|
|
15
15
|
import { memoStore } from './core/memo-store.js';
|
|
16
16
|
import { resolvePaths } from './core/paths.js';
|
|
17
|
+
import { choosePick, suggestPickName } from './core/pick-commands.js';
|
|
17
18
|
import { fetchedQuota, quotaCheckOff, shownQuota } from './core/quota-fetch.js';
|
|
18
19
|
import { remoteControlGroups, turnRemoteControlOff, turnRemoteControlOn, undoRemoteControlOff, } from './core/remote-control.js';
|
|
19
20
|
import { findResumeRoute } from './core/resume.js';
|
|
@@ -244,7 +245,7 @@ export async function createRuntime(opts = {}) {
|
|
|
244
245
|
ok: files.every((f) => f.ok),
|
|
245
246
|
alias,
|
|
246
247
|
status,
|
|
247
|
-
...(value === undefined ? {} : { account: aliasAccount(value) }),
|
|
248
|
+
...(value === undefined ? {} : { kind: 'account', account: aliasAccount(value) }),
|
|
248
249
|
...(args.length ? { args } : {}),
|
|
249
250
|
...(files.length ? { shellInitFiles: files } : {}),
|
|
250
251
|
};
|
|
@@ -468,6 +469,8 @@ export async function createRuntime(opts = {}) {
|
|
|
468
469
|
const bad = aliasProblem(alias);
|
|
469
470
|
if (bad)
|
|
470
471
|
throw new UserError(`alias "${alias}" ${bad} (it becomes a shell function name)`);
|
|
472
|
+
if (rt.pickCommandFamily(alias) !== undefined)
|
|
473
|
+
throw new UserError(`"${alias}" is already a pick command; pick another name, or remove it first with \`sideby alias rm ${alias}\``, { code: 'alias-invalid' });
|
|
471
474
|
// Resolve first so the config only ever names an Account that exists, by its ref.
|
|
472
475
|
const account = resolveRef(target, await accounts(), aliasRefs(config.aliases));
|
|
473
476
|
const r = await addConfigAlias(paths.configFile, alias, account.ref, args);
|
|
@@ -475,15 +478,98 @@ export async function createRuntime(opts = {}) {
|
|
|
475
478
|
return aliasEdit(alias, r.status, r.aliases[alias]);
|
|
476
479
|
},
|
|
477
480
|
async removeAlias(alias) {
|
|
481
|
+
const pickFamily = rt.pickCommandFamily(alias);
|
|
482
|
+
if (pickFamily !== undefined) {
|
|
483
|
+
const r = await removeConfigPickCommand(paths.configFile, alias);
|
|
484
|
+
config.pickCommands = Object.keys(r.pickCommands).length ? r.pickCommands : undefined;
|
|
485
|
+
const files = await rt.writeShellInitFiles();
|
|
486
|
+
return {
|
|
487
|
+
ok: files.every((f) => f.ok),
|
|
488
|
+
alias,
|
|
489
|
+
status: r.status,
|
|
490
|
+
...(r.status === 'removed' ? { kind: 'pick', family: pickFamily } : {}),
|
|
491
|
+
...(files.length ? { shellInitFiles: files } : {}),
|
|
492
|
+
};
|
|
493
|
+
}
|
|
478
494
|
const before = ownAlias(alias);
|
|
479
495
|
const r = await removeConfigAlias(paths.configFile, alias);
|
|
480
496
|
config.aliases = r.aliases;
|
|
481
497
|
return aliasEdit(alias, r.status, r.status === 'removed' ? before : undefined);
|
|
482
498
|
},
|
|
499
|
+
async addPickCommand(name, familyId, o = {}) {
|
|
500
|
+
const f = familyOf(familyId);
|
|
501
|
+
const bad = aliasProblem(name);
|
|
502
|
+
if (bad)
|
|
503
|
+
throw new UserError(`"${name}" ${bad} (it becomes a shell function name)`, { code: 'alias-invalid' });
|
|
504
|
+
const taken = ownAlias(name);
|
|
505
|
+
if (taken !== undefined)
|
|
506
|
+
throw new UserError(`"${name}" already starts ${aliasAccount(taken)}; pick another name, or remove it first with \`sideby alias rm ${name}\``, { code: 'alias-invalid' });
|
|
507
|
+
if (name === f.bin)
|
|
508
|
+
throw new UserError(`"${name}" is the ${f.title} command itself; pick another name`, {
|
|
509
|
+
code: 'alias-invalid',
|
|
510
|
+
});
|
|
511
|
+
const same = rt.pickCommandFamily(name) === f.id;
|
|
512
|
+
const shadows = same ? null : await which(name, env);
|
|
513
|
+
const base = { alias: name, kind: 'pick', family: f.id, ...(shadows ? { shadows } : {}) };
|
|
514
|
+
// A preview first, as for every change sideby offers (spec §3.13): it writes only with `yes`.
|
|
515
|
+
if (!same && !o.yes)
|
|
516
|
+
return { ok: true, status: 'confirm', ...base };
|
|
517
|
+
const r = await addConfigPickCommand(paths.configFile, name, f.id);
|
|
518
|
+
config.pickCommands = r.pickCommands;
|
|
519
|
+
const files = await rt.writeShellInitFiles();
|
|
520
|
+
return {
|
|
521
|
+
ok: files.every((f) => f.ok),
|
|
522
|
+
status: r.status,
|
|
523
|
+
...base,
|
|
524
|
+
...(files.length ? { shellInitFiles: files } : {}),
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
pickCommandFamily(name) {
|
|
528
|
+
return config.pickCommands && Object.hasOwn(config.pickCommands, name)
|
|
529
|
+
? config.pickCommands[name]
|
|
530
|
+
: undefined;
|
|
531
|
+
},
|
|
532
|
+
async pickChoice(name) {
|
|
533
|
+
const family = rt.pickCommandFamily(name);
|
|
534
|
+
if (family === undefined)
|
|
535
|
+
throw new UserError(`no pick command "${name}"; add one with \`sideby alias add ${name} --pick <family>\``);
|
|
536
|
+
const f = familyOf(family);
|
|
537
|
+
// API Accounts are never picked, also not as the fallback (ADR-0035).
|
|
538
|
+
const subs = (await accounts()).filter((a) => a.family === f.id && a.kind !== 'api');
|
|
539
|
+
if (!subs.length)
|
|
540
|
+
throw new UserError(`no ${f.title} subscription accounts yet; create one with \`sideby new ${f.id} --next\``, { code: 'no-accounts' });
|
|
541
|
+
const main = subs.find((a) => a.isMain)?.ref ?? null;
|
|
542
|
+
if (!f.readQuota && !f.fetchQuota)
|
|
543
|
+
return { name, family, choice: { ref: main ?? subs[0].ref, reason: 'no-quota-data' } };
|
|
544
|
+
return { name, family, choice: choosePick(await rt.handoff(f.id), main) };
|
|
545
|
+
},
|
|
546
|
+
async pickSuggestion(familyId, given) {
|
|
547
|
+
const f = families.get(familyId);
|
|
548
|
+
if (!f)
|
|
549
|
+
return null;
|
|
550
|
+
const existing = Object.entries(config.pickCommands ?? {}).find(([, fam]) => fam === f.id);
|
|
551
|
+
if (existing)
|
|
552
|
+
return { name: existing[0], exists: true };
|
|
553
|
+
const all = given ?? (await accounts());
|
|
554
|
+
if (all.filter((a) => a.family === f.id && a.kind !== 'api').length < 2)
|
|
555
|
+
return null;
|
|
556
|
+
const familyAliases = aliasesByAccount(aliasRefs(config.aliases), all);
|
|
557
|
+
const names = all.filter((a) => a.family === f.id).flatMap((a) => familyAliases.get(a.ref) ?? []);
|
|
558
|
+
const name = suggestPickName(f.id, f.bin, names);
|
|
559
|
+
if (!name ||
|
|
560
|
+
aliasProblem(name) ||
|
|
561
|
+
ownAlias(name) !== undefined ||
|
|
562
|
+
rt.pickCommandFamily(name) !== undefined)
|
|
563
|
+
return { name: null, exists: false };
|
|
564
|
+
const shadows = await which(name, env);
|
|
565
|
+
return { name, exists: false, ...(shadows ? { shadows } : {}) };
|
|
566
|
+
},
|
|
483
567
|
aliasProblem(alias, ref) {
|
|
484
568
|
const bad = aliasProblem(alias);
|
|
485
569
|
if (bad)
|
|
486
570
|
return `alias "${alias}" ${bad} (it becomes a shell function name)`;
|
|
571
|
+
if (rt.pickCommandFamily(alias) !== undefined)
|
|
572
|
+
return `"${alias}" is already a pick command; pick another name`;
|
|
487
573
|
const value = ownAlias(alias);
|
|
488
574
|
const taken = value === undefined ? undefined : aliasAccount(value);
|
|
489
575
|
if (taken !== undefined && taken !== ref)
|
|
@@ -498,9 +584,16 @@ export async function createRuntime(opts = {}) {
|
|
|
498
584
|
.filter((f) => f.resumedSession && f.sessionWrittenAt && list.some((a) => a.family === f.id && !a.isMain))
|
|
499
585
|
.map((f) => ({ family: f.id, bin: f.bin, selectVar: f.selectVar }))
|
|
500
586
|
: [];
|
|
501
|
-
return shellInitScript(list, config.aliases, routes);
|
|
587
|
+
return shellInitScript(list, { ...config.aliases, ...config.pickCommands }, routes);
|
|
502
588
|
},
|
|
503
589
|
async writeShellInitFiles(shells = SHELLS) {
|
|
590
|
+
// Another process may have changed the other kind of short command since this Runtime read the config: write
|
|
591
|
+
// what the file holds now, so a rewrite never drops one.
|
|
592
|
+
const fresh = await loadConfig(paths.configFile).catch(() => null);
|
|
593
|
+
if (fresh) {
|
|
594
|
+
config.aliases = fresh.aliases;
|
|
595
|
+
config.pickCommands = fresh.pickCommands;
|
|
596
|
+
}
|
|
504
597
|
const out = [];
|
|
505
598
|
for (const shell of shells) {
|
|
506
599
|
const file = config.shellInitFile?.[shell];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sideby",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Run work, personal and API-key accounts at the same time, without their configs drifting apart.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Adonis0123 (https://github.com/Adonis0123)",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
},
|
|
82
82
|
"packageManager": "pnpm@10.15.0",
|
|
83
83
|
"readmeFilename": "README.md",
|
|
84
|
-
"readme": "<p align=\"center\">\n <img alt=\"sideby: work, personal and API-key accounts, one terminal each, one shared config\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/banner.jpg\" width=\"880\">\n</p>\n\n<p align=\"center\">\n <b>Run work, personal and API-key accounts at the same time, without their configs drifting apart.</b><br>\n Each account is its own directory and its own terminal. Skills, hooks and settings stay linked to your main account. Claude Code, Codex, Grok Build and pi.\n</p>\n\n<p align=\"center\">\n <a href=\"https://www.npmjs.com/package/sideby\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/sideby\"></a>\n <a href=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml\"><img alt=\"CI\" src=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml/badge.svg\"></a>\n <img alt=\"Node 22.18+\" src=\"https://img.shields.io/badge/node-%E2%89%A522.18-339933\">\n <a href=\"LICENSE\"><img alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue\"></a>\n</p>\n\n<p align=\"center\">English | <a href=\"README.zh-CN.md\">中文</a></p>\n\n## Quick start\n\nRequires Node 22.18+ and at least one Host CLI (Claude Code, Codex, Grok Build or pi) installed. AI agents: follow the setup steps in [`llms.txt`](llms.txt) (\"Set up sideby for a user\") instead.\n\n```sh\nnpm i -g sideby\nsideby new claude work # create ~/.claude-work, sharing ~/.claude's skills and hooks\nsideby login claude:work # sign in once\nsideby run work # Claude Code on the work account\nsideby quota setup claude --yes # Claude quota in the panel; undo: sideby quota teardown claude\nsideby ui --background # every account's quota at http://127.0.0.1:17420, still there after you close the terminal\n```\n\n`sideby app install` adds a Dock icon that opens the panel, and `sideby autostart on` has it ready each time you log in. `sideby update` installs a newer sideby when there is one; sideby says so after a command and in the panel. `sideby run claude:main` keeps using `~/.claude` in another terminal at the same time. Arguments after `--` go to the Host: `sideby run work -- --resume`. To try it without installing, run `npx sideby`.\n\n## Set up with your AI agent\n\nPaste this into Claude Code, Codex or any coding agent:\n\n```text\nInstall the sideby CLI (npm package `sideby`) and its agent skill, then set up a second Claude Code account for me.\nFollow \"Set up sideby for a user\" in https://raw.githubusercontent.com/Adonis0123/sideby/main/llms.txt\n```\n\nThe agent checks Node and your Host CLIs, installs sideby and the skill, creates the account, tells you what it shares with your main one and makes its short command work. You sign in once in your browser; the agent gives you that one command. Once the skill is installed, short requests work too: \"add another Claude account, cc008\", \"what do my Codex accounts share?\", \"which account still has quota?\".\n\n## What it looks like\n\nThe 25-second story: one account buried in tasks, then accounts side by side sharing one setup, and a task moving on when one runs out.\n\nhttps://github.com/user-attachments/assets/d1d7e8dd-1df1-4881-ac88-e468c2dd4a1d\n\n<img alt=\"Two terminals: the personal account and the work account running at the same time, both linked to the main account's skills and settings, then the local quota panel, and at 95% Auto Handoff moving work's session to the next account\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/demo.gif\" width=\"1280\">\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\">\n <img alt=\"sideby panel: every account's 5h and 7d quota, 7-day token usage and health in one page\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\" width=\"1280\">\n</picture>\n\n## Why not just an alias?\n\n`CLAUDE_CONFIG_DIR` plus a shell alias already starts a second account. It does not keep skills and settings in one place, and it does not show quota for every account. [Does this break a provider's terms?](docs/guide/faq.md#terms)\n\n| | At the same time | Skills, hooks, settings | Quota and usage | Setup |\n|---|---|---|---|---|\n| `CLAUDE_CONFIG_DIR` and an alias | Yes. Each terminal exports the variable. | Each directory is its own copy. They drift unless you symlink by hand. | That session's status line | One alias per account |\n| [cc-switch](https://github.com/farion1231/cc-switch) | Enabling a provider writes the host's live config, so open sessions share that switch. | Plugin settings are copied across providers as a separate step. | The active provider, from its quota endpoint | Install the desktop app |\n| sideby | Yes. `sideby run` selects the directory for that process and leaves your shell alone. | Linked to the main account. `sideby doctor --fix` repairs copies. Sign-in and sessions stay separate. | Every account, from local files. Claude needs `quota setup`. | `npm i -g sideby`, then `sideby new` and sign in |\n\ncc-switch's docs describe that switch: it writes the live settings file ([README](https://github.com/farion1231/cc-switch#readme)). [#1105](https://github.com/farion1231/cc-switch/issues/1105) and [#2908](https://github.com/farion1231/cc-switch/issues/2908) ask for several sessions at once. [#1106](https://github.com/farion1231/cc-switch/issues/1106) is closed; the maintainer says Claude Code's \"open terminal\" can start one provider without changing the global config.\n\n## What else it does\n\n| You want to | Run | Guide |\n|---|---|---|\n| Hand a task to your own AI from the panel: set up an account, fix a problem, support a new tool | **Let AI do it** in the panel, or `sideby ask` | [Let AI do it](docs/guide/panel.md#let-ai-do-it) |\n| See quota at a glance in the macOS menu bar | **Settings › Startup** in the panel, or `sideby menubar on` | [Quota in the menu bar](docs/guide/usage.md#quota-in-the-menu-bar) |\n| Have the panel ready in the background whenever you log in | **Settings › Startup** in the panel, or `sideby autostart on` | [Start at login](docs/guide/usage.md#start-at-login) |\n| Add an API key account (DeepSeek, a gateway, …) | `sideby new claude deepseek --api` | [API accounts](docs/guide/usage.md#api-accounts) |\n| Find and fix config drift between accounts | `sideby doctor --fix` | [Doctor](docs/guide/usage.md#doctor) |\n| See Claude quota (Codex needs no setup) | `sideby quota setup claude --yes` | [Claude quota](docs/guide/usage.md#claude-quota) |\n| Find the cheapest auto-compact size from your own sessions, and use it in one click | `sideby tune` (or the panel's Context tuning tab) | [Context tuning](docs/guide/usage.md#context-tuning) |\n| See each account's model and effort, and set them per account | `sideby model <account>` (or click the model in the panel) | [Model and effort](docs/guide/usage.md#model-and-effort) |\n| Choose whether Claude sessions connect to claude.ai by themselves (Remote Control), for every account at once | `sideby remote-control off` or `on` (or the panel's Settings) | [Remote Control](docs/guide/usage.md#remote-control) |\n| Pin the accounts you use most and put tools and accounts in your own order | `sideby pin claude:work`, `sideby order` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Move on when an account hits its limit | `sideby next claude` | [Handoff](docs/guide/usage.md#when-an-account-hits-its-limit) |\n| Let a running task move to the next account by itself when quota runs low (off by default; see the risk) | `sideby handoff enable` (or the panel) | [Auto Handoff](docs/guide/usage.md#auto-handoff) |\n| Short commands such as `ccw` | `sideby alias add ccw claude:work` | [Shell functions](docs/guide/configuration.md#shell-functions) |\n| Reopen a session from Orca and the like in the account that holds it | `\"resumeRouting\": true` in config | [Resuming from other tools](docs/guide/configuration.md#resuming-from-other-tools) |\n| Open Claude Desktop or the Codex app as one account, several side by side (macOS) | `sideby desktop claude:work` (or the panel) | [Desktop apps](docs/guide/usage.md#desktop-apps) |\n| Keep several Grok Bot windows open, each signed in to its own account (macOS) | `sideby desktop grok-bot:002` (or the panel) | [Grok Bot windows](docs/guide/usage.md#grok-bot-windows) |\n| Open the panel from the Dock or app menu | `sideby app install` | [Panel app](docs/guide/panel.md#panel-app) |\n| Show the panel inside your own local page | `createPanelHandler()` | [Embed the panel](docs/guide/panel.md#embed-the-panel) |\n| Add a Host or a pre-launch check | a local plugin | [Plugins](docs/guide/plugins.md) |\n\n## Supported hosts\n\n| Host | Account directories | Sign-in | Quota | Usage (7 days) |\n|---|---|---|---|---|\n| Claude Code | `~/.claude`, `~/.claude-<name>` | `claude auth login` | ✓ after `quota setup claude` | ✓ |\n| Codex CLI | `~/.codex`, `~/.codex-<name>` | `codex login` | ✓ | ✓ |\n| Grok Build | `~/.grok`, `~/.grok-<name>` | `grok login` | weekly, asked from the `grok` CLI | no public source |\n| pi | `~/.pi/agent`, `~/.pi-<name>/agent` | `/login` inside pi | no public source | no public source |\n\nsideby starts the official binary on your `PATH` and never patches it. Tested versions and per-Host notes are in the [guide](docs/guide/usage.md#host-notes).\n\n## Platforms\n\nmacOS and Linux. CI runs the suite on `ubuntu-latest` and `macos-latest`, Node 22 and 24. **Windows is untested.** `sideby app` only installs a launcher on macOS and Linux. Linked items are symlinks, `sideby shell-init` prints bash and zsh functions, and the Claude quota wrapper runs `/bin/sh`.\n\n## Roadmap\n\n**Gemini CLI.** Gemini can point at another config directory with `GEMINI_CONFIG_DIR`. Older docs use `GEMINI_CLI_HOME`; current builds treat that name as deprecated, and exit on startup if it is set together with an exact directory override. A sideby family still needs a tested Gemini version, a login check that does not read tokens, and a list of which files to link or copy. That is more than a small patch, so it is not in this version.\n\n## Safe by design\n\n- It never edits a Host's global config to switch accounts. It moves a task to another account only when you turn on Auto Handoff, and never proxies requests or pools logins.\n- It never reads, prints or sends a credential value. Nothing about your accounts leaves your machine: the only request sideby makes on its own is a daily check of the npm registry for its newest version (off with `NO_UPDATE_NOTIFIER=1`; see [Updates](docs/guide/configuration.md#updates)).\n- `doctor --fix` never replaces a real file and never changes where a link points.\n- The panel answers only on `127.0.0.1` and refuses web pages from other sites, but it trusts every user of this computer. On a shared Mac, do not leave it running in the background ([details](docs/guide/panel.md#who-can-reach-the-panel)).\n\nDetails and the terms-of-service question are in the [FAQ](docs/guide/faq.md).\n\nUsage questions and ideas go in [Discussions](https://github.com/Adonis0123/sideby/discussions).\n\n## Docs\n\n- [Using sideby](docs/guide/usage.md): accounts, API accounts, Doctor, quota, Handoff, Host notes\n- [Commands](docs/guide/commands.md): every command, exit codes and `--json`\n- [Configuration](docs/guide/configuration.md): `config.json`, aliases, shell functions\n- [Panel](docs/guide/panel.md): the panel, panel app and embedding\n- [Plugins](docs/guide/plugins.md): write your own Family or launch hook\n- [FAQ](docs/guide/faq.md): terms of service, data locations, alternatives, uninstall\n- [Changelog](https://github.com/Adonis0123/sideby/releases)\n\n## For AI agents\n\n- [`llms.txt`](llms.txt): setup steps, commands, JSON contract and plugin API in one index. `sideby families --json` states what each Host's accounts share.\n- [`skills/sideby/SKILL.md`](skills/sideby/SKILL.md): one Agent Skill for seeing, repairing and creating accounts and for moving on when one hits its limit. Install with `npx skills add Adonis0123/sideby -g`; `sideby doctor` warns when the installed copy is for another sideby version.\n- [`AGENTS.md`](AGENTS.md): rules for agents working on this repository.\n\n## License\n\n[MIT](LICENSE)\n"
|
|
84
|
+
"readme": "<p align=\"center\">\n <img alt=\"sideby: work, personal and API-key accounts, one terminal each, one shared config\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/banner.jpg\" width=\"880\">\n</p>\n\n<p align=\"center\">\n <b>Run work, personal and API-key accounts at the same time, without their configs drifting apart.</b><br>\n Each account is its own directory and its own terminal. Skills, hooks and settings stay linked to your main account. Claude Code, Codex, Grok Build and pi.\n</p>\n\n<p align=\"center\">\n <a href=\"https://www.npmjs.com/package/sideby\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/sideby\"></a>\n <a href=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml\"><img alt=\"CI\" src=\"https://github.com/Adonis0123/sideby/actions/workflows/ci.yml/badge.svg\"></a>\n <img alt=\"Node 22.18+\" src=\"https://img.shields.io/badge/node-%E2%89%A522.18-339933\">\n <a href=\"LICENSE\"><img alt=\"MIT\" src=\"https://img.shields.io/badge/license-MIT-blue\"></a>\n</p>\n\n<p align=\"center\">English | <a href=\"README.zh-CN.md\">中文</a></p>\n\n## Quick start\n\nRequires Node 22.18+ and at least one Host CLI (Claude Code, Codex, Grok Build or pi) installed. AI agents: follow the setup steps in [`llms.txt`](llms.txt) (\"Set up sideby for a user\") instead.\n\n```sh\nnpm i -g sideby\nsideby new claude work # create ~/.claude-work, sharing ~/.claude's skills and hooks\nsideby login claude:work # sign in once\nsideby run work # Claude Code on the work account\nsideby quota setup claude --yes # Claude quota in the panel; undo: sideby quota teardown claude\nsideby ui --background # every account's quota at http://127.0.0.1:17420, still there after you close the terminal\n```\n\n`sideby app install` adds a Dock icon that opens the panel, and `sideby autostart on` has it ready each time you log in. `sideby update` installs a newer sideby when there is one; sideby says so after a command and in the panel. `sideby run claude:main` keeps using `~/.claude` in another terminal at the same time. Arguments after `--` go to the Host: `sideby run work -- --resume`. To try it without installing, run `npx sideby`.\n\n## Set up with your AI agent\n\nPaste this into Claude Code, Codex or any coding agent:\n\n```text\nInstall the sideby CLI (npm package `sideby`) and its agent skill, then set up a second Claude Code account for me.\nFollow \"Set up sideby for a user\" in https://raw.githubusercontent.com/Adonis0123/sideby/main/llms.txt\n```\n\nThe agent checks Node and your Host CLIs, installs sideby and the skill, creates the account, tells you what it shares with your main one and makes its short command work. You sign in once in your browser; the agent gives you that one command. Once the skill is installed, short requests work too: \"add another Claude account, cc008\", \"what do my Codex accounts share?\", \"which account still has quota?\".\n\n## What it looks like\n\nThe 25-second story: one account buried in tasks, then accounts side by side sharing one setup, and a task moving on when one runs out.\n\nhttps://github.com/user-attachments/assets/d1d7e8dd-1df1-4881-ac88-e468c2dd4a1d\n\n<img alt=\"Two terminals: the personal account and the work account running at the same time, both linked to the main account's skills and settings, then the local quota panel, and at 95% Auto Handoff moving work's session to the next account\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/demo.gif\" width=\"1280\">\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\">\n <img alt=\"sideby panel: every account's 5h and 7d quota, 7-day token usage and health in one page\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/panel.png\" width=\"1280\">\n</picture>\n\nOn macOS, the same quota sits in the menu bar (`sideby menubar on`): click or press `⌥⌘S` to open it, and click an account to start it in the terminal.\n\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar-dark.png\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\">\n <img alt=\"sideby macOS menu bar dropdown: a status card, each tool with 5-hour and weekly quota bars, reset times, and the suggested account marked\" src=\"https://raw.githubusercontent.com/Adonis0123/sideby/main/docs/assets/menubar.png\" width=\"468\">\n</picture>\n\n## Why not just an alias?\n\n`CLAUDE_CONFIG_DIR` plus a shell alias already starts a second account. It does not keep skills and settings in one place, and it does not show quota for every account. [Does this break a provider's terms?](docs/guide/faq.md#terms)\n\n| | At the same time | Skills, hooks, settings | Quota and usage | Setup |\n|---|---|---|---|---|\n| `CLAUDE_CONFIG_DIR` and an alias | Yes. Each terminal exports the variable. | Each directory is its own copy. They drift unless you symlink by hand. | That session's status line | One alias per account |\n| [cc-switch](https://github.com/farion1231/cc-switch) | Enabling a provider writes the host's live config, so open sessions share that switch. | Plugin settings are copied across providers as a separate step. | The active provider, from its quota endpoint | Install the desktop app |\n| sideby | Yes. `sideby run` selects the directory for that process and leaves your shell alone. | Linked to the main account. `sideby doctor --fix` repairs copies. Sign-in and sessions stay separate. | Every account, from local files. Claude needs `quota setup`. | `npm i -g sideby`, then `sideby new` and sign in |\n\ncc-switch's docs describe that switch: it writes the live settings file ([README](https://github.com/farion1231/cc-switch#readme)). [#1105](https://github.com/farion1231/cc-switch/issues/1105) and [#2908](https://github.com/farion1231/cc-switch/issues/2908) ask for several sessions at once. [#1106](https://github.com/farion1231/cc-switch/issues/1106) is closed; the maintainer says Claude Code's \"open terminal\" can start one provider without changing the global config.\n\n## What else it does\n\n| You want to | Run | Guide |\n|---|---|---|\n| Hand a task to your own AI from the panel: set up an account, fix a problem, support a new tool | **Let AI do it** in the panel, or `sideby ask` | [Let AI do it](docs/guide/panel.md#let-ai-do-it) |\n| See quota at a glance in the macOS menu bar | **Settings › Startup** in the panel, or `sideby menubar on` | [Quota in the menu bar](docs/guide/usage.md#quota-in-the-menu-bar) |\n| Have the panel ready in the background whenever you log in | **Settings › Startup** in the panel, or `sideby autostart on` | [Start at login](docs/guide/usage.md#start-at-login) |\n| Add an API key account (DeepSeek, a gateway, …) | `sideby new claude deepseek --api` | [API accounts](docs/guide/usage.md#api-accounts) |\n| Find and fix config drift between accounts | `sideby doctor --fix` | [Doctor](docs/guide/usage.md#doctor) |\n| See Claude quota (Codex needs no setup) | `sideby quota setup claude --yes` | [Claude quota](docs/guide/usage.md#claude-quota) |\n| Find the cheapest auto-compact size from your own sessions, and use it in one click | `sideby tune` (or the panel's Context tuning tab) | [Context tuning](docs/guide/usage.md#context-tuning) |\n| See each account's model and effort, and set them per account | `sideby model <account>` (or click the model in the panel) | [Model and effort](docs/guide/usage.md#model-and-effort) |\n| Choose whether Claude sessions connect to claude.ai by themselves (Remote Control), for every account at once | `sideby remote-control off` or `on` (or the panel's Settings) | [Remote Control](docs/guide/usage.md#remote-control) |\n| Pin the accounts you use most and put tools and accounts in your own order | `sideby pin claude:work`, `sideby order` (or the panel's Settings) | [Your own order](docs/guide/usage.md#your-own-order) |\n| Move on when an account hits its limit | `sideby next claude` | [Handoff](docs/guide/usage.md#when-an-account-hits-its-limit) |\n| Let a running task move to the next account by itself when quota runs low (off by default; see the risk) | `sideby handoff enable` (or the panel) | [Auto Handoff](docs/guide/usage.md#auto-handoff) |\n| Short commands such as `ccw` | `sideby alias add ccw claude:work` | [Shell functions](docs/guide/configuration.md#shell-functions) |\n| Reopen a session from Orca and the like in the account that holds it | `\"resumeRouting\": true` in config | [Resuming from other tools](docs/guide/configuration.md#resuming-from-other-tools) |\n| Open Claude Desktop or the Codex app as one account, several side by side (macOS) | `sideby desktop claude:work` (or the panel) | [Desktop apps](docs/guide/usage.md#desktop-apps) |\n| Keep several Grok Bot windows open, each signed in to its own account (macOS) | `sideby desktop grok-bot:002` (or the panel) | [Grok Bot windows](docs/guide/usage.md#grok-bot-windows) |\n| Open the panel from the Dock or app menu | `sideby app install` | [Panel app](docs/guide/panel.md#panel-app) |\n| Show the panel inside your own local page | `createPanelHandler()` | [Embed the panel](docs/guide/panel.md#embed-the-panel) |\n| Add a Host or a pre-launch check | a local plugin | [Plugins](docs/guide/plugins.md) |\n\n## Supported hosts\n\n| Host | Account directories | Sign-in | Quota | Usage (7 days) |\n|---|---|---|---|---|\n| Claude Code | `~/.claude`, `~/.claude-<name>` | `claude auth login` | ✓ after `quota setup claude` | ✓ |\n| Codex CLI | `~/.codex`, `~/.codex-<name>` | `codex login` | ✓ | ✓ |\n| Grok Build | `~/.grok`, `~/.grok-<name>` | `grok login` | weekly, asked from the `grok` CLI | no public source |\n| pi | `~/.pi/agent`, `~/.pi-<name>/agent` | `/login` inside pi | no public source | no public source |\n\nsideby starts the official binary on your `PATH` and never patches it. Tested versions and per-Host notes are in the [guide](docs/guide/usage.md#host-notes).\n\n## Platforms\n\nmacOS and Linux. CI runs the suite on `ubuntu-latest` and `macos-latest`, Node 22 and 24. **Windows is untested.** `sideby app` only installs a launcher on macOS and Linux. Linked items are symlinks, `sideby shell-init` prints bash and zsh functions, and the Claude quota wrapper runs `/bin/sh`.\n\n## Roadmap\n\n**Gemini CLI.** Gemini can point at another config directory with `GEMINI_CONFIG_DIR`. Older docs use `GEMINI_CLI_HOME`; current builds treat that name as deprecated, and exit on startup if it is set together with an exact directory override. A sideby family still needs a tested Gemini version, a login check that does not read tokens, and a list of which files to link or copy. That is more than a small patch, so it is not in this version.\n\n## Safe by design\n\n- It never edits a Host's global config to switch accounts. It moves a task to another account only when you turn on Auto Handoff, and never proxies requests or pools logins.\n- It never reads, prints or sends a credential value. Nothing about your accounts leaves your machine: the only request sideby makes on its own is a daily check of the npm registry for its newest version (off with `NO_UPDATE_NOTIFIER=1`; see [Updates](docs/guide/configuration.md#updates)).\n- `doctor --fix` never replaces a real file and never changes where a link points.\n- The panel answers only on `127.0.0.1` and refuses web pages from other sites, but it trusts every user of this computer. On a shared Mac, do not leave it running in the background ([details](docs/guide/panel.md#who-can-reach-the-panel)).\n\nDetails and the terms-of-service question are in the [FAQ](docs/guide/faq.md).\n\nUsage questions and ideas go in [Discussions](https://github.com/Adonis0123/sideby/discussions).\n\n## Docs\n\n- [Using sideby](docs/guide/usage.md): accounts, API accounts, Doctor, quota, Handoff, Host notes\n- [Commands](docs/guide/commands.md): every command, exit codes and `--json`\n- [Configuration](docs/guide/configuration.md): `config.json`, aliases, shell functions\n- [Panel](docs/guide/panel.md): the panel, panel app and embedding\n- [Plugins](docs/guide/plugins.md): write your own Family or launch hook\n- [FAQ](docs/guide/faq.md): terms of service, data locations, alternatives, uninstall\n- [Changelog](https://github.com/Adonis0123/sideby/releases)\n\n## For AI agents\n\n- [`llms.txt`](llms.txt): setup steps, commands, JSON contract and plugin API in one index. `sideby families --json` states what each Host's accounts share.\n- [`skills/sideby/SKILL.md`](skills/sideby/SKILL.md): one Agent Skill for seeing, repairing and creating accounts and for moving on when one hits its limit. Install with `npx skills add Adonis0123/sideby -g`; `sideby doctor` warns when the installed copy is for another sideby version.\n- [`AGENTS.md`](AGENTS.md): rules for agents working on this repository.\n\n## License\n\n[MIT](LICENSE)\n"
|
|
85
85
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/alias-list.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"shortCommands"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"const": 1
|
|
13
|
+
},
|
|
14
|
+
"shortCommands": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"name",
|
|
20
|
+
"kind"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"name": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"kind": {
|
|
27
|
+
"anyOf": [
|
|
28
|
+
{
|
|
29
|
+
"type": "string",
|
|
30
|
+
"const": "account"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "string",
|
|
34
|
+
"const": "pick"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"account": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "The Account a short command of kind `account` starts."
|
|
41
|
+
},
|
|
42
|
+
"args": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"family": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "The Family a Pick Command picks in."
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"_notice": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"update": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"required": [
|
|
61
|
+
"current",
|
|
62
|
+
"latest",
|
|
63
|
+
"command",
|
|
64
|
+
"message"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"current": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"latest": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"command": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
76
|
+
},
|
|
77
|
+
"message": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"skill": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": [
|
|
85
|
+
"installed",
|
|
86
|
+
"current",
|
|
87
|
+
"command",
|
|
88
|
+
"message"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"installed": {
|
|
92
|
+
"anyOf": [
|
|
93
|
+
{
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "null"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"description": "The skill's version; null when it has none."
|
|
101
|
+
},
|
|
102
|
+
"current": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"command": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
108
|
+
},
|
|
109
|
+
"message": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"title": "sideby alias list --json"
|
|
119
|
+
}
|
package/schemas/alias.json
CHANGED
|
@@ -37,8 +37,26 @@
|
|
|
37
37
|
{
|
|
38
38
|
"type": "string",
|
|
39
39
|
"const": "absent"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "string",
|
|
43
|
+
"const": "confirm"
|
|
40
44
|
}
|
|
41
|
-
]
|
|
45
|
+
],
|
|
46
|
+
"description": "`confirm` (exit 10): the pick command would hide a command on PATH, so nothing was written; run again with `--yes`."
|
|
47
|
+
},
|
|
48
|
+
"kind": {
|
|
49
|
+
"anyOf": [
|
|
50
|
+
{
|
|
51
|
+
"type": "string",
|
|
52
|
+
"const": "account"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "string",
|
|
56
|
+
"const": "pick"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"description": "`pick` for a Pick Command (`--pick`), `account` for a short command of one Account."
|
|
42
60
|
},
|
|
43
61
|
"account": {
|
|
44
62
|
"type": "string"
|
|
@@ -50,6 +68,14 @@
|
|
|
50
68
|
},
|
|
51
69
|
"description": "Host arguments `sideby run <alias>` adds."
|
|
52
70
|
},
|
|
71
|
+
"family": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The Family a Pick Command picks in."
|
|
74
|
+
},
|
|
75
|
+
"shadows": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "The command on PATH this Pick Command hides in the shell, such as /usr/bin/cc."
|
|
78
|
+
},
|
|
53
79
|
"shellInitFiles": {
|
|
54
80
|
"type": "array",
|
|
55
81
|
"items": {
|
package/schemas/config.json
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"wezterm",
|
|
57
57
|
"kitty",
|
|
58
58
|
"alacritty",
|
|
59
|
+
"windows-terminal",
|
|
59
60
|
"custom"
|
|
60
61
|
],
|
|
61
62
|
"description": "The terminal sideby opens for AI Tasks; without it sideby picks the one you use."
|
|
@@ -132,6 +133,16 @@
|
|
|
132
133
|
},
|
|
133
134
|
"description": "Short shell function names created by `sideby shell-init`, mapped to an Account ref or to `{ account, args }`."
|
|
134
135
|
},
|
|
136
|
+
"pickCommands": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"patternProperties": {
|
|
139
|
+
"^[A-Za-z_][A-Za-z0-9_-]*$": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"minLength": 1
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"description": "Pick Commands: short shell function names created by `sideby shell-init`, mapped to a Family. Each run starts the Account of that Family with the most Quota left, or the Main Account when none has Quota data (ADR-0035). They share one namespace with `aliases`."
|
|
145
|
+
},
|
|
135
146
|
"ignore": {
|
|
136
147
|
"type": "array",
|
|
137
148
|
"items": {
|
package/schemas/new.json
CHANGED
|
@@ -194,6 +194,25 @@
|
|
|
194
194
|
},
|
|
195
195
|
"description": "Only with `--next`: the picked name, the short command that follows the existing pattern, or why that short command was left out."
|
|
196
196
|
},
|
|
197
|
+
"pickCommandOffer": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"required": [
|
|
200
|
+
"name",
|
|
201
|
+
"command"
|
|
202
|
+
],
|
|
203
|
+
"properties": {
|
|
204
|
+
"name": {
|
|
205
|
+
"type": "string"
|
|
206
|
+
},
|
|
207
|
+
"command": {
|
|
208
|
+
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
"shadows": {
|
|
211
|
+
"type": "string"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"description": "Set once, when this is the Family’s second subscription account and it has no pick command: the command that adds one."
|
|
215
|
+
},
|
|
197
216
|
"_notice": {
|
|
198
217
|
"type": "object",
|
|
199
218
|
"properties": {
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/shell-init-setup.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"shell",
|
|
8
|
+
"rc",
|
|
9
|
+
"status"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"const": 1
|
|
15
|
+
},
|
|
16
|
+
"shell": {
|
|
17
|
+
"anyOf": [
|
|
18
|
+
{
|
|
19
|
+
"type": "string",
|
|
20
|
+
"const": "zsh"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "string",
|
|
24
|
+
"const": "bash"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"rc": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The rc file, with ~ for the home folder."
|
|
31
|
+
},
|
|
32
|
+
"status": {
|
|
33
|
+
"anyOf": [
|
|
34
|
+
{
|
|
35
|
+
"type": "string",
|
|
36
|
+
"const": "loaded"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "string",
|
|
40
|
+
"const": "confirm"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "string",
|
|
44
|
+
"const": "added"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "string",
|
|
48
|
+
"const": "removed"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "string",
|
|
52
|
+
"const": "not-added"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"description": "`loaded`: new terminals already load the short commands. `confirm` (exit 10): nothing written; `block` is what --yes appends. `not-added`: --undo found no line sideby added."
|
|
56
|
+
},
|
|
57
|
+
"block": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"_notice": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"update": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": [
|
|
66
|
+
"current",
|
|
67
|
+
"latest",
|
|
68
|
+
"command",
|
|
69
|
+
"message"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"current": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"latest": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"command": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
81
|
+
},
|
|
82
|
+
"message": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"skill": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"required": [
|
|
90
|
+
"installed",
|
|
91
|
+
"current",
|
|
92
|
+
"command",
|
|
93
|
+
"message"
|
|
94
|
+
],
|
|
95
|
+
"properties": {
|
|
96
|
+
"installed": {
|
|
97
|
+
"anyOf": [
|
|
98
|
+
{
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "null"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"description": "The skill's version; null when it has none."
|
|
106
|
+
},
|
|
107
|
+
"current": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"command": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
113
|
+
},
|
|
114
|
+
"message": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"title": "sideby shell-init setup --json"
|
|
124
|
+
}
|