claude-switcher-account 2.1.0

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/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "claude-switcher-account",
3
+ "version": "2.1.0",
4
+ "description": "Switch between multiple Claude Code accounts from the terminal — save every login, swap in one command, no re-authenticating. macOS, Linux, Windows.",
5
+ "keywords": [
6
+ "claude",
7
+ "claude-code",
8
+ "claude-code-cli",
9
+ "anthropic",
10
+ "account-switcher",
11
+ "switch-account",
12
+ "multiple-accounts",
13
+ "multi-account",
14
+ "login-switcher",
15
+ "profile-manager",
16
+ "credentials",
17
+ "keychain",
18
+ "cli",
19
+ "developer-tools"
20
+ ],
21
+ "homepage": "https://github.com/khainguyenhm-itr/claude-switcher-account#readme",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/khainguyenhm-itr/claude-switcher-account.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/khainguyenhm-itr/claude-switcher-account/issues"
28
+ },
29
+ "license": "MIT",
30
+ "author": "khainguyenhm-itr",
31
+ "type": "module",
32
+ "bin": {
33
+ "claudep": "dist/bin.js"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "scripts/postinstall.mjs"
38
+ ],
39
+ "engines": {
40
+ "node": ">=18"
41
+ },
42
+ "scripts": {
43
+ "build": "tsup src/bin.ts --format esm --target node18 --clean",
44
+ "prepare": "npm run build",
45
+ "postinstall": "node scripts/postinstall.mjs",
46
+ "prepublishOnly": "npm run typecheck && npm test",
47
+ "test": "vitest run --coverage",
48
+ "test:watch": "vitest",
49
+ "typecheck": "tsc --noEmit"
50
+ },
51
+ "dependencies": {
52
+ "commander": "^15.0.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^22.0.0",
56
+ "@vitest/coverage-v8": "^4.1.10",
57
+ "tsup": "^8.5.1",
58
+ "typescript": "^5.6.0",
59
+ "vitest": "^4.1.10"
60
+ }
61
+ }
@@ -0,0 +1,25 @@
1
+ // Best-effort: on a global install, turn on the instant-capture daemon so the user
2
+ // doesn't have to run `claudep daemon install` by hand. Never fails the install.
3
+ // Opt out with CLAUDE_P_NO_DAEMON=1. Undo any time with `claudep daemon uninstall`.
4
+ import { existsSync } from 'node:fs';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { dirname, join } from 'node:path';
7
+ import { spawnSync } from 'node:child_process';
8
+
9
+ const skip =
10
+ process.env.npm_config_global !== 'true' || // only for `npm i -g`, never local dev installs
11
+ process.env.CI ||
12
+ process.env.CLAUDE_P_NO_DAEMON ||
13
+ !['darwin', 'linux', 'win32'].includes(process.platform);
14
+
15
+ if (!skip) {
16
+ const bin = join(dirname(fileURLToPath(import.meta.url)), '..', 'dist', 'bin.js');
17
+ if (existsSync(bin)) {
18
+ try {
19
+ spawnSync(process.execPath, [bin, 'daemon', 'install'], { stdio: 'inherit', timeout: 20000 });
20
+ } catch {
21
+ /* best-effort — never break the install */
22
+ }
23
+ }
24
+ }
25
+ process.exit(0);