@hasna/accounts 0.1.14 → 0.1.15
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 +23 -23
- package/dist/cli.js +5 -5
- package/dist/index.js +2 -2
- package/dist/lib/import-profile.d.ts.map +1 -1
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,23 +42,23 @@ accounts login work # run /login inside Claude, then /exit; accounts auto
|
|
|
42
42
|
accounts login personal # same: login, exit; it becomes the live/default account
|
|
43
43
|
|
|
44
44
|
# 4. Switch
|
|
45
|
-
accounts apply work
|
|
45
|
+
accounts apply work # Cursor / VS Code — live ~/.claude auth
|
|
46
46
|
accounts apply personal
|
|
47
47
|
|
|
48
48
|
# Or terminal-only (parallel sessions OK):
|
|
49
|
-
accounts launch work
|
|
50
|
-
eval "$(accounts env personal
|
|
49
|
+
accounts launch work
|
|
50
|
+
eval "$(accounts env personal)" # other terminal
|
|
51
51
|
|
|
52
52
|
# Or supervised: lets MCP switch/restart this Claude process automatically
|
|
53
|
-
accounts use work
|
|
53
|
+
accounts use work
|
|
54
54
|
accounts run claude --resume
|
|
55
|
-
accounts switch personal --
|
|
55
|
+
accounts switch personal --supervisor # from another terminal
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
After `accounts login <name
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
After `accounts login <name>`, `accounts` snapshots the auth Claude wrote,
|
|
59
|
+
updates the detected email, and applies that profile to live `~/.claude` paths
|
|
60
|
+
automatically. `accounts apply` still refuses profiles without auth so live OAuth
|
|
61
|
+
is not wiped.
|
|
62
62
|
|
|
63
63
|
## Three pointers (active, applied, isolated)
|
|
64
64
|
|
|
@@ -94,24 +94,24 @@ Implementation details: [docs/IMPLEMENT.md](docs/IMPLEMENT.md).
|
|
|
94
94
|
|---------|-------------|
|
|
95
95
|
| `accounts add <name>` | Create a profile. `--tool`, `--email`, `--dir`, `--description`. |
|
|
96
96
|
| `accounts import [name]` | Import existing config dir (default `~/.claude`). `--copy` for managed copy. |
|
|
97
|
-
| `accounts login <name
|
|
98
|
-
| `accounts apply <name
|
|
97
|
+
| `accounts login <name>` | Launch the profile's tool login flow in an isolated profile dir. Use `--tool` only for new or ambiguous profiles. |
|
|
98
|
+
| `accounts apply <name>` | Apply profile auth to live Claude paths (requires snapshot; Claude-only). |
|
|
99
99
|
| `accounts pick` | Interactive picker; default applies. `--env`, `--no-act`. |
|
|
100
|
-
| `accounts switch <name
|
|
101
|
-
| `accounts switch <name> --
|
|
102
|
-
| `accounts use <name
|
|
100
|
+
| `accounts switch <name>` | Switch profile and print a restart/resume command. Add `--resume`, `--launch`, or `--permissions <preset>`. Use `--tool` only when ambiguous. |
|
|
101
|
+
| `accounts switch <name> --supervisor` | Ask a running `accounts run <tool>` supervisor to restart under that profile. Supports `--permissions <preset>`. |
|
|
102
|
+
| `accounts use <name>` | Mark profile active; prints apply/env hints. |
|
|
103
103
|
| `accounts list` (`ls`) | List profiles (`●` active, `◉` applied, `●◉` both). |
|
|
104
104
|
| `accounts show <name> --tool <tool>` | Profile details including active/applied flags. |
|
|
105
105
|
| `accounts current` | Active profile per tool (with applied hint). |
|
|
106
106
|
| `accounts active [tool]` | Print active profile name (scripting). |
|
|
107
107
|
| `accounts applied [tool]` | Print applied profile name (scripting). |
|
|
108
|
-
| `accounts env [name]
|
|
109
|
-
| `accounts launch <name
|
|
108
|
+
| `accounts env [name]` | Print one or more `export ...` lines for the profile. Use `--tool` only when ambiguous or when no name is passed. |
|
|
109
|
+
| `accounts launch <name>` | Launch tool once with profile env. Supports `--permissions <preset>`. |
|
|
110
110
|
| `accounts run <tool> [args...]` | Run a tool under the supervisor so MCP/CLI can switch and restart it. Supports `--permissions <preset>`. |
|
|
111
111
|
| `accounts supervisor status [tool]` | Show running supervisors. |
|
|
112
|
-
| `accounts supervisor switch <name
|
|
112
|
+
| `accounts supervisor switch <name>` | Switch a running supervisor to another profile. Use `--tool` only when ambiguous. |
|
|
113
113
|
| `accounts supervisor stop <tool>` | Stop a running supervisor and its child process. |
|
|
114
|
-
| `accounts shell <name
|
|
114
|
+
| `accounts shell <name>` | Subshell with profile env. |
|
|
115
115
|
| `accounts hook install` | Install `claude()` wrapper — see [docs/hook.md](docs/hook.md). |
|
|
116
116
|
| `accounts hook uninstall` | Remove hook script. |
|
|
117
117
|
| `accounts hook path` | Print hook script path. |
|
|
@@ -140,7 +140,7 @@ Add it to Claude/Codex/opencode/Cursor MCP config as a command server named
|
|
|
140
140
|
For automatic agent restarts, start the agent through `accounts run`:
|
|
141
141
|
|
|
142
142
|
```bash
|
|
143
|
-
accounts use account001
|
|
143
|
+
accounts use account001
|
|
144
144
|
accounts run claude --resume
|
|
145
145
|
```
|
|
146
146
|
|
|
@@ -157,10 +157,10 @@ handoff behavior and returns a command such as:
|
|
|
157
157
|
Human equivalent:
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
|
-
accounts switch account001 --
|
|
161
|
-
accounts switch account001 --
|
|
162
|
-
accounts switch account001 --
|
|
163
|
-
accounts switch account001 --
|
|
160
|
+
accounts switch account001 --resume
|
|
161
|
+
accounts switch account001 --resume --launch
|
|
162
|
+
accounts switch account001 --resume --permissions dangerous
|
|
163
|
+
accounts switch account001 --supervisor
|
|
164
164
|
accounts switch codex-work --tool codex --resume
|
|
165
165
|
accounts switch ops --tool opencode --resume
|
|
166
166
|
```
|
package/dist/cli.js
CHANGED
|
@@ -43367,11 +43367,11 @@ function importProfile(opts) {
|
|
|
43367
43367
|
ensureProfileAuthSnapshot(profile.dir, tool);
|
|
43368
43368
|
return profile;
|
|
43369
43369
|
}
|
|
43370
|
-
function ensureProfileForLogin(name, toolId
|
|
43370
|
+
function ensureProfileForLogin(name, toolId) {
|
|
43371
43371
|
const existing = findProfileByName(name, toolId);
|
|
43372
43372
|
if (existing)
|
|
43373
43373
|
return existing;
|
|
43374
|
-
return addProfile({ name, tool: toolId, description: "created for login" });
|
|
43374
|
+
return addProfile({ name, tool: toolId ?? DEFAULT_TOOL, description: "created for login" });
|
|
43375
43375
|
}
|
|
43376
43376
|
function findProfileByName(name, toolId) {
|
|
43377
43377
|
try {
|
|
@@ -44002,7 +44002,7 @@ program2.command("add").argument("<name>", "profile name (lowercase, hyphenated)
|
|
|
44002
44002
|
console.log(` config dir: ${p.dir}`);
|
|
44003
44003
|
console.log(` email: ${p.email ?? source_default.dim("(none — set with `accounts set " + p.name + " --email ...`)")}`);
|
|
44004
44004
|
const tool = getTool(p.tool);
|
|
44005
|
-
console.log(source_default.dim(` launch it: accounts launch ${p.name}
|
|
44005
|
+
console.log(source_default.dim(` launch it: accounts launch ${p.name} (sets ${tool.envVar} and runs ${tool.bin})`));
|
|
44006
44006
|
}));
|
|
44007
44007
|
program2.command("list").alias("ls").description("list all profiles").option("-t, --tool <tool>", "filter by tool").option("--json", "output JSON").action(action((opts) => {
|
|
44008
44008
|
const profiles = listProfiles(opts.tool);
|
|
@@ -44067,9 +44067,9 @@ program2.command("import").argument("[name]", "profile name (default: main)").de
|
|
|
44067
44067
|
console.log(source_default.green(`✓ imported profile ${source_default.bold(p.name)}`));
|
|
44068
44068
|
console.log(` config dir: ${p.dir}`);
|
|
44069
44069
|
console.log(` email: ${p.email ?? source_default.dim("(none)")}`);
|
|
44070
|
-
console.log(source_default.dim(` next: accounts login ${p.name}
|
|
44070
|
+
console.log(source_default.dim(` next: accounts login ${p.name} OR accounts apply ${p.name}`));
|
|
44071
44071
|
}));
|
|
44072
|
-
program2.command("login").argument("<name>", "profile name").description("launch the tool's login flow inside an isolated profile dir").option("-t, --tool <tool>", "tool"
|
|
44072
|
+
program2.command("login").argument("<name>", "profile name").description("launch the tool's login flow inside an isolated profile dir").option("-t, --tool <tool>", "tool when creating a missing profile or when the profile name is ambiguous").action(action((name, opts) => {
|
|
44073
44073
|
const profile = ensureProfileForLogin(name, opts.tool);
|
|
44074
44074
|
const tool = getTool(profile.tool);
|
|
44075
44075
|
const env2 = profileEnv(profile, tool);
|
package/dist/index.js
CHANGED
|
@@ -5085,11 +5085,11 @@ function importProfile(opts) {
|
|
|
5085
5085
|
ensureProfileAuthSnapshot(profile.dir, tool);
|
|
5086
5086
|
return profile;
|
|
5087
5087
|
}
|
|
5088
|
-
function ensureProfileForLogin(name, toolId
|
|
5088
|
+
function ensureProfileForLogin(name, toolId) {
|
|
5089
5089
|
const existing = findProfileByName(name, toolId);
|
|
5090
5090
|
if (existing)
|
|
5091
5091
|
return existing;
|
|
5092
|
-
return addProfile({ name, tool: toolId, description: "created for login" });
|
|
5092
|
+
return addProfile({ name, tool: toolId ?? DEFAULT_TOOL, description: "created for login" });
|
|
5093
5093
|
}
|
|
5094
5094
|
function findProfileByName(name, toolId) {
|
|
5095
5095
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-profile.d.ts","sourceRoot":"","sources":["../../src/lib/import-profile.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa;;;;;;;;EAqChD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"import-profile.d.ts","sourceRoot":"","sources":["../../src/lib/import-profile.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa;;;;;;;;EAqChD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;;;;;;;;EAIlE"}
|
package/dist/mcp.js
CHANGED
|
@@ -17619,7 +17619,7 @@ function ok(data) {
|
|
|
17619
17619
|
function fail(message) {
|
|
17620
17620
|
return { content: [{ type: "text", text: JSON.stringify({ error: message }) }], isError: true };
|
|
17621
17621
|
}
|
|
17622
|
-
var server = new Server({ name: "accounts", version: "0.1.
|
|
17622
|
+
var server = new Server({ name: "accounts", version: "0.1.15" }, { capabilities: { tools: {} } });
|
|
17623
17623
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
17624
17624
|
tools: [
|
|
17625
17625
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/accounts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Manage and switch between multiple Claude Code (and other AI coding tool) profiles/accounts locally — isolated config dirs, per-account email, one-command switching.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|