kaitranntt 657f99bfe8 feat: add GLMT proxy and transformer tools
- Add GLMT proxy server for GLM model routing
- Add GLMT transformer for output format conversion
- Update CLI with new proxy and transformer commands
- Add comprehensive test suite for new functionality
- Update documentation and architecture guides
- Bump version and update changelog
2025-11-11 03:08:56 -05:00

CCS - Claude Code Switch

CCS Logo

One command, zero downtime, multiple accounts

Switch between multiple Claude accounts, GLM, and Kimi instantly.
Stop hitting rate limits. Keep working continuously.

License Platform npm PoweredBy

Languages: English | Tiếng Việt | 日本語


🚀 Quick Start

🔑 Prerequisites

Before installing CCS, make sure you're logged into Claude CLI with your subscription account:

claude /login

Installation

macOS / Linux / Windows

npm install -g @kaitranntt/ccs

All major package managers are supported:

# yarn
yarn global add @kaitranntt/ccs

# pnpm (70% less disk space)
pnpm add -g @kaitranntt/ccs

# bun (30x faster)
bun add -g @kaitranntt/ccs

Option 2: Direct Install (Traditional)

macOS / Linux

curl -fsSL ccs.kaitran.ca/install | bash

Windows PowerShell

irm ccs.kaitran.ca/install | iex

💡 Performance Tip: Traditional installs bypass Node.js routing for faster startup, but I prioritize npm updates due to easier deployment automation.

Configuration (Auto-created)

CCS automatically creates configuration during installation (via npm postinstall script).

~/.ccs/config.json:

{
  "profiles": {
    "glm": "~/.ccs/glm.settings.json",
    "glmt": "~/.ccs/glmt.settings.json",
    "kimi": "~/.ccs/kimi.settings.json",
    "default": "~/.claude/settings.json"
  }
}

Custom Claude CLI Path

If Claude CLI is installed in a non-standard location (D drive, custom directory), set CCS_CLAUDE_PATH:

export CCS_CLAUDE_PATH="/path/to/claude"              # Unix
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe"   # Windows

See Troubleshooting Guide for detailed setup instructions.

Windows users: Enable Developer Mode for true symlinks (better performance, instant sync):

  1. Open SettingsPrivacy & SecurityFor developers
  2. Enable Developer Mode
  3. Reinstall CCS: npm install -g @kaitranntt/ccs

Without Developer Mode: CCS automatically falls back to copying directories (works but no instant sync across profiles).


Your First Switch

⚠️ Important: Before using GLM/GLMT or Kimi profiles, update API keys in settings files:

  • GLM: Edit ~/.ccs/glm.settings.json and add your GLM API key
  • GLMT: Edit ~/.ccs/glmt.settings.json and add your Z.AI API key (requires coding plan)
  • Kimi: Edit ~/.ccs/kimi.settings.json and add your Kimi API key
# Default Claude subscription
ccs "Plan microservices architecture"

# Switch to GLM (cost-optimized)
ccs glm "Create REST API"

# GLM with thinking mode
ccs glmt "Solve algorithmic problem"

# Kimi for coding
ccs kimi "Write integration tests"

The Daily Developer Pain Point

Developers face multiple subscription scenarios daily:

  1. Account Separation: Company Claude account vs personal Claude → you must manually switch contexts to keep work and personal separate
  2. Rate Limits Hit: Claude stops mid-project → you manually edit ~/.claude/settings.json
  3. Cost Management: 2-3 Pro subscriptions ($20/month each) vs Claude Max at 5x cost ($100/month) → Pro tier is the practical ceiling for most developers
  4. Model Choice: Different tasks benefit from different model strengths → manual switching

Manual context switching breaks your workflow. CCS manages it seamlessly.

Why CCS Instead of Manual Switching?

Feature Benefit
Account Isolation Keep work separate from personal
Cost Optimization 2-3 Pro accounts vs Max at 5x cost
Instant Switching One command, no file editing
Zero Downtime Never interrupt workflow
Rate Limit Management Switch accounts when limits hit
Cross-Platform macOS, Linux, Windows

Architecture

Profile Types

Settings-based: GLM, GLMT, Kimi, default

  • Uses --settings flag pointing to config files
  • GLMT: Embedded proxy for thinking mode support

Account-based: work, personal, team

  • Uses CLAUDE_CONFIG_DIR for isolated instances
  • Create with ccs auth create <profile>

