Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Manager (CCM)

A comprehensive toolkit for installing, managing, and switching between AI models in Claude Code CLI.

Overview

Claude Code Manager (CCM) is a powerful management system for Claude Code CLI that enables seamless switching between multiple AI providers including Claude, Deepseek, GLM, KIMI, Qwen, LongCat, MiniMax, and Doubao. It simplifies installation, configuration, and model management through intuitive shell utilities.

Features

  • One-Command Installation: Automated installation script for Claude Code CLI
  • Multi-Model Support: Switch between 10+ AI models with a single command
  • Three Claude Modes: Pro Account, Official API, and Proxy - choose what works for you
  • Account Management: Save and switch between multiple Claude Pro accounts (macOS only)
  • Environment Configuration: Automatic shell environment setup
  • API Key Management: Secure storage and configuration of API keys
  • Convenient Aliases: Quick shortcuts for common operations
  • Cross-Platform: Supports macOS and Linux (x64/ARM64)
  • ⚠️ Note: Currently designed for macOS and Linux only. Windows is not supported.

Supported AI Models

Provider Model Base URL
Claude Pro via Keychain credentials api.anthropic.com
Claude API claude-sonnet-4-6 api.anthropic.com
Claude Proxy via third-party proxy configurable
Deepseek deepseek-v4-pro/flash api.deepseek.com
GLM glm-5.2 open.bigmodel.cn
KIMI kimi-k2.7-code api.kimi.com
KIMI CN kimi-k2.7-code api.moonshot.cn
Qwen qwen3-max dashscope.aliyuncs.com
LongCat LongCat-Flash-Thinking api.longcat.chat
MiniMax MiniMax-M2.7 api.minimaxi.com
Doubao Seed doubao-seed-code ark.cn-beijing.volces.com

Requirements

  • OS: macOS or Linux (x64/ARM64)
    • ⚠️ Windows is not currently supported - the installer and CCM scripts are designed for Unix-like systems
  • Shell: bash or zsh
  • Tools: curl, base64
  • Optional: git, jq
  • macOS Only: Keychain integration for Claude Pro account management

Installation

Quick Install

Run the installer script to download and set up Claude Code CLI:

