sideby 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -413
- package/README.zh-CN.md +71 -414
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +13 -0
- package/dist/src/cli/commands.js +86 -7
- package/dist/src/cli/json-schemas.js +35 -0
- package/dist/src/cli/main.js +99 -9
- package/dist/src/core/accounts.d.ts +2 -0
- package/dist/src/core/accounts.js +15 -0
- package/dist/src/core/config.d.ts +1 -0
- package/dist/src/core/config.js +3 -0
- package/dist/src/core/launch.d.ts +3 -1
- package/dist/src/core/resume.d.ts +9 -0
- package/dist/src/core/resume.js +15 -0
- package/dist/src/core/share-meaning.d.ts +6 -0
- package/dist/src/core/share-meaning.js +32 -0
- package/dist/src/core/shell-init.d.ts +7 -1
- package/dist/src/core/shell-init.js +25 -2
- package/dist/src/families/claude/index.js +3 -0
- package/dist/src/families/codex/index.js +3 -0
- package/dist/src/families/grok/index.js +4 -0
- package/dist/src/families/shared/sessions.d.ts +9 -0
- package/dist/src/families/shared/sessions.js +70 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/panel/handler.d.ts +0 -2
- package/dist/src/panel/handler.js +1 -16
- package/dist/src/runtime.d.ts +48 -2
- package/dist/src/runtime.js +54 -1
- package/dist/src/types.d.ts +7 -0
- package/dist/testing/index.js +2 -1
- package/package.json +1 -1
- package/schemas/config.json +4 -0
- package/schemas/families.json +205 -0
- package/schemas/new.json +18 -0
- package/skills/sideby/SKILL.md +15 -6
- package/skills/sideby/references/accounts.md +1 -1
- package/skills/sideby/references/setup.md +31 -0
- package/skills/sideby/references/sharing.md +17 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Install sideby and set up an account
|
|
2
|
+
|
|
3
|
+
For "install sideby", "set up another Claude account", "add cc008", "配置一个 cc00x". Do each step yourself unless it says **user**; give the user that step as exactly one line (in Claude Code: `! <command>`) and continue when they say it is done.
|
|
4
|
+
|
|
5
|
+
1. **Node and sideby.** `node --version` must be 22.18 or newer; otherwise tell the user to upgrade Node and stop. `sideby --version`; when it is missing, run `npm i -g sideby` (Claude quota and shell functions need the global install, not `npx`).
|
|
6
|
+
2. **This skill.** If it was not installed with `npx skills add Adonis0123/sideby -g`, install it that way so it stays current; `sideby doctor` warns when it is for another version.
|
|
7
|
+
3. **Hosts and accounts.** `sideby list --json`. `families[].installed: false` means that Host CLI is not on PATH: give the user its `installUrl` and stop; never install a Host unasked. No `<family>:main` in `accounts` means the Host has never run: ask the user to start it once (for example `claude`), because `new` builds on the Main Account.
|
|
8
|
+
4. **What it will share.** `sideby families <family> --json`, then tell the user in a sentence or two (see `sharing.md`): skills, hooks, rules and settings come from the Main Account; sign-in, sessions and history are the new account's own.
|
|
9
|
+
5. **Create.**
|
|
10
|
+
- The user gave no name, or said "cc00x" / "the next one": `sideby new <family> --next --json`. It picks the next number (`008` after `001`…`007`) and, when existing short commands show a pattern (`cc007` for `claude:007`), adds the next one (`cc008`). Read `suggestion`: `aliasProblem` means that short command was taken and left out; tell the user.
|
|
11
|
+
- The user gave a name: `sideby new <family> <name> --json`; a short command they named: add `--alias <short>`.
|
|
12
|
+
- An API account (DeepSeek, a gateway, …): add `--api`.
|
|
13
|
+
- A short command the user did not ask for and no pattern suggests: none. Do not invent a prefix.
|
|
14
|
+
6. **user: sign in or fill in the key.**
|
|
15
|
+
- Subscription account: `sideby login <ref>`. It opens the Host's sign-in in their browser. For pi it starts pi; they type `/login`.
|
|
16
|
+
- API account: they open the `proxy.env` path that `new` printed and fill in the values. Never read or write it, and never ask for the key in chat.
|
|
17
|
+
7. **Short command in new terminals.** If `~/.config/sideby/config.json` has no `shellInitFile`, and `~/.zshrc` (bash: `~/.bashrc`) has no line containing `sideby shell-init`, say so and append `eval "$(sideby shell-init zsh)"` (or `bash`). It takes effect in new terminals. Skip this when the user wanted no short command.
|
|
18
|
+
8. **Verify.** `sideby doctor <ref> --json` should report no `fail`; fix only the new account with `sideby doctor <ref> --fix`. After the user signed in, `sideby list --json` shows `login: "logged-in"` for it.
|
|
19
|
+
9. **Optional, Claude Code:** for quota in `sideby quota` and the panel, follow `quota.md` (it needs the user's yes).
|
|
20
|
+
|
|
21
|
+
Finish with how to start it: the short command in a new terminal (`cc008`), or `sideby run <ref>`; and `sideby ui` to see every account's quota.
|
|
22
|
+
|
|
23
|
+
## When a step fails
|
|
24
|
+
|
|
25
|
+
| Result | Do |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `new` exit 1, `code: "alias-invalid"` | Nothing was created. Pick another short command with the user, or leave `--alias` out. |
|
|
28
|
+
| `new` says the directory exists | The account is already there: `sideby list --json`, then continue from step 6. |
|
|
29
|
+
| `new` says the Main Account is missing | Step 3: the user starts the Host once. |
|
|
30
|
+
| `npm i -g` fails with `EACCES` | npm's global directory is not writable; tell the user to use a Node version manager (nvm, fnm) rather than `sudo`. |
|
|
31
|
+
| `doctor` reports `link.real-file` | The account already had its own file there; show the hint, do not move it without the user. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# What accounts share
|
|
2
|
+
|
|
3
|
+
Answer from `sideby families [family] --json`, not from memory: it covers plugin families and the user's own `extraSharedItems`. Each `shared[]` entry has `path`, `mode` and `meaning`, a sentence you can quote.
|
|
4
|
+
|
|
5
|
+
- **Shared** (one copy, from the Main Account): `link` items. A change in the Main Account reaches every account at once.
|
|
6
|
+
- **Kept equal**: `copy` and `link-or-copy` items, a subscription account's `local-if-api` item, and the one key of a `json-key` item (Claude's MCP servers in `.claude.json`). `sideby doctor --fix` brings them back in line after the Main Account changes.
|
|
7
|
+
- **The account's own**: `local` items (copied once, then theirs), an API account's `local-if-api` item (it starts as a copy, so its endpoint and model never change the Main Account's), and `info` items such as `auth.json` (sign-in; never shared, never read).
|
|
8
|
+
- **Not in the list at all**: sessions, history and everything else in the account directory belong to that account. That is why two accounts can run at the same time.
|
|
9
|
+
|
|
10
|
+
An item the Main Account does not have is skipped: nothing to share, no Finding.
|
|
11
|
+
|
|
12
|
+
To share one more file or directory (a `scripts` folder, a status line script), add it to config `extraSharedItems`, for example `{ "extraSharedItems": { "claude": [{ "path": "scripts", "mode": "link" }] } }` in `~/.config/sideby/config.json`, then run `sideby doctor claude --fix` to link it into every account. Keep the user's other config keys; never add a path with `..` or an absolute path.
|
|
13
|
+
|
|
14
|
+
Two answers people often need:
|
|
15
|
+
|
|
16
|
+
- "Will my new account have my MCP servers?" Claude Code: yes, `new` copies the `mcpServers` entry and `doctor --fix` keeps it equal later; OAuth servers (GitHub, Figma) still need each account to authorize once. Codex: yes for subscription accounts, through the linked `config.toml`.
|
|
17
|
+
- "Will it see my old sessions?" No. Sessions stay in the account that made them; `sideby run <old-account> -- --resume` reopens them there.
|