{"_id":"@blutarche/ccauth","_rev":"3-c85700fc0170dbef65f15ab7cb4fdd5e","name":"@blutarche/ccauth","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@blutarche/ccauth","version":"0.1.0","keywords":["claude","claude-code","cli","keychain","account-switcher","profiles","macos"],"license":"MIT","_id":"@blutarche/ccauth@0.1.0","maintainers":[{"name":"blutarche","email":"aikdanai.s@gmail.com"}],"homepage":"https://github.com/blutarche/ccauth#readme","bugs":{"url":"https://github.com/blutarche/ccauth/issues"},"os":["darwin"],"bin":{"ccauth":"dist/cli.js"},"dist":{"shasum":"40ab3dfdb2008ce0b512a17cbd909d88a8627bbf","tarball":"https://registry.npmjs.org/@blutarche/ccauth/-/ccauth-0.1.0.tgz","fileCount":19,"integrity":"sha512-/1Z4IgG4pTvU6fFfZrXDwfcCnzdKsMziFX9WD2vwjJ9v7ka+RpOEF7TLvIVgJM2YT4nmmvWXohFBW6Q/6NVQ9Q==","signatures":[{"sig":"MEUCIQCRSNKaNrA4PK/+M4S4R1Ro4R0hBV0+J9Sed+YfLKxUJAIgLSjT/cabAwkcB+32+RAWtVycHDMTVGPYz0SA2v0iWXA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34387},"type":"module","engines":{"node":">=18"},"gitHead":"9cf773c3e81773f1073445c4b5b0c732d3b32303","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc -p tsconfig.json","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"blutarche","email":"aikdanai.s@gmail.com"},"repository":{"url":"git+https://github.com/blutarche/ccauth.git","type":"git"},"_npmVersion":"11.13.0","description":"Snapshot and switch between multiple Claude Code CLI account logins on macOS.","directories":{},"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.16.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"tmp":"tmp/ccauth_0.1.0_1783637535615_0.1830048059177538","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@blutarche/ccauth","version":"0.2.0","keywords":["claude","claude-code","cli","keychain","account-switcher","profiles","macos"],"license":"MIT","_id":"@blutarche/ccauth@0.2.0","maintainers":[{"name":"blutarche","email":"aikdanai.s@gmail.com"}],"homepage":"https://github.com/blutarche/ccauth#readme","bugs":{"url":"https://github.com/blutarche/ccauth/issues"},"os":["darwin"],"bin":{"ccauth":"dist/cli.js"},"dist":{"shasum":"cfa772ef804c23e45cb82b9b2ee7c6b821f21a90","tarball":"https://registry.npmjs.org/@blutarche/ccauth/-/ccauth-0.2.0.tgz","fileCount":22,"integrity":"sha512-toWAokDmYfC2pFdYGE8aRQTGfJORzACeJtXrASI6/ZFDImEwlbR1zyPBKKdrIozERHFJVL/Ix3eCjUqD/7D+bQ==","signatures":[{"sig":"MEUCIQCnyDQeVB/tNBSskz6xc6DGpuhZJAFkORbpQZLRELlneQIgX3jiNM+LjI4XFQ+9W1i2li1LOB9tWeDEcaJurG+agG8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51416},"type":"module","engines":{"node":">=18"},"gitHead":"ba794987536e6e09f5362e0acf4931bf45b694d5","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc -p tsconfig.json","postbuild":"chmod +x dist/cli.js","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"blutarche","email":"aikdanai.s@gmail.com"},"repository":{"url":"git+https://github.com/blutarche/ccauth.git","type":"git"},"_npmVersion":"11.13.0","description":"Snapshot and switch between multiple Claude Code CLI account logins on macOS.","directories":{},"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.16.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"tmp":"tmp/ccauth_0.2.0_1783708404681_0.7065853351431666","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@blutarche/ccauth","version":"0.3.0","description":"Snapshot and switch between multiple Claude Code CLI account logins on macOS.","type":"module","bin":{"ccauth":"dist/cli.js"},"repository":{"type":"git","url":"git+https://github.com/blutarche/ccauth.git"},"homepage":"https://github.com/blutarche/ccauth#readme","bugs":{"url":"https://github.com/blutarche/ccauth/issues"},"keywords":["claude","claude-code","cli","keychain","account-switcher","profiles","macos"],"engines":{"node":">=18"},"os":["darwin"],"scripts":{"build":"tsc -p tsconfig.json","postbuild":"chmod +x dist/cli.js","prepublishOnly":"npm run build && npm test","test":"vitest run","dev":"tsx src/cli.ts"},"devDependencies":{"@types/node":"^20.14.0","typescript":"^5.5.0","vitest":"^2.0.0","tsx":"^4.16.0"},"license":"MIT","gitHead":"04b82dcac0a2efc98fb5bb70754f0f2bd259a91d","_id":"@blutarche/ccauth@0.3.0","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-oheDMa+awQLKFiY/4lApu9fm4l4nlbyLIQ7Dxh7wFz9AJCyEP8hApE6OlE37umB9mihNBQV/IE9Pw0qHrnADsA==","shasum":"a763458fbf95b3267e55fc9f75e8be7e719a84cc","tarball":"https://registry.npmjs.org/@blutarche/ccauth/-/ccauth-0.3.0.tgz","fileCount":24,"unpackedSize":66413,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDvLR0zi6KfLKmsb1CdFFgpDbyfky0DiPH+6XlEMrSCuwIhAOIQWZACU1XSkvMFggLra+YejSpliNsDaiFtWn3WLXmR"}]},"_npmUser":{"name":"blutarche","email":"aikdanai.s@gmail.com"},"directories":{},"maintainers":[{"name":"blutarche","email":"aikdanai.s@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ccauth_0.3.0_1784044676837_0.2860255818269839"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-09T22:52:15.423Z","modified":"2026-07-14T15:57:57.087Z","0.1.0":"2026-07-09T22:52:15.757Z","0.2.0":"2026-07-10T18:33:24.809Z","0.3.0":"2026-07-14T15:57:56.980Z"},"bugs":{"url":"https://github.com/blutarche/ccauth/issues"},"license":"MIT","homepage":"https://github.com/blutarche/ccauth#readme","keywords":["claude","claude-code","cli","keychain","account-switcher","profiles","macos"],"repository":{"type":"git","url":"git+https://github.com/blutarche/ccauth.git"},"description":"Snapshot and switch between multiple Claude Code CLI account logins on macOS.","maintainers":[{"name":"blutarche","email":"aikdanai.s@gmail.com"}],"readme":"<h1 align=\"center\">ccauth</h1>\n\n<p align=\"center\">\n  You have 10 Claude accounts.<br>\n  You're dreading the inevitable login ritual when one of them runs out of credits.\n</p>\n\n<p align=\"center\"><strong>No more.</strong></p>\n\n<p align=\"center\">\n  <img src=\"assets/demo.gif\" alt=\"ccauth switching accounts inside a live Claude Code session\" width=\"800\"/>\n</p>\n\n```\n$ ccauth use work\nSwitched to profile \"work\".\n```\n\n## Install\n\n```sh\nnpm install -g @blutarche/ccauth\n```\n\nmacOS only. Zero dependencies.\n\n## Usage\n\n```\n$ ccauth save work\nSaved profile \"work\".\n\n$ claude   # /login with another account\n\n$ ccauth save personal\nSaved profile \"personal\".\n\n$ ccauth list\nNAME        EMAIL              ORG        SAVED        EXPIRES\n* personal  me@gmail.com       -          just now     in 29 days\n  work      me@company.com     Acme Inc   2 hours ago  in 3 days ⚠\n\n$ ccauth use work\nSwitched to profile \"work\".\n```\n\n`EXPIRES` counts down each profile's refresh token (`⚠` when it's about to lapse, `expired` once it has). A lapsed profile needs a fresh `claude` `/login`; `ccauth refresh` warms the others without one. `ccauth list --usage` adds usage-quota columns (percent used of the 5-hour and weekly windows, matching Claude's own `/usage` display) fetched read-only from Anthropic's usage API; rows shown as `stale` need a `ccauth refresh` first.\n\n| Command                       | What it does                                              |\n| ----------------------------- | --------------------------------------------------------- |\n| `ccauth save [name]`          | Snapshot the live login (name defaults to email slug)     |\n| `ccauth use <name>`           | Switch the live login to a saved profile                  |\n| `ccauth list` / `ls`          | List profiles + refresh-token expiry; `*` = active, `--all` includes `_autosave`, `--usage` adds usage quota (5h/weekly) |\n| `ccauth current`              | Show the active account and matching profile              |\n| `ccauth refresh [name]`       | Warm a profile's token via `claude` (all profiles if no name; `--force` past a running session) |\n| `ccauth rename <old> <new>`   | Rename a profile                                          |\n| `ccauth remove <name>` / `rm` | Delete a profile (`-y` skips the prompt)                  |\n\n## How it works\n\nClaude Code keeps its OAuth credentials in the macOS Keychain and the account identity in `~/.claude.json`. `ccauth` snapshots both into named profiles (each its own Keychain item — secrets never touch disk) and swaps them back on `use`.\n\nDetails that matter:\n\n- `use` auto-snapshots the current login to `_autosave` first, so a switch is always undoable: `ccauth use _autosave`.\n- The `~/.claude.json` swap is atomic, with a one-time `.bak` on first write.\n- Tokens are moved as opaque blobs — `ccauth` itself never decodes them or touches the network. Expired profile? Claude Code refreshes it on next launch, same as always. The one exception: `ccauth list --usage` uses each stored access token for a single read-only usage query against Anthropic's API - nothing is written or refreshed.\n- `ccauth refresh` warms a stored profile by swapping it live and running one throwaway `claude -p`, letting the genuine Claude Code client refresh and rotate its own token; `ccauth` re-captures the result and restores your original login. It can't extend a refresh token past its ~30-day login window — only a real `/login` resets that — so it's a \"make a stale-but-not-dead profile just work\" convenience, not a keep-alive.\n- Profiles are keyed by account *and* organization, so the same account in two orgs is two distinct profiles.\n- If `claude` is running during a switch, restart it — it caches credentials in memory.\n\n## Development\n\n```sh\nnpm run build     # tsc → dist/\nnpm test          # vitest, runs on fakes — no Keychain needed\n```\n\nIntegration test against the real Keychain (touches only `ccauth:__test__`): `CCAUTH_INTEGRATION=1 npm test`.\n\n## License\n\nMIT\n\n---\n\n<p align=\"center\">\n  <sub><i>Cuz there ain't no way I'm paying the extra usage rate buh.</i></sub>\n</p>\n","readmeFilename":"README.md"}