Shared Data (v3.1)

Commands and skills symlinked from ~/.ccs/shared/ - no duplication across profiles.

~/.ccs/
├── shared/                  # Shared across all profiles
│   ├── agents/
│   ├── commands/
│   └── skills/
├── instances/               # Profile-specific data
│   └── work/
│       ├── agents@ → shared/agents/
│       ├── commands@ → shared/commands/
│       ├── skills@ → shared/skills/
│       ├── settings.json    # API keys, credentials
│       └── sessions/        # Conversation history
│       └── ...

Shared: commands/, skills/, agents/ Profile-specific: settings.json, sessions/, todolists/, logs/

[i] Windows: Copies dirs if symlinks unavailable (enable Developer Mode for true symlinks)


GLM with Thinking (GLMT)

[!] Important: GLMT requires npm installation (npm install -g @kaitranntt/ccs). Not available in native shell versions (requires Node.js HTTP server).

GLM vs GLMT

Feature GLM (ccs glm) GLMT (ccs glmt)
Endpoint Anthropic-compatible OpenAI-compatible
Thinking No Yes (reasoning_content)
Streaming Yes No (buffered)
Use Case Fast responses Complex reasoning

How It Works

  1. CCS spawns embedded HTTP proxy on localhost
  2. Proxy converts Anthropic format → OpenAI format
  3. Forwards to Z.AI with reasoning parameters
  4. Converts reasoning_content → thinking blocks
  5. Thinking appears in Claude Code UI

Control Tags

  • <Thinking:On|Off> - Enable/disable reasoning blocks (default: On)
  • <Effort:Low|Medium|High> - Control reasoning depth (default: Medium)

API Key Setup

# Edit GLMT settings
nano ~/.ccs/glmt.settings.json

# Set Z.AI API key (requires coding plan)
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key"
  }
}

Debugging

Enable verbose logging:

ccs glmt --verbose "your prompt"

Enable debug file logging:

export CCS_DEBUG_LOG=1
ccs glmt --verbose "your prompt"
# Logs: ~/.ccs/logs/

Check reasoning content:

cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content'

If absent: Z.AI API issue (verify key, account status) If present: Transformation issue (check response-anthropic.json)


Usage Examples

Basic Switching

ccs              # Claude subscription (default)
ccs glm          # GLM (no thinking)
ccs glmt         # GLM with thinking
ccs kimi         # Kimi for Coding
ccs --version    # Show version

Multi-Account Setup

# Create accounts
ccs auth create work
ccs auth create personal

# Terminal 1
ccs work "implement feature"

# Terminal 2 (concurrent)
ccs personal "review code"

Custom Claude CLI Path

Non-standard installation location:

export CCS_CLAUDE_PATH="/path/to/claude"              # Unix
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe"   # Windows

See Troubleshooting Guide


Configuration

Auto-created during installation via npm postinstall script.

~/.ccs/config.json:

{
  "profiles": {
    "glm": "~/.ccs/glm.settings.json",
    "glmt": "~/.ccs/glmt.settings.json",
    "kimi": "~/.ccs/kimi.settings.json",
    "default": "~/.claude/settings.json"
  }
}

Complete guide: docs/en/configuration.md


Uninstall

Package Managers

npm uninstall -g @kaitranntt/ccs
yarn global remove @kaitranntt/ccs
pnpm remove -g @kaitranntt/ccs
bun remove -g @kaitranntt/ccs

Official Uninstaller

# macOS / Linux
curl -fsSL ccs.kaitran.ca/uninstall | bash

# Windows
irm ccs.kaitran.ca/uninstall | iex

🎯 Philosophy

  • YAGNI: No features "just in case"
  • KISS: Simple bash, no complexity
  • DRY: One source of truth (config)

📖 Documentation

Complete documentation in docs/:


🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.


📄 License

CCS is licensed under the MIT License.


Made with ❤️ for developers who hit rate limits too often

Star this repo | 🐛 Report issues | 📖 Read docs

S
Description
Switch between Claude accounts, Gemini, Copilot, OpenRouter (300+ models) via CLIProxyAPI OAuth proxy. Visual dashboard, remote proxy support, WebSearch fallback. Zero-config to production-ready.
Readme MIT
33 MiB
Languages
TypeScript 81.4%
HTML 8.1%
JavaScript 7.1%
Swift 1.7%
Shell 1%
Other 0.6%