bash <(curl -fsSL https://raw.githubusercontent.com/zhuzaiye/my-ccm/main/claude.sh)

Or download and run locally:

curl -fsSL https://raw.githubusercontent.com/zhuzaiye/my-ccm/main/claude.sh -o claude.sh
chmod +x claude.sh
./claude.sh

Installation Steps

The installer will:

  1. Detect your platform (OS and CPU architecture)
  2. Prompt for version selection (latest/stable/specific version)
  3. Download Claude Code CLI binary
  4. Download CCM switcher script
  5. Configure environment variables
  6. Set up shell integration

Activate Environment

After installation, load the environment:

source ~/.claude/env

This will be automatically loaded in new terminal sessions.

Configuration

API Key Setup

Configure API keys for different providers using the CCM tool:

# Set API key for a specific provider
ccm set glm sk-xxxxxxxxxxxxx
ccm set deepseek sk-xxxxxxxxxxxxx
ccm set kimi sk-xxxxxxxxxxxxx

# For Claude
ccm set claude sk-ant-xxxxxxxxxxxxx        # Official API
ccm set claude-proxy your-proxy-key        # Third-party proxy

Or edit the config file manually:

ccm config

This opens ~/.ccm_config where you can add your API keys:

# GLM (Zhipu AI)
GLM_API_KEY=your-glm-api-key

# Deepseek V4
DEEPSEEK_API_KEY=sk-your-deepseek-api-key

# KIMI for Coding
KIMI_API_KEY=your-kimi-api-key

# Claude API Key (Official Anthropic API)
CLAUDE_API_KEY=sk-ant-your-claude-api-key

# Claude Proxy (Third-party proxy)
CLAUDE_PROXY_KEY=your-claude-proxy-key
CLAUDE_PROXY_URL=https://your-proxy-url/chat

Usage

Claude Connection Modes

CCM supports three ways to connect to Claude:

1. Claude Pro Account (via Keychain)

Use your Claude Pro subscription with credentials stored in macOS Keychain:

# First time: login to Claude Code and save account
ccm save-account work

# Use Pro account
eval "$(ccm claude-pro)"
claude

2. Claude Official API

Use Anthropic's official API with your API key:

# Configure API key
ccm set claude sk-ant-xxxxxxxxxxxxx

# Use API mode
eval "$(ccm claude-api)"
claude

3. Claude Proxy

Use third-party proxy services:

# Configure proxy
ccm set claude-proxy your-proxy-key
# Optionally set custom proxy URL in ~/.ccm_config

# Use proxy mode
eval "$(ccm claude-proxy)"
claude

Model Switching

Switch between different AI models using CCM:

# Switch to Deepseek
eval "$(ccm deepseek)"
claude

# Switch to GLM
eval "$(ccm glm)"
claude

# Switch to KIMI
eval "$(ccm kimi)"
claude

Quick Launch Aliases

The environment includes convenient aliases for rapid model switching:

# Standard mode (with permission prompts)
glm          # GLM
mmm          # MiniMax
dsm          # Deepseek

# Claude modes (standard)
cpm          # Claude Proxy Mode
cam          # Claude API Mode
crm          # Claude pRo Mode (Pro account)

# YOLO mode (skip permission prompts - use with caution!)
glx          # GLM YOLO
mmx          # MiniMax YOLO
dsx          # Deepseek YOLO

# Claude YOLO modes
cpx          # Claude Proxy YOLO
cax          # Claude API YOLO
crx          # Claude pRo YOLO

Alias Naming Convention:

  • c*m = Standard mode (with permissions)
  • c*x = YOLO mode (skip permissions)
  • cam = Claude API Mode
  • crm = Claude pRo Mode
  • cpm = Claude Proxy Mode

Advanced Functions

CCC - Claude Code Commander

Switch model and launch in one command:

ccc deepseek         # Switch to Deepseek and launch
ccc glm              # Switch to GLM and launch
ccc claude-api       # Switch to Claude API and launch

CCX - Claude Code eXtreme

Same as CCC but with --dangerously-skip-permissions:

ccx deepseek         # YOLO mode
ccx glm              # YOLO mode
ccx claude-proxy     # Claude proxy YOLO mode

Account Management

Manage multiple Claude Pro accounts:

# Save current account
ccm save-account work

# List all saved accounts
ccm list-accounts

# Switch to a saved account
ccm switch-account personal

# Show current account info
ccm current-account

# Delete an account
ccm delete-account old-account

Check Status

View current configuration and API key status:

ccm status

Output example:

Current model config:
   BASE_URL: https://api.deepseek.com/anthropic
   AUTH_TOKEN: [Set] sk-de...6789
   MODEL: deepseek-v4-pro
   SMALL_MODEL: deepseek-v4-flash

API keys status:
   DEEPSEEK_API_KEY: [Set]
   GLM_API_KEY: [Set]
   KIMI_API_KEY: [Not Set]

Available Commands

Model Commands

ccm deepseek, ds       # Switch to Deepseek
ccm kimi, kimi2        # Switch to KIMI for Coding
ccm kimi-cn            # Switch to KIMI CN
ccm seed, doubao       # Switch to Doubao Seed-Code
ccm longcat, lc        # Switch to LongCat
ccm minimax, mm        # Switch to MiniMax
ccm qwen               # Switch to Qwen
ccm glm, glm5          # Switch to GLM

Claude Connection Commands

ccm claude-proxy       # Claude via third-party proxy
ccm claude-api         # Claude via official API
ccm claude-pro         # Claude via Pro account (Keychain)

Account Management Commands

ccm save-account <name>      # Save current account
ccm switch-account <name>    # Switch to saved account
ccm list-accounts            # List all accounts
ccm delete-account <name>    # Delete account
ccm current-account          # Show current account

Configuration Commands

ccm status, st              # Show current config
ccm config, cfg             # Edit config file
ccm set <provider> <key>    # Set API key
ccm help, -h                # Show help

Advanced Features

Custom Model Configuration

Override default model IDs in ~/.ccm_config:

# Custom Deepseek models
DEEPSEEK_MODEL=deepseek-v4-pro
DEEPSEEK_SMALL_FAST_MODEL=deepseek-v4-flash

# Custom GLM models
GLM_MODEL=glm-5.2
GLM_SMALL_FAST_MODEL=glm-5.2

# Custom Claude models
CLAUDE_MODEL=claude-sonnet-4-6
CLAUDE_SMALL_FAST_MODEL=claude-haiku-4-5

# Custom proxy URL
CLAUDE_PROXY_URL=https://your-proxy-url/chat

Environment Variables

CCM uses these environment variables (set automatically):

ANTHROPIC_BASE_URL          # API endpoint URL
ANTHROPIC_AUTH_TOKEN        # Authentication token
ANTHROPIC_MODEL             # Primary model ID
ANTHROPIC_SMALL_FAST_MODEL  # Fast model for quick tasks
API_TIMEOUT_MS              # API request timeout

macOS Keychain Integration

CCM integrates with macOS Keychain for secure credential storage:

  • Credentials are stored in: Claude Code - credentials
  • Account switching automatically updates Keychain
  • No plain-text credential storage

Note: This feature is macOS only. On Linux, Claude Pro account mode (claude-pro) will not work. Linux users should use claude-api (official API) or claude-proxy (third-party proxy) modes instead.

Utilities

cc_load.sh - Download URL Generator

Generate Claude Code binary download URLs for any platform:

# Interactive mode
./cc_load.sh

# Direct URL generation
./cc_load.sh latest
./cc_load.sh stable
./cc_load.sh 2.1.161

# Specify platform manually
./cc_load.sh latest --platform linux-x64
./cc_load.sh stable --platform darwin-arm64

Supported platforms:

  • linux-x64, linux-arm64
  • linux-x64-musl, linux-arm64-musl (Alpine)
  • darwin-x64, darwin-arm64
  • win32-x64, win32-arm64

Project Structure

my-ccm/
├── claude.sh       # Main installer script
├── ccm.sh          # Model switcher utility
├── cc_load.sh      # Download URL generator
├── README.md       # This file
└── LICENSE         # MIT License

Configuration Files

~/.claude/
├── env             # Environment configuration (auto-loaded)
└── ...             # Claude Code data

~/.local/bin/
├── claude          # Claude Code CLI binary
└── ccm.sh          # CCM script

~/.ccm_config       # API keys configuration
~/.ccm_accounts     # Saved accounts (encrypted)

Troubleshooting

API Key Not Working

  1. Check key status: ccm status
  2. Verify config: ccm config
  3. Re-set the key: ccm set <provider> <key>

Model Switch Not Taking Effect

Make sure to use eval:

# Wrong
ccm deepseek
claude

# Correct
eval "$(ccm deepseek)"
claude

Permission Errors During Installation

Ensure directories are writable:

mkdir -p ~/.local/bin ~/.claude
chmod 755 ~/.local/bin ~/.claude

Environment Not Loaded

Manually source the environment:

source ~/.claude/env

Or add to shell config:

# Add to ~/.bashrc or ~/.zshrc
. "${HOME}/.claude/env"

Claude Pro Mode Not Working (Linux)

Issue: claude-pro mode requires macOS Keychain, which is not available on Linux.

Solution: Linux users should use alternative Claude connection modes:

  • claude-api - Official Anthropic API (requires API key)
  • claude-proxy - Third-party proxy service
# For Linux users
ccm set claude sk-ant-xxxxxxxxxxxxx
eval "$(ccm claude-api)"
claude

Examples

Example 1: Quick Start with GLM

# Configure API key
ccm set glm your-api-key-here

# Launch with GLM using alias
glm          # Standard mode
# or
glx          # YOLO mode

Example 2: Claude API Quick Start

# Configure API key
ccm set claude sk-ant-xxxxxxxxxxxxx

# Launch with Claude API using alias
cam          # Standard mode
# or
cax          # YOLO mode

Example 3: Claude Pro Quick Start

# First time: login and save account
claude login
ccm save-account work

# Launch with Pro account using alias
crm          # Standard mode
# or
crx          # YOLO mode

Example 4: Claude Proxy Quick Start

# Configure proxy
ccm set claude-proxy your-proxy-key

# Launch with proxy using alias
cpm          # Standard mode
# or
cpx          # YOLO mode

Example 5: Switch Between Models

# Use Deepseek for complex tasks
eval "$(ccm deepseek)"
claude

# Switch to GLM for quick queries
eval "$(ccm glm)"
claude

# Switch to Claude API
eval "$(ccm claude-api)"
claude

Example 6: Multiple Accounts

# Save work account
ccm save-account work

# Save personal account
ccm save-account personal

# Switch between accounts
ccm switch-account work
crm          # Launch with work account

# Later, switch to personal
ccm switch-account personal
crm          # Launch with personal account

Example 7: Using CCC Command

# Quick switch and launch
ccc deepseek         # Launch with Deepseek
ccc glm              # Launch with GLM
ccc claude-api       # Launch with Claude API
ccc claude-pro       # Launch with Claude Pro

# YOLO mode
ccx deepseek         # Launch Deepseek in YOLO mode
ccx claude-proxy     # Launch Claude Proxy in YOLO mode

Security Considerations

  • API keys are stored in ~/.ccm_config (chmod 600)
  • Account data is stored in ~/.ccm_accounts (chmod 600)
  • macOS uses Keychain for credential storage
  • Never commit config files to version control
  • Use environment variables for CI/CD pipelines

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License - see the LICENSE file for details.

References

About

claude code manager.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages