claude-account-sync 0.5.0 β†’ 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +75 -9
  2. package/package.json +4 -1
package/README.md CHANGED
@@ -7,6 +7,8 @@ Run Claude Code with several accounts β€” personal subscription, work OAuth, API
7
7
  The `clp` command (also available as `ccprofiles`) fixes that:
8
8
 
9
9
  - πŸ”Ž **Adopt** your existing `.claude*` directories into a declarative manifest β€” zero manual config
10
+ - πŸŽ›οΈ **Set up profiles the easy way** β€” a guided web form to create, edit, and delete profiles: launcher, env, links, MCP, and provider β€” no hand-editing config files
11
+ - 🌐 **Custom LLM providers per profile** β€” point a profile at z.ai (GLM), mimo, OpenRouter, or any Anthropic-compatible endpoint with a preset picker; base URL + token + model mappings managed for you, token kept in the keychain
10
12
  - 🧩 **Manage MCP servers** across profiles: drift matrix, add/remove everywhere at once, sync one profile's set to others
11
13
  - πŸ” **Secrets out of your rc files** β€” macOS Keychain / libsecret / encrypted file, with `clp secrets migrate` to clean up existing plaintext keys
12
14
  - πŸ–₯️ **Replicate to another machine over LAN** β€” PIN pairing, end-to-end encrypted, no cloud, works macOS ↔ Windows ↔ Linux ↔ WSL
@@ -64,6 +66,68 @@ clp create work --from oauth # dir + launcher fn + copied MCP set
64
66
  cl-work # launches claude with CLAUDE_CONFIG_DIR=~/.claude-work
