claude-account-sync 0.5.0 โ†’ 0.5.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.
Files changed (2) hide show
  1. package/README.md +54 -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,47 @@ 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
+
67
110
  ### Replicate to a second machine
68
111
 
69
112
  ```bash
@@ -90,13 +133,19 @@ Two things intentionally don't travel:
90
133
  clp ui # opens http://127.0.0.1:<port>/?t=<token> in your browser
91
134
  ```
92
135
 
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.
136
+ A local panel to manage everything the CLI does โ€” and the easiest way to set profiles up:
137
+
138
+ - **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.
139
+ - **Shell RC** โ€” preview the managed block in your `.zshrc`/`.bashrc` vs. what the manifest renders, with a one-click update.
140
+ - **MCP servers** (interactive drift matrix), **Secrets** (add / reveal / delete / migrate, plus attach a secret to a profile as an env var), **Sync**, and **Doctor**.
141
+
142
+ 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
143
 
95
144
  ## How it works
96
145
 
97
146
  Three layers of state:
98
147
 
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).
148
+ 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
149
  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
150
  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
151
 
@@ -112,7 +161,7 @@ Pairing performs an X25519 ECDH key exchange authenticated by the 6-digit PIN sh
112
161
 
113
162
  | Area | Commands |
114
163
  |---|---|
115
- | Profiles | `list` ยท `create <name> [--from p]` ยท `adopt [--yes]` ยท `doctor` |
164
+ | Profiles | `list` ยท `create <name> [--from p]` ยท `adopt [--yes]` ยท `doctor` (create/edit/delete + provider config: use `clp ui`) |
116
165
  | MCP | `mcp list` ยท `mcp add/rm <name> [--profile p\|--all]` ยท `mcp sync --from p --to p1,p2\|--all` |
117
166
  | Secrets | `secrets set/get/list/rm` ยท `secrets migrate` |
118
167
  | Manifest | `status` ยท `apply` ยท `snapshot` |
@@ -129,7 +178,8 @@ All mutating commands support `--dry-run`. Every mutation backs up the files it
129
178
  | `error: no manifest yet` | Run `clp adopt --yes` first โ€” it builds the manifest from your existing profiles |
130
179
  | `zsh: command not found: clp` | Not linked/installed โ€” see Install; if just linked, run `rehash` |
131
180
  | ``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) |
181
+ | `encrypted-file backend requires a passphrase` | On Windows, secrets use DPAPI automatically (needs PowerShell); otherwise set `CCPROFILES_PASSPHRASE` (headless Linux without libsecret) |
182
+ | `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
183
  | Profile shows account `-` after sync | Expected โ€” run `/login` inside that profile once; OAuth sessions don't sync |
134
184
  | Something went wrong after `apply` | Restore from `~/.ccprofiles/backups/<latest>/` |
135
185
 
@@ -137,7 +187,6 @@ All mutating commands support `--dry-run`. Every mutation backs up the files it
137
187
 
138
188
  - mDNS auto-discovery for `clp devices`
139
189
  - Pair devices from the dashboard (currently CLI-only)
140
- - Windows Credential Manager (DPAPI) secrets backend
141
190
  - Interactive prompts (`secrets set` without echoing, `adopt` confirmation)
142
191
 
143
192
  ## Development
@@ -150,10 +199,6 @@ npm test # vitest โ€” unit + e2e (incl. an in-process two-machine sync te
150
199
  npm run build # builds core + cli + the dashboard, bundled into the CLI
151
200
  ```
152
201
 
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
202
  ## License
158
203
 
159
204
  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.1",
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
  }