{"_id":"@adrianr84/claude-code-provider-switch","_rev":"5-806361d7b9f4021cd4f317cf4d5207dc","name":"@adrianr84/claude-code-provider-switch","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@adrianr84/claude-code-provider-switch","version":"1.0.0","keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","cli"],"author":{"name":"Adrian R"},"license":"MIT","_id":"@adrianr84/claude-code-provider-switch@1.0.0","maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"bin":{"cs":"bin/claude-switch.js","claude-switch":"bin/claude-switch.js"},"dist":{"shasum":"59f12a641e2b149221662fc823a33f91e34cf6df","tarball":"https://registry.npmjs.org/@adrianr84/claude-code-provider-switch/-/claude-code-provider-switch-1.0.0.tgz","fileCount":15,"integrity":"sha512-ya78ZGoIVmf9UMdGAF8lCI8nfTWUgy2S9J1XWUd7vkuoiquspnVfi59iqXXXKAgVcFCVqmi62ozlwL+g5PgpFw==","signatures":[{"sig":"MEUCIQCt7/jyuNAEah9ELSRl1/8afD1jBJa0XdyWhdNGrnHiDAIgFUk6tMtUlMuWExTXQNB1+LXuKbWiNTNyDCHC4QtX/l0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142840},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"ae3bb9a614a7015a7b3d50943675d6a95601e221","scripts":{"dev":"node bin/claude-switch.js","pub":"npm version patch && npm publish --access public && git push origin main --tags","link":"npm link","start":"node bin/claude-switch.js","deploy":"npm publish --access public && echo '✅ Deployed to npm!'","unlink":"npm unlink -g @adrianr84/claude-code-provider-switch","test:all":"node test/run-tests.js","pub-major":"npm version major && npm publish --access public && git push origin main --tags","pub-minor":"npm version minor && npm publish --access public && git push origin main --tags","test:provider":"node test/test-provider-integration.js","test:validation":"node test/test-validation-errors.js","test:comprehensive":"node test/test-comprehensive.js"},"_npmUser":{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"},"repository":{"url":"git+https://github.com/adrianR84/claude-code-provider-switch.git","type":"git"},"_npmVersion":"11.5.1","description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","directories":{},"_nodeVersion":"24.7.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-provider-switch_1.0.0_1775814524976_0.2330704678920994","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@adrianr84/claude-code-provider-switch","version":"1.0.3","keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","cli"],"author":{"name":"Adrian R"},"license":"MIT","_id":"@adrianr84/claude-code-provider-switch@1.0.3","maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"bin":{"cs":"bin/claude-switch.js","claude-switch":"bin/claude-switch.js"},"dist":{"shasum":"bc22b9b3f34d24765e06cbe101d919e0806a0fe4","tarball":"https://registry.npmjs.org/@adrianr84/claude-code-provider-switch/-/claude-code-provider-switch-1.0.3.tgz","fileCount":15,"integrity":"sha512-J0Uq6ehtIksEqHUIKAlzOu+ED1xN16YjF8ZwRMaRtoHmOYVP5QCK4z1Q1rcSU9Jh3kr45qFjfvqTn7aWBa4auA==","signatures":[{"sig":"MEUCIAgOf6ClH2aLUDycGNXJtgDrQ4E19AYqozL9Wj8B8rAJAiEAk3Og096v2jyGtd1toH3XEhJigHOYEM2jXC7qMp3tjkg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142840},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"bd9517269fa96367859e575f9e35b6e8f21d37b1","scripts":{"dev":"node bin/claude-switch.js","pub":"npm version patch && npm publish --access public && git push origin main --tags","link":"npm link","start":"node bin/claude-switch.js","deploy":"npm publish --access public && echo '✅ Deployed to npm!'","unlink":"npm unlink -g @adrianr84/claude-code-provider-switch","test:all":"node test/run-tests.js","pub-major":"npm version major && npm publish --access public && git push origin main --tags","pub-minor":"npm version minor && npm publish --access public && git push origin main --tags","test:provider":"node test/test-provider-integration.js","test:validation":"node test/test-validation-errors.js","test:comprehensive":"node test/test-comprehensive.js"},"_npmUser":{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"},"repository":{"url":"git+https://github.com/adrianR84/claude-code-provider-switch.git","type":"git"},"_npmVersion":"11.5.1","description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","directories":{},"_nodeVersion":"24.7.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-provider-switch_1.0.3_1775815331254_0.18753889557311654","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@adrianr84/claude-code-provider-switch","version":"1.0.4","keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","claude code Minimax","cli"],"author":{"name":"Adrian R"},"license":"MIT","_id":"@adrianr84/claude-code-provider-switch@1.0.4","maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"bin":{"cs":"bin/claude-switch.js","claude-switch":"bin/claude-switch.js"},"dist":{"shasum":"0c99f9c140fc88423ab8716f6bc6953633a5941f","tarball":"https://registry.npmjs.org/@adrianr84/claude-code-provider-switch/-/claude-code-provider-switch-1.0.4.tgz","fileCount":15,"integrity":"sha512-H3iWkRgvB0hVw0hloDs2S4MDVB6OCJk95BF1ZY53V/VIJ934scodKBeCwy9z5K01atAlBGCVwuoFDFc9fOESEQ==","signatures":[{"sig":"MEQCIBmURtQ39Pjhwr6NFuyDMT3DKt3qxRpbbaKslh4Qf9X8AiBvh8sMxI2AdLvYbQVKt6EfRRG157VQh2P3wgI6jTpumQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":142876},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"1d44cfd56670e63d1732366fa3fa9eb0be3c1dc4","scripts":{"dev":"node bin/claude-switch.js","pub":"npm version patch && npm publish --access public && git push origin main --tags","link":"npm link","start":"node bin/claude-switch.js","deploy":"npm publish --access public && echo '✅ Deployed to npm!'","unlink":"npm unlink -g @adrianr84/claude-code-provider-switch","test:all":"node test/run-tests.js","pub-major":"npm version major && npm publish --access public && git push origin main --tags","pub-minor":"npm version minor && npm publish --access public && git push origin main --tags","test:provider":"node test/test-provider-integration.js","test:validation":"node test/test-validation-errors.js","test:comprehensive":"node test/test-comprehensive.js"},"_npmUser":{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"},"repository":{"url":"git+https://github.com/adrianR84/claude-code-provider-switch.git","type":"git"},"_npmVersion":"11.5.1","description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","directories":{},"_nodeVersion":"24.7.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-provider-switch_1.0.4_1776341246692_0.06968945961705342","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@adrianr84/claude-code-provider-switch","version":"1.0.6","keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","claude code Minimax","cli"],"author":{"name":"Adrian R"},"license":"MIT","_id":"@adrianr84/claude-code-provider-switch@1.0.6","maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"bin":{"cs":"bin/claude-switch.js","claude-switch":"bin/claude-switch.js"},"dist":{"shasum":"0bdbd9d3cff4d52d00d0353f7fac44326c342498","tarball":"https://registry.npmjs.org/@adrianr84/claude-code-provider-switch/-/claude-code-provider-switch-1.0.6.tgz","fileCount":15,"integrity":"sha512-YcxlcuBsHSWEBGe42jQF9D1Gb7jOlL14hSD4Q0J3xLeJWDU/KKiLrf7sE/7+GJnII8dKW7jyNzuyjzKVhedIAw==","signatures":[{"sig":"MEQCIBualaXRY28zGJUsCzcy5fhT0PW8Gn+OF2aywz4Hnwl5AiBXEBVZpYbytMS8IlUdrt/5MvcNEQwmF3y6mEmzpE8b/w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":145342},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"d2a6851325da8a1732d7d24b917a22fb5000616a","scripts":{"dev":"node bin/claude-switch.js","pub":"npm version patch && npm publish --access public && git push origin main --tags","link":"npm link","start":"node bin/claude-switch.js","deploy":"npm publish --access public && echo '✅ Deployed to npm!'","unlink":"npm unlink -g @adrianr84/claude-code-provider-switch","test:all":"node test/run-tests.js","pub-major":"npm version major && npm publish --access public && git push origin main --tags","pub-minor":"npm version minor && npm publish --access public && git push origin main --tags","test:provider":"node test/test-provider-integration.js","test:validation":"node test/test-validation-errors.js","test:comprehensive":"node test/test-comprehensive.js"},"_npmUser":{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"},"repository":{"url":"git+https://github.com/adrianR84/claude-code-provider-switch.git","type":"git"},"_npmVersion":"11.5.1","description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","directories":{},"_nodeVersion":"24.7.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/claude-code-provider-switch_1.0.6_1777449709285_0.46893576305321405","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@adrianr84/claude-code-provider-switch","version":"1.0.7","description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","main":"index.js","bin":{"claude-switch":"bin/claude-switch.js","cs":"bin/claude-switch.js"},"scripts":{"start":"node bin/claude-switch.js","dev":"node bin/claude-switch.js","link":"npm link","unlink":"npm unlink -g @adrianr84/claude-code-provider-switch","pub":"npm version patch && npm publish --access public && git push origin main --tags","pub-minor":"npm version minor && npm publish --access public && git push origin main --tags","pub-major":"npm version major && npm publish --access public && git push origin main --tags","deploy":"npm publish --access public && echo '✅ Deployed to npm!'","test:validation":"node test/test-validation-errors.js","test:provider":"node test/test-provider-integration.js","test:comprehensive":"node test/test-comprehensive.js","test:all":"node test/run-tests.js"},"keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","claude code Minimax","cli"],"author":{"name":"Adrian R"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adrianR84/claude-code-provider-switch.git"},"homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"engines":{"node":">=14.0.0"},"preferGlobal":true,"dependencies":{"terminal-menu":"^2.1.1"},"_id":"@adrianr84/claude-code-provider-switch@1.0.7","gitHead":"9827ea03e02010e3383c2901724a1a60f7f0b93d","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-9uZT2RrqCJEAqxj5ws+1i/AAgH4kz2+ocmxP8mUmjmJHVGTaIbdG6oalkPDdfXKxxqfmtgOEd8E11O0H+mSCKQ==","shasum":"7dc0c3c7a17513085a226312a0478890065aa09e","tarball":"https://registry.npmjs.org/@adrianr84/claude-code-provider-switch/-/claude-code-provider-switch-1.0.7.tgz","fileCount":18,"unpackedSize":138774,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD9NXeEbahKrVJGJ8OquwOCcPg/SP/BV/QqIZYb5lVdjQIgF7wU1WuEmFKRfDJ9OjV8mojjO0HZoVoiQ9HnjXQPeNY="}]},"_npmUser":{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"},"directories":{},"maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-code-provider-switch_1.0.7_1782677079337_0.21370270966426563"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T09:48:44.909Z","modified":"2026-06-28T20:04:39.586Z","1.0.0":"2026-04-10T09:48:45.158Z","1.0.3":"2026-04-10T10:02:11.383Z","1.0.4":"2026-04-16T12:07:26.832Z","1.0.6":"2026-04-29T08:01:49.429Z","1.0.7":"2026-06-28T20:04:39.474Z"},"bugs":{"url":"https://github.com/adrianR84/claude-code-provider-switch/issues"},"author":{"name":"Adrian R"},"license":"MIT","homepage":"https://github.com/adrianR84/claude-code-provider-switch#readme","keywords":["claude-code","claude code provider switcher","claude code model switcher","claude code llm switcher","claude code llm provider switcher","ai provider switcher","claude code ai model switcher","claude code ai model provider switcher","claude code OpenRouter","claude code Ollama","claude code Minimax","cli"],"repository":{"type":"git","url":"git+https://github.com/adrianR84/claude-code-provider-switch.git"},"description":"Cross-platform Claude Code provider switcher (OpenRouter, Ollama, Minimax, Anthropic)","maintainers":[{"name":"adrianr84","email":"narcotic.pill.a@gmail.com"}],"readme":"# Claude Code Provider Switcher\n\nA powerful CLI tool that lets you seamlessly switch between different AI providers for Claude Code, including OpenRouter, Anthropic, MiniMax, Ollama, Claude Code Proxy, and the original Claude Code configuration.\n\n## Command Aliases\n\n> **Quick Tip**: Use `cs` as a shorter alias instead of typing `claude-switch`!\n>\n> ```bash\n> # Both commands work the same:\n> claude-switch openrouter\n> cs openrouter  # Much shorter!\n> ```\n\n## 🚀 Features\n\n- **Multi-Provider Support**: Switch between OpenRouter, Anthropic, MiniMax, Ollama, Claude Code Proxy, and original Claude Code\n- **Enhanced Interactive Menu**: Beautiful, intuitive interface with visual hierarchy and icons\n- **Centralized Configuration**: Secure, centralized base URL management for all providers\n- **Security-First**: Explicit base URL configuration prevents URL hijacking attacks\n- **Default Configuration**: Set and save your preferred provider and model\n- **Model Selection**: Choose from hundreds of models across different providers\n- **Auto-Restart**: Automatically restarts with new configuration after changes\n- **Cross-Platform**: Works on Windows, macOS, and Linux\n- **Global Installation**: Install once and use anywhere\n\n## 📦 Installation\n\n### Prerequisites\n\nFirst, ensure you have [Claude Code](https://docs.anthropic.com/en/docs/claude-code/quickstart) installed.\n\n```bash\nnpm install -g @anthropic-ai/claude-code\n```\n\n### Global Installation (Method 1)\n\n```bash\n# Install globally\nnpm install -g @adrianr84/claude-code-provider-switch\n```\n\n### Global Installation (Method 2 - Alternative)\n\n```bash\n# Clone the repository\ngit clone https://github.com/adrianR84/claude-code-provider-switch.git\ncd claude-code-provider-switch\n\n# Install globally\nnpm install -g .\n\n# Or use npm link for development (changes are immediate)\nnpm run link\n```\n\n## 🎯 Quick Start\n\n### Basic Usage\n\n```bash\n# Show interactive menu with enhanced visual interface\nclaude-switch ui\ncs ui  # Much shorter!\n\n# Use a specific provider\nclaude-switch openrouter\ncs openrouter  # Much shorter!\nclaude-switch anthropic\ncs anthropic  # Much shorter!\nclaude-switch minimax\ncs minimax  # Much shorter!\nclaude-switch ollama\ncs ollama  # Much shorter!\nclaude-switch original\ncs original  # Much shorter!\n\n# Use specific provider with model selection\nclaude-switch openrouter --model\ncs openrouter --model  # Much shorter!\nclaude-switch minimax --model\ncs minimax --model  # Much shorter!\n```\n\n### Enhanced Menu Interface\n\nWhen you run `claude-switch ui`, you'll see a beautifully formatted interactive menu:\n\n```\nClaude Code Provider Switcher\n\nConfiguration: Global (~/.claude/.claude-switch-env)\n\nCurrent default: OpenRouter ⭐ [DEFAULT] (openrouter/free)\n\nAvailable providers:\n\n❯ 1) OpenRouter ⭐ [DEFAULT] ── (openrouter, or, open)\n  2) Ollama ── (ollama, oll)\n  3) Minimax ── (minimax, min, mm)\n  4) Anthropic ── (anthropic, ant)\n  5) Original Claude Code ── (original, orig, def, d)\n──────────────────────────────────────────────────────────\n  6) ⚙️ Set as Default\n  7) 🔑 Manage API Keys\n  8) ❓ Help\n\n🎯 Navigation:\n  • Use ↑/↓ arrows to navigate options\n  • Press Enter to select highlighted option\n  • Press 1-8 for quick select\n  • Press ESC to exit\n\n⭐ Tips:\n  • ⭐ indicates your current default provider\n  • 🌐 Providers: Launch AI models with different services\n  • 🔸 Management: Configure settings and preferences\n```\n\n### Configuration Management\n\n```bash\n# Set up default provider and model interactively\nclaude-switch set-default\ncs set-default  # Much shorter!\n\n# View current defaults\nclaude-switch show-defaults\ncs show-defaults  # Much shorter!\n\n# Clear all defaults\nclaude-switch clear-defaults\ncs clear-defaults  # Much shorter!\n\n# Manage API keys interactively\nclaude-switch api-keys\ncs api-keys  # Much shorter!\n```\n\n## ⚙️ Configuration\n\n### Security & Centralization\n\nThe CLI now features **centralized base URL management** for enhanced security:\n\n- **🔒 Secure**: All providers use explicitly configured base URLs from `constants.js`\n- **🛡️ Anti-Hijacking**: Prevents URL hijacking through malicious environment variables\n- **📍 Centralized**: Single source of truth for all provider configurations\n- **✅ Consistent**: Uniform behavior across all providers\n\n### Environment Variables\n\nThe CLI is designed to create a `~/.claude/.claude-switch-env` (in your home directory) with this syntax:\n\n```bash\n# API Keys for different providers\nOPENROUTER_AUTH_TOKEN=your_openrouter_token_here\nANTHROPIC_API_KEY=your_anthropic_key_here\nMINIMAX_AUTH_TOKEN=your_minimax_token_here\nOLLAMA_AUTH_TOKEN=your_ollama_token_here\n\n# Optional: Default models for each provider\nOPENROUTER_MODEL=openrouter/free\nOLLAMA_MODEL=minimax-m2.5:cloud\nANTHROPIC_MODEL=claude-3-5-sonnet-latest\nMINIMAX_MODEL=minimax-m2.7\n\n# Default provider and model settings\nDEFAULT_PROVIDER=default  # Use 'default' to show menu on startup, or set to 'openrouter', 'anthropic', 'minimax', 'ollama', or 'original'\nDEFAULT_MODEL=\n```\n\nWhen you run the CLI for the first time, based on your selection, it will ask for the API keys or Auth Tokens and after this will be saved in the environment file for future use.\n\n### Global vs Local Configuration\n\nThe CLI supports two configuration modes:\n\n#### Global Configuration (Default)\n\n- **Location**: `~/.claude/.claude-switch-env` (in your home directory)\n- **Priority**: Used when no local environment file exists\n- **Benefit**: Share configuration across all projects\n- **Creation**: Automatically created on first run when no local environment file exists\n\n#### Local Configuration\n\n- **Location**: `.claude-switch-env-local` file in your project directory\n- **Priority**: Overrides global configuration when present\n- **Benefit**: Project-specific settings\n- **Creation**: Create manually or use \"Save Configuration Locally\" menu option\n\n#### Configuration Display\n\nThe main menu shows which configuration source is active:\n\n```\nConfiguration: Global (~/.claude/.claude-switch-env)\nConfiguration: Local (current_folder/.claude-switch-env-local)\n```\n\n#### Menu Behavior\n\n- **No defaults set**: Shows interactive menu for provider selection\n- **Defaults set**: Auto-launches with configured provider\n- **Fresh install**: Always shows menu until you set defaults\n\n#### Switching Between Modes\n\n- **To Local**: Use \"Save Configuration Locally\" option from main menu\n- **To Global**: Delete local `.claude-switch-env-local` file to fall back to global config\n- **Priority**: Local always takes precedence over global when both exist\n\n### API Key Management\n\nFor easier API key management, use the interactive menu:\n\n```bash\n# Launch interactive API key management\nclaude-switch api-keys\ncs api-keys  # Much shorter!\n```\n\nOr access it through the main menu (option 6) when you run `claude-switch` without arguments.\n\n**Features:**\n\n- 🔐 **Secure**: API keys are masked for display (shows only first 4 and last 4 characters)\n- 🎯 **Visual**: Clear status indicators (✅/❌) show which providers have keys configured\n- ⚡ **Interactive**: Arrow key navigation with visual selection indicators and icons\n- 🔄 **Flexible**: Update, remove, or set new API keys interactively\n- 🎨 **Enhanced UI**: Beautiful menu with visual hierarchy and intuitive navigation\n\n### Provider Setup\n\n#### OpenRouter\n\n1. Get your API key from [OpenRouter](https://openrouter.ai/keys)\n2. Run `claude-switch ui` to set the API key interactively\n3. Select OpenRouter from the menu to browse and choose available models\n\n#### Anthropic\n\n1. Get your API key from [Anthropic Console](https://console.anthropic.com/)\n2. Run `claude-switch ui` to set the API key interactively\n3. Select Anthropic from the menu to browse and choose available models\n\n#### MiniMax\n\n1. Get your API key from [MiniMax Console](https://minimax.io/)\n2. Run `claude-switch ui` to set the API key interactively\n3. Select MiniMax from the menu to browse and choose available minimal models\n\n#### Ollama\n\n1. Install and run [Ollama](https://ollama.ai/)\n2. Run `claude-switch ui` to set the API key interactively (optional, for remote instances)\n3. Select Ollama from the menu to see locally available models\n\n#### Claude Code Proxy\n\nUse Claude Code with OpenAI, Gemini, or other LiteLLM backends through a local proxy server.\n\n1. Install the proxy server:\n\n   **Docker (recommended):**\n   ```bash\n   git clone https://github.com/1rgs/claude-code-proxy.git\n   cd claude-code-proxy\n   cp .env.example .env\n   # Edit .env: set OPENAI_API_KEY (required), GEMINI_API_KEY, etc.\n   docker run -d --env-file .env -p 8082:8082 ghcr.io/1rgs/claude-code-proxy:latest\n   ```\n\n   **Or from source:**\n   ```bash\n   git clone https://github.com/1rgs/claude-code-proxy.git\n   cd claude-code-proxy\n   cp .env.example .env\n   # Edit .env: set OPENAI_API_KEY (required)\n   uv run uvicorn server:app --host 0.0.0.0 --port 8082\n   ```\n\n2. Run `claude-switch proxy` — if the proxy is running, Claude Code launches immediately with `ANTHROPIC_BASE_URL=http://localhost:8082`\n3. Set a default model: add `PROXY_MODEL=gpt-4o` to your env file\n\n## 📋 Commands Reference\n\n### Provider Commands\n\n| Command      | Description                     | Example                      |\n| ------------ | ------------------------------- | ---------------------------- |\n| `openrouter` | Use OpenRouter provider         | `claude-switch openrouter`   |\n| `anthropic`  | Use Anthropic provider          | `claude-switch anthropic`    |\n| `minimax`    | Use MiniMax provider            | `claude-switch minimax`      |\n| `ollama`     | Use Ollama provider             | `claude-switch ollama`       |\n| `proxy`      | Use Claude Code Proxy (LiteLLM) | `claude-switch proxy`        |\n| `original`   | Use original Claude Code        | `claude-switch original`     |\n\n> **Note**: All examples also work with the shorter `cs` alias (e.g., `cs openrouter`, `cs anthropic`, `cs minimax`, `cs ollama`, `cs original`)\n\n### Model Selection\n\n| Command              | Description               | Example                            |\n| -------------------- | ------------------------- | ---------------------------------- |\n| `<provider> --model` | Select model for provider | `claude-switch openrouter --model` |\n| `minimax --model`    | Select MiniMax model      | `claude-switch minimax --model`    |\n\n### Configuration Commands\n\n| Command          | Description                   | Example                        |\n| ---------------- | ----------------------------- | ------------------------------ |\n| `set-default`    | Interactive default setup     | `claude-switch set-default`    |\n| `show-defaults`  | View current defaults         | `claude-switch show-defaults`  |\n| `clear-defaults` | Reset all defaults            | `claude-switch clear-defaults` |\n| `api-keys`       | Manage API keys interactively | `claude-switch api-keys`       |\n| `help`           | Show help information         | `claude-switch --help`         |\n| `version`        | Show Version information      | `claude-switch --version`      |\n\n> **Note**: All commands also work with the shorter `cs` alias (e.g., `cs --help`, `cs --version`, `cs set-default`, `cs clear-defaults`)\n\n### Aliases\n\n| Command      | Aliases                        |\n| ------------ | ------------------------------ |\n| `openrouter` | `or`, `open`                   |\n| `anthropic`  | `ant`                          |\n| `minimax`    | `min`, `mm`                    |\n| `ollama`     | `oll`                          |\n| `original`   | `original`, `orig`, `def`, `d` |\n\n### ⚠️ IMPORTANT: Extra Arguments with Default Provider\n\n**When a default provider is set, extra arguments are automatically passed to Claude Code:**\n\n```bash\nclaude-switch --continue           # Continue previous conversation\ncs --continue  # Much shorter!       # Continue previous conversation\nclaude-switch --resume            # Resume last session\ncs --resume  # Much shorter!        # Resume last session\nclaude-switch -p \"Explain what this project does\"  # Quick prompt without interactive mode\ncs -p \"Explain what this project does\"  # Much shorter!  # Quick prompt without interactive mode\nclaude-switch -p \"List all providers supported\" --output-format json  # Get structured JSON output\ncs -p \"List all providers supported\" --output-format json  # Much shorter!  # Get structured JSON output\n\n```\n\n**This means you can use Claude Code with your default provider seamlessly after setting a default provider, also passing extra arguments like `--continue`, `--resume`, etc.**\n\n### ⚠️ Important: Clearing Defaults\n\n**If the interactive menu doesn't show and Claude Code opens directly with a predefined provider**, you need to clear the default settings:\n\n```bash\nclaude-switch clear-defaults\ncs clear-defaults  # Much shorter!\n```\n\n### Why This Happens\n\nWhen you use the \"Set as Default\" option, the application saves your provider and model choices to provide a faster experience. However, if you want to change providers or access the full menu again, you must clear these defaults first with `claude-switch clear-defaults`\n\n## 🎨 Enhanced Menu Features\n\nThe interactive menu includes several visual enhancements:\n\n### Visual Elements\n\n- **Icons**: Management options have intuitive icons (⚙️ Settings, 🔑 Keys, ❓ Help, etc.)\n- **Color Coding**: Different colors for different option types\n- **Star Indicator**: ⭐ shows your current default provider\n- **Separator Line**: Clean visual separation between providers and management options\n- **Inline Aliases**: Provider aliases displayed on the same line for cleaner layout\n\n### Navigation Improvements\n\n- **Arrow Keys**: Smooth up/down navigation with visual feedback\n- **Quick Select**: Press number keys for instant selection\n- **ESC Support**: Exit the menu cleanly\n- **Visual Selection**: Clear indicator (❯) shows currently selected option\n\n## 🔧 Advanced Usage\n\n### Programmatic API\n\nYou can also use this package as a module in your Node.js applications:\n\n```javascript\nconst {\n  setDefaultProvider,\n  getDefaultProvider,\n  launchOpenRouter,\n  launchAnthropic,\n  showApiKeyMenu,\n  updateApiKey,\n  maskApiKey,\n} = require(\"@adrianr84/claude-code-provider-switch\");\n\n// Set default provider programmatically\nawait setDefaultProvider(\"openrouter\");\n\n// Get current provider\nconst current = getDefaultProvider();\nconsole.log(`Current provider: ${current}`);\n\n// Launch specific provider\nawait launchOpenRouter(false, [], \"gpt-4\");\n\n// Manage API keys programmatically\nawait showApiKeyMenu(); // Show interactive API key menu\nawait updateApiKey({\n  id: \"openrouter\",\n  name: \"OpenRouter\",\n  envVar: \"OPENROUTER_AUTH_TOKEN\",\n}); // Update specific API key\nconsole.log(maskApiKey(\"sk-1234567890abcdef\")); // \"sk-1234...cdef\"\n```\n\n### Development\n\n```bash\n# Install for development with symlink (changes are immediate)\nnpm run link\n\n# Run directly from source\nnpm run dev -- --help\ncs --help  # Much shorter!\n\n# Run tests\nnpm run test:all\n\n# Unlink development version\nnpm run unlink\n\n# Install production version\nnpm install -g .\n```\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**\"API key required\" error**\n\n- Check your environment file contains the correct API key\n- Ensure the environment file is in your current working directory\n\n**Menu selection not showing options, opens Claude Code directly**\n\n- Try clearing defaults: `claude-switch clear-defaults` (or `cs clear-defaults`)\n\n**File permission errors**\n\n- Ensure you have write permissions to create/modify the environment file\n- Try running with elevated permissions if necessary\n\n### Debug Mode\n\nFor debugging, you can run the tool directly from source:\n\n```bash\nnode bin/claude-switch.js --help\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n### Development Scripts\n\n- `npm run dev` - Run directly from source\n- `npm run test:validation` - Run validation tests\n- `npm run test:provider` - Run provider integration tests\n- `npm run test:comprehensive` - Run comprehensive tests\n- `npm run test:all` - Run all test suites\n\n## 📄 License\n\nMIT License - see LICENSE file for details\n\n## 🔗 Related Projects\n\n- [Claude Code](https://github.com/anthropics/claude-code) - Official Claude Code repository\n- [OpenRouter](https://openrouter.ai/) - Unified API for AI models\n- [Ollama](https://ollama.ai/) - Local AI model deployment\n\n## 📞 Support\n\nIf you encounter any issues or have questions:\n\n1. Check the troubleshooting section above\n2. Search existing GitHub issues\n3. Create a new issue with detailed information\n4. Include your OS, Node.js version, and error messages\n\n---\n\n**Made with ❤️ by Adrian R**\n","readmeFilename":"README.md"}