65
67
  ```
66
68
 
69
+ `clp apply` writes a launcher function per profile into your shell startup file β€” `.zshrc`/`.bashrc` on macOS/Linux, your **PowerShell profile** on Windows. After applying, reload the shell (or open a new terminal) and the `cl-*` commands are available directly.
70
+
71
+ ### Using the launchers on Windows (PowerShell)
72
+
73
+ On Windows the launchers are **PowerShell functions**, written to the PowerShell 7 profile:
74
+
75
+ ```
76
+ %USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
77
+ ```
78
+
79
+ After `clp apply`, reload with `. $PROFILE` (or open a new tab), then run `cl-work` directly. Three things to get right:
80
+
81
+ - **Use PowerShell 7 (`pwsh`), not Windows PowerShell 5.1.** clp writes to the `Documents\PowerShell\` profile (PS7). The old built-in "Windows PowerShell" (5.1, `powershell.exe`) reads a *different* file (`Documents\WindowsPowerShell\`) and won't see the functions. Install PS7 with `winget install --id Microsoft.PowerShell` and make it your default: Windows Terminal β†’ Settings β†’ Startup β†’ Default profile β†’ **PowerShell**. Check with `$PSVersionTable.PSVersion` (want 7.x). *(CMD and Git Bash can't use these β€” they're PowerShell functions.)*
82
+ - **Allow the profile to run.** If reloading errors with "running scripts is disabled," run once: `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`.
83
+ - **Watch for OneDrive-redirected Documents.** If your Documents folder syncs to OneDrive, PowerShell's real `$PROFILE` may live under OneDrive. Compare `$PROFILE` in your shell against the path above β€” if they differ, that's why the launcher isn't found.
84
+
85
+ ### Point a profile at a custom LLM provider
86
+
87
+ Run a profile against z.ai (GLM), mimo, OpenRouter, or any Anthropic-compatible
88
+ endpoint β€” Claude Code reads the provider config from that profile's `settings.json`,
89
+ and `clp` manages it for you. The easiest path is the **web dashboard**: open a profile
90
+ β†’ **Edit β†’ Provider**, pick a preset (or *Custom*), fill in the base URL, choose a
91
+ keychain secret for the auth token, and optionally map the opus/sonnet/haiku model
92
+ names. You can also **copy provider settings from another profile** in one click.
93
+
94
+ Already configured a provider by hand in `settings.json`? `clp adopt` imports it, and
95
+ `clp secrets migrate` moves the plaintext token into your keychain (the manifest then
96
+ references it as `secret://…`, resolved at apply time):
97
+
98
+ ```bash
99
+ clp adopt --yes # imports each profile's settings.json env, incl. provider config
100
+ clp secrets migrate # moves ANTHROPIC_AUTH_TOKEN / API_KEY into the keychain
101
+ clp doctor # flags any provider token still sitting in plaintext
102
+ ```
103
+
104
+ Under the hood this is a generic per-profile env map written into `settings.json`
105
+ (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_DEFAULT_*_MODEL`, …), so
106
+ anything Claude Code supports works β€” the form just gives the common keys friendly
107
+ labels and a preset for the base URL. It travels with sync and bundles like everything
108
+ else, token included (via the encrypted secrets channel).
109
+
110
+ ### Where secrets are stored (per-OS setup)
111
+
112
+ `clp` keeps API tokens out of your rc/config files by putting them in the OS credential store, picked automatically:
113
+
114
+ | OS | Backend | Setup |
115
+ |---|---|---|
116
+ | macOS | Keychain | automatic |
117
+ | Windows | DPAPI (via PowerShell) | automatic |
118
+ | **Linux desktop** | `secret-tool` (libsecret) | `sudo apt install libsecret-tools` (or `dnf install libsecret`) β€” needs a running keyring daemon (GNOME Keyring / KWallet) |
119
+ | **Linux headless / server** | AES‑256‑GCM encrypted file | set a passphrase (below) β€” servers have no keyring daemon, so libsecret isn't an option |
120
+
121
+ **Headless Linux / server (no desktop keyring):** the encrypted-file backend needs a passphrase in the environment. `clp` (and `clp ui`) read it at launch:
122
+
123
+ ```bash
124
+ # add to ~/.bashrc so it persists, then: source ~/.bashrc
125
+ export CCPROFILES_PASSPHRASE='a-long-passphrase-you-will-remember'
126
+ clp ui
127
+ ```
128
+
129
+ Secrets then encrypt to `~/.ccprofiles/secrets.enc`. **The passphrase is the decryption key** β€” keep it safe and unchanged, or the stored secrets become unreadable. (Prefer a systemd `EnvironmentFile` or your secrets manager over `.bashrc` if the box is shared.) Without a keyring *and* without this passphrase, the Secrets tab and `clp secrets …` will report the backend is unavailable.
130
+
67
131
  ### Replicate to a second machine
68
132
 
69
133
  ```bash
@@ -90,13 +154,19 @@ Two things intentionally don't travel:
90
154
  clp ui # opens http://127.0.0.1:<port>/?t=<token> in your browser
91
155
  ```
92
156
 
93
- A local panel to manage profiles, MCP servers (interactive drift matrix), secrets (add / reveal / delete / migrate), sync, and doctor β€” everything the CLI does. It's **localhost-only** and guarded by a per-launch session token plus an Origin check, so nothing off your machine (and no website in your browser) can reach the API. Pass `--no-open` to just print the URL, or `--port <n>` to pin the port.
157
+ A local panel to manage everything the CLI does β€” and the easiest way to set profiles up:
158
+
159
+ - **Profiles** β€” create, edit, and delete profiles from a form: launcher function, environment variables, links, MCP toggles, and a **guided Provider section** (preset picker for z.ai / mimo / OpenRouter / Anthropic-default / Custom, labeled base-URL / token / model fields, copy-from-another-profile, and an *Advanced* raw editor for any other `settings.json` env var). Deleting a profile is manifest-only β€” the `~/.claude-*` directory stays on disk.
160
+ - **Shell RC** β€” preview the managed block in your `.zshrc`/`.bashrc` vs. what the manifest renders, with a one-click update.
161
+ - **MCP servers** (interactive drift matrix), **Secrets** (add / reveal / delete / migrate, plus attach a secret to a profile as an env var), **Sync**, and **Doctor**.
162
+
163
+ It's **localhost-only** and guarded by a per-launch session token plus an Origin check, so nothing off your machine (and no website in your browser) can reach the API. Pass `--no-open` to just print the URL, or `--port <n>` to pin the port.
94
164
 
95
165
  ## How it works
96
166
 
97
167
  Three layers of state:
98
168
 
99
- 1. **Live state** β€” your actual `.claude*` dirs and shell rc files. Claude Code owns these; the tool edits only the keys it manages (`mcpServers`, its marked rc block, its links).
169
+ 1. **Live state** β€” your actual `.claude*` dirs and shell rc files. Claude Code owns these; the tool edits only the keys it manages (`mcpServers` and the `env` block in `settings.json`, its marked rc block, its links).
100
170
  2. **Manifest** β€” `~/.ccprofiles/manifest.yaml`, a platform-neutral declaration (paths templated as `{home}`, secrets referenced as `secret://name`). Versioned with local git commits; safe to share.
101
171
  3. **Secrets store** β€” per-machine keychain: macOS Keychain, Linux `secret-tool` (libsecret), or an AES-256-GCM encrypted file as fallback (native Windows and headless Linux β€” set `CCPROFILES_PASSPHRASE` in your environment for it). Values never appear in the manifest, bundles, or rc files; launcher functions resolve them at run time by calling the CLI.
102
172
 
@@ -112,7 +182,7 @@ Pairing performs an X25519 ECDH key exchange authenticated by the 6-digit PIN sh
112
182
 
113
183
  | Area | Commands |
114
184
  |---|---|
115
- | Profiles | `list` Β· `create <name> [--from p]` Β· `adopt [--yes]` Β· `doctor` |
185
+ | Profiles | `list` Β· `create <name> [--from p]` Β· `adopt [--yes]` Β· `doctor` (create/edit/delete + provider config: use `clp ui`) |
116
186
  | MCP | `mcp list` Β· `mcp add/rm <name> [--profile p\|--all]` Β· `mcp sync --from p --to p1,p2\|--all` |
117
187
  | Secrets | `secrets set/get/list/rm` Β· `secrets migrate` |
118
188
  | Manifest | `status` Β· `apply` Β· `snapshot` |
@@ -129,7 +199,8 @@ All mutating commands support `--dry-run`. Every mutation backs up the files it
129
199
  | `error: no manifest yet` | Run `clp adopt --yes` first β€” it builds the manifest from your existing profiles |
130
200
  | `zsh: command not found: clp` | Not linked/installed β€” see Install; if just linked, run `rehash` |
131
201
  | ``cannot reach <host> β€” is `ccprofiles serve` running?`` | Start `clp serve` on the other device; check you're on the same network and the port matches |
132
- | `encrypted-file backend requires a passphrase` | Set `CCPROFILES_PASSPHRASE` (Windows / Linux without libsecret) |
202
+ | `encrypted-file backend requires a passphrase` / secrets tab errors | No OS keyring available. **Linux desktop:** `sudo apt install libsecret-tools` + a running keyring. **Headless Linux / server:** `export CCPROFILES_PASSPHRASE='…'` before `clp ui` (persist in `~/.bashrc`). **Windows:** secrets use DPAPI automatically (needs PowerShell). See [Where secrets are stored](#where-secrets-are-stored-per-os-setup) |
203
+ | `cl-*` launcher not found on Windows | Use PowerShell 7 (`pwsh`), not Windows PowerShell 5.1; reload with `. $PROFILE`; if scripts are blocked run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. Confirm `$PROFILE` matches `Documents\PowerShell\Microsoft.PowerShell_profile.ps1` (OneDrive can redirect it) |
133
204
  | Profile shows account `-` after sync | Expected β€” run `/login` inside that profile once; OAuth sessions don't sync |
134
205
  | Something went wrong after `apply` | Restore from `~/.ccprofiles/backups/<latest>/` |
135
206
 
@@ -137,7 +208,6 @@ All mutating commands support `--dry-run`. Every mutation backs up the files it
137
208
 
138
209
  - mDNS auto-discovery for `clp devices`
139
210
  - Pair devices from the dashboard (currently CLI-only)
140
- - Windows Credential Manager (DPAPI) secrets backend
141
211
  - Interactive prompts (`secrets set` without echoing, `adopt` confirmation)
142
212
 
143
213
  ## Development
@@ -150,10 +220,6 @@ npm test # vitest β€” unit + e2e (incl. an in-process two-machine sync te
150
220
  npm run build # builds core + cli + the dashboard, bundled into the CLI
151
221
  ```
152
222
 
153
- ## Related projects
154
-
155
- Not to be confused with [samhvw8/claude-code-profile](https://github.com/samhvw8/claude-code-profile) (the `ccp` command) β€” a great tool for a **different** job: a central hub of reusable skills/agents/hooks/commands, with profiles for different *workflows*. It explicitly does **not** handle MCP servers, secrets, LAN sync, or multiple *accounts* β€” which are exactly this tool's focus. The two are complementary; this one deliberately uses the `clp` / `ccprofiles` commands to avoid clashing with its `ccp`.
156
-
157
223
  ## License
158
224
 
159
225
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-account-sync",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Manage multiple Claude Code accounts/profiles β€” MCP drift sync, keychain secrets, and encrypted LAN replication between machines. CLI: ccprofiles (alias clp).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,5 +36,8 @@
36
36
  "dependencies": {
37
37
  "ccprofiles-core": "^0.3.0",
38
38
  "commander": "^12.1.0"
39
+ },
40
+ "scripts": {
41
+ "prepack": "node -e \"require('fs').copyFileSync('../../README.md','README.md')\""
39
42
  }
40
43
  }