{"_id":"@cungnguyen/claude-switch","name":"@cungnguyen/claude-switch","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@cungnguyen/claude-switch","version":"0.2.0","description":"CLI profile manager for switching between Claude configurations.","type":"module","bin":{"claude-switch":"dist/cli.js"},"scripts":{"build":"tsc -p tsconfig.json","dev":"tsx src/cli.ts","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit -p tsconfig.json"},"keywords":["claude","cli","profiles","anthropic","switcher"],"devDependencies":{"@types/node":"^25.5.0","tsx":"^4.21.0","typescript":"^6.0.2","vitest":"^4.1.2"},"license":"MIT","engines":{"node":">=18.18"},"optionalDependencies":{"keytar":"^7.9.0"},"publishConfig":{"access":"public"},"_id":"@cungnguyen/claude-switch@0.2.0","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-aWvTy0fQJlZZxaNCLk6t/ePuZOwxaU9yZ8LajFZMP5YupQWlmN/gEBKQHbiU6vH8CfSK4UddUtWZ2sJEYessMw==","shasum":"bec5458727d67229348dbd45889105ef7eb17ab1","tarball":"https://registry.npmjs.org/@cungnguyen/claude-switch/-/claude-switch-0.2.0.tgz","fileCount":66,"unpackedSize":123983,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD6zZQGwu5QD7ew3bDFGcD+A0qBZnwWuHrS0j0+selB0AIhAIXsncICyqcpkiHz4oHEAm/hXYDusiZyNFEv5uc/GmTM"}]},"_npmUser":{"name":"cungnguyen","email":"cungns1990@gmail.com"},"directories":{},"maintainers":[{"name":"cungnguyen","email":"cungns1990@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-switch_0.2.0_1775029691625_0.14049913343156728"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-01T07:48:11.556Z","0.2.0":"2026-04-01T07:48:11.779Z","modified":"2026-04-01T07:48:11.937Z"},"maintainers":[{"name":"cungnguyen","email":"cungns1990@gmail.com"}],"description":"CLI profile manager for switching between Claude configurations.","keywords":["claude","cli","profiles","anthropic","switcher"],"license":"MIT","readme":"# claude-switch\n\n`claude-switch` is a CLI-first profile manager for Claude settings. It helps users save multiple Claude profiles, switch the active `~/.claude/settings.json`, and run commands with a temporary profile without overwriting global config.\n\n## MVP features\n\n- `init` local profile storage\n- `add` interactive profile creation\n- `list` saved profiles\n- `use <profile>` to rewrite Claude settings\n- `current` active profile summary\n- `remove <profile>` cleanup\n- `doctor` environment checks\n- `run <profile> -- <command>` temporary env injection\n\n## Install\n\n### Global CLI (recommended)\n\nFrom the package folder after build:\n\n```bash\nnpm install\nnpm run build\nnpm link\n```\n\nThen use `claude-switch` from any terminal:\n\n```bash\nclaude-switch paths\nclaude-switch help\n```\n\nAfter you publish to npm, users run:\n\n```bash\nnpm install -g @cungnguyen/claude-switch\n```\n\n### Local development\n\n```bash\nnpm install\nnpm run build\nnode dist/cli.js help\n```\n\nOr:\n\n```bash\nnpm run dev -- help\n```\n\n## Example workflow\n\n### Named profile + key (global-style, no prompts)\n\nEach **profile** is one named use case (work, personal, client A, …) with its own token (key):\n\n```bash\nclaude-switch init\nclaude-switch add work --token \"YOUR_KEY\" --provider claude-proxy --base-url \"https://your-api.example.com\"\nclaude-switch add personal --token \"OTHER_KEY\" --provider anthropic\nclaude-switch list\nclaude-switch use cong-ty\n```\n\nUpdate only the key for a profile:\n\n```bash\nclaude-switch set-token cong-ty --token \"NEW_KEY\"\n```\n\nPipe token (scripting):\n\n```bash\necho \"YOUR_KEY\" | claude-switch set-token ca-nhan\n```\n\n### Interactive (prompts)\n\n```bash\nnpm run dev -- init\nnpm run dev -- add work\nnpm run dev -- list\nnpm run dev -- use work\nnpm run dev -- run work -- claude\n```\n\n## Global data directory\n\nBy default everything lives under `~/.claude-switch/` (profiles, backups, optional legacy `tokens.json`).\n\nOverride the base directory (portable disk, one folder for all “cases”):\n\n```bash\nset CLAUDE_SWITCH_HOME=D:\\configs\\claude-switch\nclaude-switch paths\n```\n\nOn macOS/Linux:\n\n```bash\nexport CLAUDE_SWITCH_HOME=\"$HOME/.config/claude-switch\"\n```\n\n## Storage\n\nMetadata lives in:\n\n- `~/.claude-switch/profiles.json`\n\nTokens use **OS credential storage** when the optional [`keytar`](https://www.npmjs.com/package/keytar) native module is installed (Windows Credential Manager, macOS Keychain, or libsecret on Linux). `keytar` is listed as an `optionalDependency`; if it fails to build or is omitted, tokens fall back to:\n\n- `~/.claude-switch/tokens.json` (plain JSON, not ideal for production)\n\nWhen both are available, legacy entries in `tokens.json` are **migrated on first use** and then removed from the file for that profile.\n\nService name for OS storage: `claude-switch`.\n\n## Supported Claude config\n\nThe first version targets a Claude settings file shaped like:\n\n```json\n{\n  \"env\": {\n    \"ANTHROPIC_AUTH_TOKEN\": \"...\",\n    \"ANTHROPIC_BASE_URL\": \"https://your-proxy-or-api.example.com\"\n  }\n}\n```\n\n`use <profile>` preserves unrelated settings and updates only the relevant `env` keys.\n\n## Publish checklist\n\n- Add masked secret input instead of visible token entry.\n- Add richer argument parsing and shell completion.\n- Add cross-platform path coverage for macOS/Linux.\n- Validate against more Claude config variants.\n","readmeFilename":"README.md","_rev":"1-266cc6c0115316769f3ac14eec65b8a6"}