claude-code-keys
v1.2.0
Published
Global CLI tool for managing Claude API key configurations
Maintainers
Readme
Claude Code Keys (cck)
A global CLI tool for managing Claude API key configurations with instant environment variable switching.
Installation
npm install -g claude-code-keysQuick Start
Add your first key:
cck addSwitch keys and launch Claude Code:
cckList keys:
cck list
Usage
Commands
| Command | Description |
|---------|-------------|
| cck | Interactive key selection and launch Claude Code |
| cck add | Add new key configuration |
| cck list | List all keys |
| cck delete [name] | Delete key |
| cck help | Show help |
Switching Keys
Simply run cck to interactively select a key and immediately launch Claude Code with the selected configuration.
cckThis will:
- Show an interactive list of your configured keys
- Let you select with arrow keys and press Enter
- Launch Claude Code with the selected key's configuration
Adding Keys
cck add
# Enter key name, base URL, and API key interactivelySwitching Keys
Simply run cck to interactively select a key and immediately launch Claude Code:
cckListing Keys
cck listOutput shows:
- Active key (●)
- Key names
- Base URLs
- Masked API keys for security
Configuration
Configuration files are stored in ~/.claude-code-keys/:
config.yaml- Current active keykeys.yaml- All key configurations
Files have 600 permissions for security.
Key Structure
Each key contains:
name- Unique identifierANTHROPIC_BASE_URL- API base URLANTHROPIC_API_KEY- Your API keycreated- Creation timestamp
Examples
Interactive Key Selection

Login Interface

# Add a production key
cck add
# Name: prod
# URL: https://api.anthropic.com
# Key: your-api-key-here
# Add a staging key
cck add
# Name: staging
# URL: https://api-staging.anthropic.com
# Key: your-api-key-here
# Switch keys (interactive selection)
cckSecurity
- API keys are encrypted at rest with 600 file permissions
- Keys are masked in terminal output
- No keys are logged or transmitted
- Configuration is stored locally only
Development
# Clone repository
git clone <repo-url>
cd claude-code-keys
# Install dependencies
npm install
# Link for local development
npm link
# Run tests
npm test
# Run with coverage
npm run test:coverageRequirements
- Node.js >= 16.0.0
- NPM or Yarn
License
MIT
