@hasna/accounts 0.1.5 → 0.1.7
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 +29 -4
- package/dist/cli.js +35110 -27
- package/dist/index.js +81 -16
- package/dist/lib/agents.d.ts +37 -0
- package/dist/lib/agents.d.ts.map +1 -0
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/claude-auth.d.ts +9 -1
- package/dist/lib/claude-auth.d.ts.map +1 -1
- package/dist/lib/tools.d.ts.map +1 -1
- package/dist/mcp.js +82 -17
- package/dist/storage.d.ts +74 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4336 -0
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @hasna/accounts
|
|
2
2
|
|
|
3
3
|
> Manage and switch between multiple AI coding tool profiles/accounts on one
|
|
4
|
-
> machine — Claude Code, Codex CLI,
|
|
5
|
-
> Build, and custom tools.
|
|
4
|
+
> machine — Claude Code, Takumi, Codex CLI, Gemini CLI, opencode, Cursor
|
|
5
|
+
> Agent, Pi Coding Agent, Hermes, Kimi Code, Grok Build, and custom tools.
|
|
6
6
|
|
|
7
7
|
`accounts` is a local-first CLI. Each **profile** is an isolated config directory.
|
|
8
8
|
Switch **in the terminal** with `CLAUDE_CONFIG_DIR`, or **in Cursor / VS Code** with
|
|
@@ -11,8 +11,9 @@ Switch **in the terminal** with `CLAUDE_CONFIG_DIR`, or **in Cursor / VS Code**
|
|
|
11
11
|
- **Isolated profiles** — separate config dirs (skills, settings, sessions). Nothing leaks.
|
|
12
12
|
- **Apply mode** — sync OAuth / credentials to live paths for IDEs (Claude-only today).
|
|
13
13
|
- **Remembers the email** — auto-detected from `.claude.json` when possible.
|
|
14
|
-
- **Multi-tool** — first-class built-ins for Claude,
|
|
15
|
-
Kimi Code, and Grok Build; custom tools
|
|
14
|
+
- **Multi-tool** — first-class built-ins for Claude, Takumi, Codex, Gemini,
|
|
15
|
+
opencode, Cursor Agent, Pi, Hermes, Kimi Code, and Grok Build; custom tools
|
|
16
|
+
via `accounts tools add`.
|
|
16
17
|
- **Per-tool names** — `work` can exist for Claude, Codex, Cursor, etc.; pass
|
|
17
18
|
`--tool` when a bare profile name is ambiguous.
|
|
18
19
|
- **Local-first** — registry at `~/.hasna/accounts/`. No network, no telemetry.
|
|
@@ -114,6 +115,7 @@ Implementation details: [docs/IMPLEMENT.md](docs/IMPLEMENT.md).
|
|
|
114
115
|
| `accounts hook install` | Install `claude()` wrapper — see [docs/hook.md](docs/hook.md). |
|
|
115
116
|
| `accounts hook uninstall` | Remove hook script. |
|
|
116
117
|
| `accounts hook path` | Print hook script path. |
|
|
118
|
+
| `accounts agents` | List Claude agent sessions across **all** profiles (`claude agents` only shows the current account). `--background`, `--profile <name>`, `--json`. |
|
|
117
119
|
| `accounts detect <name>` | Re-detect email from config dir. |
|
|
118
120
|
| `accounts doctor` | Check registry and dirs (exits 1 on errors). |
|
|
119
121
|
|
|
@@ -192,14 +194,37 @@ then invokes the real `claude` binary. Full behavior and footguns: [docs/hook.md
|
|
|
192
194
|
|
|
193
195
|
Overrides: `ACCOUNTS_HOME`, `ACCOUNTS_STORE_PATH`.
|
|
194
196
|
|
|
197
|
+
The native storage API is available from `@hasna/accounts/storage`. It exposes
|
|
198
|
+
the local registry paths, snapshot helpers, and optional S3 registry sync for
|
|
199
|
+
internal cross-machine use:
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
import { getAccountsStorageStatus, storagePush } from "@hasna/accounts/storage";
|
|
203
|
+
|
|
204
|
+
console.log(getAccountsStorageStatus().local.storePath);
|
|
205
|
+
await storagePush();
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Remote sync uses service-owned S3 env names and only syncs the accounts registry
|
|
209
|
+
JSON by default; auth snapshots stay local.
|
|
210
|
+
|
|
211
|
+
- `HASNA_ACCOUNTS_STORAGE_MODE=local|remote|hybrid`
|
|
212
|
+
- `HASNA_ACCOUNTS_S3_BUCKET=hasna-xyz-opensource-accounts-prod`
|
|
213
|
+
- `HASNA_ACCOUNTS_S3_PREFIX=accounts/`
|
|
214
|
+
- `HASNA_ACCOUNTS_AWS_REGION=us-east-1`
|
|
215
|
+
|
|
195
216
|
## Supported tools
|
|
196
217
|
|
|
197
218
|
| Tool | id | Env var | Default dir |
|
|
198
219
|
|------|----|---------|-------------|
|
|
199
220
|
| Claude Code | `claude` | `CLAUDE_CONFIG_DIR` | `~/.claude` |
|
|
221
|
+
| Takumi | `takumi` | `TAKUMI_CONFIG_DIR` | `~/.takumi` |
|
|
200
222
|
| Codex CLI | `codex` | `CODEX_HOME` | `~/.codex` |
|
|
223
|
+
| Gemini CLI | `gemini` | `GEMINI_CONFIG_DIR` | `~/.gemini` |
|
|
201
224
|
| opencode | `opencode` | `OPENCODE_CONFIG_DIR`, `XDG_CONFIG_HOME`, `XDG_DATA_HOME` | `~/.config/opencode` |
|
|
202
225
|
| Cursor Agent | `cursor` | `CURSOR_CONFIG_DIR` | `~/.cursor` |
|
|
226
|
+
| Pi Coding Agent | `pi` | `PI_CODING_AGENT_HOME` | `~/.pi` |
|
|
227
|
+
| Hermes | `hermes` | `HERMES_HOME` | `~/.hermes` |
|
|
203
228
|
| Kimi Code | `kimi` | `KIMI_CODE_HOME` | `~/.kimi-code` |
|
|
204
229
|
| Grok Build | `grok` | `HOME` (process-scoped) | `~/.grok` |
|
|
205
230
|
|