Ccconfig
Quickly switch between different Claude Code providers
Install / Use
/learn @Danielmelody/CcconfigQuality Score
Category
Development & EngineeringSupported Platforms
README
Claude Code Configuration Manager
Quickly switch between different claude-code providers and start Claude Code with specific profiles.
Recommended Usage (Easiest):
# Add configurations
ccconfig add work
ccconfig add personal
# Start Claude Code directly with a specific profile
ccconfig start work # During work hours
ccconfig start personal # After work
# Or use safe mode (requires confirmation for each command)
ccconfig safe-start work
Alternative: Manual Switch Mode:
# Switch configuration in current shell
ccconfig use company
# Permanently write to shell config (no need to eval or source each time)
ccconfig use personal --permanent # or use -p for short
Quick Start
Installation
# Install from npm (recommended)
npm install -g ccconfig
Dependencies:
- Node.js >= 18.0.0
dotenvpackage (automatically installed with npm)
Method 1: Direct Start Mode (Recommended)
The easiest way to use ccconfig - directly start Claude Code with a specific profile:
# 1. Add a configuration (interactive mode)
ccconfig add work
# Follow the prompts to enter:
# - ANTHROPIC_BASE_URL
# - ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY
# - ANTHROPIC_MODEL (optional)
# - ANTHROPIC_SMALL_FAST_MODEL (optional)
# 2. Start Claude Code directly with your profile
ccconfig start work # Auto-approve mode (adds --dangerously-skip-permissions)
# or
ccconfig safe-start work # Safe mode (requires confirmation for each command)
That's it! Claude Code starts with your configuration automatically injected.
Two modes explained:
-
ccconfig start- Auto-approve mode- Automatically adds
--dangerously-skip-permissionsflag - Commands execute without confirmation prompts
- Only use with profiles you trust
- Perfect for: personal projects, trusted company profiles, rapid development
- Automatically adds
-
ccconfig safe-start- Safe mode- Does NOT add
--dangerously-skip-permissions - Requires manual confirmation before executing each command
- Recommended for production or untrusted environments
- Perfect for: production systems, new profiles, sensitive data
- Does NOT add
Advantages:
- No shell configuration needed
- No manual switching required
- Environment variables automatically injected
- Works across all shells
- Pass additional arguments:
ccconfig start work /path/to/project --verbose
Method 2: Manual Switch Mode
If you prefer to manually switch configurations and start Claude Code separately:
# 1. Add configuration (interactive mode)
ccconfig add work
# 2. Switch configuration
ccconfig use work
# 3. Apply to current shell (choose one):
eval $(ccconfig env bash) # Bash/Zsh - temporary
ccconfig env fish | source # Fish - temporary
ccconfig use work --permanent # Write to shell config - permanent
# 4. Start Claude Code manually
claude
Settings Mode
Settings Mode directly modifies ~/.claude/settings.json file, which is Claude Code's native configuration file. This mode is suitable when you don't want to configure shell scripts.
How it works:
- Writes environment variables directly into
~/.claude/settings.jsonunder theenvfield - Claude Code reads these settings on startup
- No shell configuration required
- Requires Claude Code restart after each switch
Setup:
# 1. Switch to settings mode
ccconfig mode settings
# 2. Add configuration (interactive mode)
ccconfig add
# Follow the prompts to enter:
# - Name
# - ANTHROPIC_BASE_URL
# - ANTHROPIC_AUTH_TOKEN
# - ANTHROPIC_API_KEY
# - ANTHROPIC_MODEL (optional)
# - ANTHROPIC_SMALL_FAST_MODEL (optional)
# 3. Switch configuration
ccconfig use work
# 4. Restart Claude Code
# Configuration is now active!
Verification:
# Check current configuration
ccconfig current
# View the settings file directly
cat ~/.claude/settings.json
ENV Mode Shell Configuration
You have two options to configure shell environment:
Option 1: Automatic (Recommended)
Use the -p/--permanent flag to automatically write to your shell config:
# Automatically detects your shell and writes to the appropriate config file
ccconfig use <profile> --permanent
# You will be prompted with:
# - Warning about modifying shell config
# - Target file path
# - Content preview
# - Confirmation prompt (yes/no)
# This will modify:
# - Fish: ~/.config/fish/config.fish
# - Bash: ~/.bashrc
# - Zsh: ~/.zshrc
# - PowerShell: ~/.config/powershell/profile.ps1
The tool will add a marked block between # >>> ccconfig >>> and # <<< ccconfig <<< markers, making it easy to identify and update later.
Safety Features:
- User confirmation required: You will be prompted before any file is modified
- Content preview: Shows exactly what will be written
- Clear explanation: Explains what changes will be made
- Non-destructive: Existing content is preserved, only the ccconfig block is updated
- Interactive only: Requires interactive terminal to prevent accidental modifications
Option 2: Manual Configuration
If you prefer to manually configure, add the following to your shell startup files:
Fish (~/.config/fish/config.fish):
# Load Claude Code environment variables
set -l ccconfig_env ~/.config/ccconfig/current.env
if test -f $ccconfig_env
for line in (cat $ccconfig_env)
set -l parts (string split -m1 '=' $line)
if test (count $parts) -eq 2
set -gx $parts[1] $parts[2]
end
end
end
Bash (~/.bashrc):
# Load Claude Code environment variables
if [ -f ~/.config/ccconfig/current.env ]; then
set -a
. ~/.config/ccconfig/current.env
set +a
fi
Zsh (~/.zshrc):
# Load Claude Code environment variables
if [ -f ~/.config/ccconfig/current.env ]; then
set -a
. ~/.config/ccconfig/current.env
set +a
fi
PowerShell ($PROFILE):
# Load Claude Code environment variables
$cconfigEnv = "$env:USERPROFILE\.config\ccconfig\current.env"
if (Test-Path $cconfigEnv) {
Get-Content $cconfigEnv | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') {
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process')
}
}
}
Note: Manual configuration allows you to switch profiles dynamically by changing current.env, while -p/--permanent writes the values directly into the shell config.
Advanced Usage
Update Existing Configuration
If you need to modify an existing configuration, use the update command:
# Update a configuration interactively
ccconfig update work
# The tool will:
# 1. Show current values as defaults
# 2. Prompt for each field
# 3. Press Enter to keep current value, or type new value to update
# (for ANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEY, press ESC twice to clear)
Example:
$ ccconfig update work
Updating configuration 'work'
Press Enter to keep current value/default, or enter new value to update
ANTHROPIC_BASE_URL [https://api.company.com]: https://new-api.company.com
ANTHROPIC_AUTH_TOKEN (press Enter to keep current; ESC twice to clear): <press Enter to keep>
ANTHROPIC_API_KEY (press Enter to keep current; ESC twice to clear): sk-new-key-123
ANTHROPIC_MODEL (press Enter to skip/keep current): <press Enter to keep>
ANTHROPIC_SMALL_FAST_MODEL (press Enter to skip/keep current): <press Enter to skip>
✓ Configuration 'work' updated
Note: After updating a configuration, you can either:
- Use
ccconfig start workto launch Claude Code with the updated profile - Or use
ccconfig use workto activate it in current shell
Copy Configuration (fork)
If you need to create a new configuration based on an existing one, use the fork command:
# Fork a configuration interactively
ccconfig fork work
# The tool will:
# 1. Ask for a new configuration name
# 2. Copy all environment variables from the source
# 3. Allow you to update values (press Enter to keep current value)
# (for ANTHROPIC_AUTH_TOKEN/ANTHROPIC_API_KEY, press ESC twice to clear)
Example:
$ ccconfig fork work
Please enter source configuration name to copy from: work
Please enter new configuration name: work-dev
Creating configuration 'work-dev' from 'work'...
Press Enter to keep current value/default, or enter new value to update
ANTHROPIC_BASE_URL [https://api.company.com]: https://dev-api.company.com
ANTHROPIC_AUTH_TOKEN (press Enter to keep current; ESC twice to clear): <press Enter to keep>
ANTHROPIC_API_KEY (press Enter to keep current; ESC twice to clear): <press Enter to keep>
ANTHROPIC_MODEL (press Enter to skip/keep current): <press Enter to keep>
ANTHROPIC_SMALL_FAST_MODEL (press Enter to skip/keep current): <press Enter to keep>
✓ Configuration 'work-dev' created from 'work'
Environment variables:
ANTHROPIC_BASE_URL=https://dev-api.company.com
ANTHROPIC_AUTH_TOKEN=sk-ant-api...
ANTHROPIC_API_KEY=sk-...
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
Run the following command to activate:
ccconfig use work-dev
This is useful when you need similar configurations with slight variations (e.g., production vs development endpoints).
Shell Completion
ccconfig supports shell completion for commands, profile names, and options. This makes it easier to discover and use commands.
Features:
- Command completion (list, add, update, use, remove, etc.)
- Profile name completion (dynamically reads from your configurations)
- Option completion (--permanent, --show-secret, etc.)
- Mode completion (settings, env)
- Format completion (bash, zsh, fish, etc.)
Installation:
# Bash
ccconfig completion bash >> ~/.bashrc
source ~/.bashrc
# Zsh
ccconfig completion zsh >> ~/.zshrc
source ~/.zshrc
# Fish
ccconfig completion fish > ~/.config/fish/completions/ccconfig.fish
# Fish will automatically load it o
