diff --git a/README.md b/README.md index efc8d540..4e8555b9 100644 --- a/README.md +++ b/README.md @@ -4,1068 +4,250 @@ ![CCS Logo](docs/assets/ccs-logo-medium.png) -### Switch between multiple Claude accounts, GLM, Kimi, and OAuth-based models (Gemini, Codex, Antigravity) instantly. -Stop hitting rate limits. Keep working continuously. -Features a modern React 19 dashboard with real-time updates and unified configuration. +### Manage multiple AI accounts from one dashboard. +Run Claude, Gemini, GLM, and more - concurrently, without conflicts. [![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](LICENSE) -[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=for-the-badge)]() +[![npm](https://img.shields.io/npm/v/@kaitranntt/ccs?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@kaitranntt/ccs) [![PoweredBy](https://img.shields.io/badge/PoweredBy-ClaudeKit-C15F3C?style=for-the-badge)](https://claudekit.cc?ref=HMNKXOHN) -[![npm](https://img.shields.io/npm/v/@kaitranntt/ccs?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@kaitranntt/ccs) -[![React](https://img.shields.io/badge/React-19-61DAFB?style=for-the-badge&logo=react)](https://react.dev/) -[![TypeScript](https://img.shields.io/badge/TypeScript-100%25-3178C6?style=for-the-badge&logo=typescript)](https://www.typescriptlang.org/) - -**Languages**: [English](README.md) | [Tiếng Việt](docs/vi/README.md) | [日本語](docs/ja/README.md) +**[Features & Pricing](https://ccs.kaitran.ca)** | **[Documentation](./docs/en/)** | [Tiếng Việt](docs/vi/README.md) | [日本語](docs/ja/README.md)
+## The Three Pillars + +| Capability | What It Does | Manage Via | +|------------|--------------|------------| +| **Multiple Claude Accounts** | Run work + personal Claude subs simultaneously | Dashboard | +| **OAuth Providers** | Gemini, Codex, Antigravity - zero API keys needed | Dashboard | +| **API Profiles** | GLM, Kimi with your own API keys | Dashboard | + +
+ ## Quick Start -### Installation +### 1. Install -**npm Package (Recommended)** - -**macOS / Linux / Windows** ```bash npm install -g @kaitranntt/ccs ``` -**All major package managers are supported:** - -```bash -# yarn -yarn global add @kaitranntt/ccs - -# pnpm (70% less disk space) -pnpm add -g @kaitranntt/ccs - -# bun (30x faster) -bun add -g @kaitranntt/ccs -``` -
-[!] DEPRECATED: Native Shell Installers (Legacy) +Alternative package managers -
- -> [!WARNING] -> **These installers are deprecated and will be removed in a future version.** -> They now auto-redirect to npm installation. Please use npm directly. - -**macOS / Linux** ```bash -curl -fsSL ccs.kaitran.ca/install | bash +yarn global add @kaitranntt/ccs # yarn +pnpm add -g @kaitranntt/ccs # pnpm (70% less disk space) +bun add -g @kaitranntt/ccs # bun (30x faster) ``` -**Windows PowerShell** -```powershell -irm ccs.kaitran.ca/install | iex -``` - -**Note:** Scripts show deprecation warning and automatically run npm installation if Node.js is available. -
-
- -## Zero-Config OAuth Providers - -**New in v5.0.0**: Instant access to premium models with zero API key setup. Browser-based OAuth authentication. - -> Powered by [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) - the universal API proxy for AI models. - -| Provider | Default Model | Opus | Haiku | Example | -|:---------|:--------------|:-----|:------|:--------| -| **Gemini** | gemini-2.5-pro | gemini-2.5-pro | gemini-2.5-flash | `ccs gemini "explain code"` | -| **Codex** | gpt-5.1-codex-max | gpt-5.1-codex-max-high | gpt-5.1-codex-mini-high | `ccs codex "implement API"` | -| **Antigravity** | gemini-3-pro-preview | gemini-3-pro-preview | gemini-2.5-flash | `ccs agy "review architecture"` | - -**First Run**: Browser opens for authentication. Tokens cached in `~/.ccs/cliproxy/auth//`. - -**Subsequent Runs**: Instant - no re-auth needed until token expires. - -### Authentication Commands +### 2. Open Dashboard ```bash -# Interactive OAuth (default) - browser opens, complete auth -ccs gemini - -# Authenticate only (save tokens, don't start session) -ccs gemini --auth -ccs codex --auth - -# Headless mode (for SSH/servers without browser) -ccs agy --headless # Displays URL, paste in browser elsewhere - -# Logout (clear tokens) -ccs gemini --logout -``` - -### Multi-Account for OAuth Providers - -Use multiple accounts per provider (work + personal): - -```bash -# First account (default) -ccs gemini --auth - -# Add another account -ccs gemini --auth --add - -# Add with nickname for easy identification -ccs gemini --auth --add --nickname work - -# Codex provider examples -ccs codex --auth # First account for Codex -ccs codex --auth --add # Add another Codex account -ccs codex --auth --add --nickname work # Named account - -# List all accounts (any provider) -ccs gemini --accounts -ccs codex --accounts -ccs agy --accounts - -# Switch to a different account -ccs gemini --use work -ccs codex --use work -ccs agy --use work -``` - -Accounts are stored in `~/.ccs/cliproxy/accounts.json` and can be managed via web dashboard (`ccs config`). - -### OAuth vs API Key Models - -| Feature | OAuth Providers
(gemini, codex, agy) | API Key Models
(glm, kimi) | -|:--------|:----------------------------------------|:------------------------------| -| **Setup** | Browser auth on first run | Edit settings.json, add API key | -| **Token Storage** | `~/.ccs/cliproxy/auth//` | `~/.ccs/*.settings.json` | -| **Renewal** | Automatic (OAuth refresh tokens) | Manual (update key when expired) | -| **Binary** | Auto-downloads CLIProxyAPI (~15MB) | No additional binaries | -| **Port** | 8317 (configurable) | N/A | -| **Best For** | Quick testing, no key management | Production, explicit key control | - -### Troubleshooting OAuth - -**OAuth timeout (2min limit)**: -```bash -# If browser doesn't load in time: -ccs gemini --auth --headless # Get URL manually -``` - -**Port 8317 conflict**: -```bash -ccs doctor # Check port availability -# Error: "Port 8317 in use" -lsof -ti:8317 | xargs kill # Unix: kill process using port -``` - -**Binary download failures**: -```bash -ccs doctor # Shows binary status + version -# Manual download: https://github.com/router-for-me/CLIProxyAPI/releases -``` - -
- -### Configuration (Auto-created) - -**CCS automatically creates configuration during installation** (via npm postinstall script). - -**~/.ccs/config.json**: -```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`: - -```bash -export CCS_CLAUDE_PATH="/path/to/claude" # Unix -$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows -``` - -**See also:** [Troubleshooting Guide](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location) for detailed setup instructions. - -
- -
-

Windows Symlink Support (Developer Mode)

- -
- -**Windows users**: Enable Developer Mode for true symlinks (better performance, instant sync): - -1. Open **Settings** → **Privacy & Security** → **For developers** -2. Enable **Developer Mode** -3. Reinstall CCS: `npm install -g @kaitranntt/ccs` - -**Warning:** Without Developer Mode, CCS automatically falls back to copying directories (works but no instant sync across profiles). - -
- -
- -### Your First Switch - -> [!IMPORTANT] -> **Before using alternative models, update API keys in settings files:** -> -> - **GLM**: Edit `~/.ccs/glm.settings.json` and add your Z.AI Coding Plan API Key -> - **GLMT**: Edit `~/.ccs/glmt.settings.json` and add your Z.AI Coding Plan API Key -> - **Kimi**: Edit `~/.ccs/kimi.settings.json` and add your Kimi API key - -
- -**Parallel Workflow: Planning + Execution** - -```bash -# Terminal 1 - Planning (Claude Sonnet) -ccs "Plan a REST API with authentication and rate limiting" - -# Terminal 2 - Execution (GLM, cost-optimized) -ccs glm "Implement the user authentication endpoints from the plan" -``` - -
-Thinking Models (Kimi & GLMT) - -
- -```bash -# Kimi - Stable thinking support -ccs kimi "Design a caching strategy with trade-off analysis" - -# GLMT - Experimental (see full disclaimer below) -ccs glmt "Debug complex algorithm with reasoning steps" -``` - -**Note:** GLMT is experimental and unstable. See [GLM with Thinking (GLMT)](#glm-with-thinking-glmt) section below for full details. - -
- -
- -## The Daily Developer Pain Point - -
- -### **STOP Switching. START Orchestrating.** - -**Session limits shouldn't kill your flow state.** -
- -You're deep in implementation. Context loaded. Solution crystallizing.
-Then: 🔴 _"You've reached your usage limit."_ - -**Momentum gone. Context lost. Productivity crater.** - -## **The Solution: Parallel Workflows** - -
-❌ OLD WAY: Switch When You Hit Limits (Reactive) - -
- -```mermaid -graph LR - A[2pm: Building features
In the zone] --> B[3pm: Usage limit hit
BLOCKED] - B --> C[3:05pm: Stop work
Edit settings.json] - C --> D[3:15pm: Switch accounts
Context lost] - D --> E[3:30pm: Restart
Trying to focus] - E --> F[4pm: Finally productive
Back in flow] - - style A fill:#d4edda,stroke:#333,color:#000 - style B fill:#f8d7da,stroke:#333,color:#000 - style C fill:#fff3cd,stroke:#333,color:#000 - style D fill:#f8d7da,stroke:#333,color:#000 - style E fill:#fff3cd,stroke:#333,color:#000 - style F fill:#d4edda,stroke:#333,color:#000 -``` - -**Result:** 1 hour lost, momentum destroyed, frustration builds - -
- -
-✨ NEW WAY: Run Parallel From Start (Proactive) - RECOMMENDED - -
- -```mermaid -graph LR - A[2pm: Start work] --> B[Terminal 1: Claude Pro
Strategic planning] - A --> C[Terminal 2: GLM
Code execution] - B --> D[3pm: Still shipping
No interruptions] - C --> D - D --> E[4pm: Flow state
Productivity peak] - E --> F[5pm: Features shipped
Context maintained] - - style A fill:#e7f3ff,stroke:#333,color:#000 - style B fill:#cfe2ff,stroke:#333,color:#000 - style C fill:#cfe2ff,stroke:#333,color:#000 - style D fill:#d4edda,stroke:#333,color:#000 - style E fill:#d4edda,stroke:#333,color:#000 - style F fill:#d4edda,stroke:#333,color:#000 -``` - -**Result:** Zero downtime, continuous productivity, less frustration - -### 💰 **The Value Proposition:** -- **Setup:** Your existing Claude Pro + GLM Lite (cost-effective add-on) -- **Value:** Save 1 hour/day × 20 workdays = 20 hours/month recovered -- **ROI:** Your development time is worth more than the setup cost -- **Reality:** Shipping faster than the overhead - -
- -## Choose Your Path - -
-Budget-Focused: GLM Only - -- **Best for:** Cost-conscious development, basic code generation -- **Usage:** Just use `ccs glm` directly for cost-effective AI assistance -- **Reality:** No Claude access, but capable for many coding tasks -- **Setup:** GLM API key only, very affordable - -
- -
-✨ Recommended for Daily Development: 1 Claude Pro + 1 GLM Lite - -- **Best for:** Daily code delivery, serious development work -- **Usage:** `ccs` for planning + `ccs glm` for execution (parallel workflow) -- **Reality:** Perfect balance of capability and cost for most developers -- **Value:** Never hit session limits, continuous productivity - -
- -
-Power User: Multiple Claude Pro + GLM Pro - -- **Best for:** Heavy workloads, concurrent projects, solo dev -- **Unlocks:** Never drain session or weekly limits -- **Workflow:** 3+ terminals running specialized tasks simultaneously - -
- -
-Privacy-Focused: Work/Personal Isolation - -- **When needed:** Strict separation of work and personal AI contexts -- **Setup:** `ccs auth create work` + `ccs auth create personal` -- **Note:** Advanced feature - most users don't need this - -
- ---- - -## Why CCS Instead of Manual Switching? - -
- -**CCS isn't about "switching when you hit limits at 3pm."** - -## **It's about running in parallel from the start.** - -
- -### The Core Difference - -| **Manual Switching** | **CCS Orchestration** | -|:---|:---| -| 🔴 Hit limits → Stop work → Edit config files → Restart | ✅ Multiple terminals running different models from the start | -| 😰 Context loss and flow state interruption | 😌 Continuous productivity with preserved context | -| 📝 Sequential task handling | ⚡ Parallel workflows (planning + execution simultaneously) | -| 🛠️ Reactive problem solving when blocked | 🎯 Proactive workflow design prevents blocks | - -### What CCS Gives You - -- **Zero Context Switching**: Keep your flow state without interruption -- **Parallel Productivity**: Strategic planning in one terminal, code execution in another -- **Instant Account Management**: One command switches, no config file editing -- **Work-Life Separation**: Isolate contexts without logging out -- **Cross-Platform Consistency**: Same smooth experience on macOS, Linux, Windows - -**Manual context switching breaks workflow. CCS orchestrates seamlessly.** - -
- -## Architecture - -CCS resolves profiles in priority order: -1. **CLIProxy profiles** (gemini, codex, agy) - OAuth-based, zero config -2. **CLIProxy variants** (user-defined) - Custom model settings for CLIProxy providers -3. **Settings-based profiles** (glm, kimi) - API key required -4. **Account-based profiles** (work, personal) - Isolated Claude instances -5. **Default** - Claude CLI with subscription - -### Profile Types - -**CLIProxy**: gemini, codex, agy (v5.0+) -- OAuth-based authentication via [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) -- Browser auth on first run, tokens cached in `~/.ccs/cliproxy/auth//` -- Proxy runs on port 8317, auto-spawned per session -- Binary: `~/.ccs/cliproxy/bin/cli-proxy-api` (~15MB, auto-downloaded) -- Model mappings: - - **Gemini**: gemini-2.5-pro (opus), gemini-2.0-flash (sonnet), flash-lite (haiku) - - **Codex**: gpt-5.1-codex-max (opus), gpt-4o (sonnet), gpt-4o-mini (haiku) - - **Antigravity**: agy-pro (sonnet), agy-turbo (haiku) - -**CLIProxy Variants** (v5.0.2+) -- User-defined profile names that route through CLIProxy providers -- Allows multiple model configurations per provider (e.g., `flash` and `pro` for Gemini) -- Configure in `~/.ccs/config.json` under `cliproxy` section: - -```json -{ - "profiles": { ... }, - "cliproxy": { - "flash": { "provider": "gemini", "settings": "~/.ccs/gemini-flash.settings.json" }, - "pro": { "provider": "gemini", "settings": "~/.ccs/gemini-pro.settings.json" }, - "gpt": { "provider": "codex", "settings": "~/.ccs/codex-gpt.settings.json" } - } -} -``` - -Usage: `ccs flash "quick task"` or `ccs pro "complex analysis"` - -Settings file format (`~/.ccs/gemini-flash.settings.json`): - -```json -{ - "env": { - "ANTHROPIC_BASE_URL": "http://127.0.0.1:8317/api/provider/gemini", - "ANTHROPIC_AUTH_TOKEN": "ccs-internal-managed", - "ANTHROPIC_MODEL": "gemini-2.5-flash", - "ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-2.5-flash", - "ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-2.5-flash", - "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-2.5-flash" - } -} -``` - -> [!TIP] -> Copy from `~/.ccs/gemini.settings.json` (auto-generated on first `ccs gemini` run) and modify `ANTHROPIC_MODEL` to your desired model. - -**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 ` - -### Shared Data (v4.4+) - -**Shared across instances** (`~/.ccs/shared/` symlinked to `~/.claude/`): -- commands/ - Slash commands -- skills/ - Agent skills -- agents/ - Agent configs -- **settings.json** - Claude CLI settings (v4.4+) - -**Profile-specific**: -- sessions/ - Conversation history -- todolists/ - Todo lists -- logs/ - Execution logs -- **cliproxy/auth/** - OAuth tokens (CLIProxy profiles only) - -> [!NOTE] -> **v4.4 Breaking Change**: settings.json now shared across profiles. Previously each profile had isolated settings. Migration is automatic on install using ~/.claude/settings.json as the authoritative source. Backups created: `/settings.json.pre-shared-migration` - -> [!NOTE] -> **Windows**: Symlink support requires Developer Mode (v4.2 will add copy fallback) - -
- -## Web Dashboard - -CCS includes a modern React 19 dashboard for visual profile management and real-time monitoring: - -```bash -# Start the web dashboard (auto-detects available port) ccs config - -# Or specify a port -ccs config --port 3000 - -# Access at http://localhost:PORT (shown in output) +# Opens http://localhost:3000 ``` -**Dashboard Features**: -- 🎨 **Modern UI**: Built with React 19, TypeScript, and shadcn/ui -- 📊 **Real-time Updates**: WebSocket integration for live status -- ⚙️ **Profile Management**: Visual configuration of all profiles -- 🔍 **Health Monitoring**: System diagnostics and metrics -- 🌙 **Dark Mode**: Eye-friendly theme switching -- 📱 **Responsive**: Works on desktop and mobile +### 3. Configure Your Accounts -### Dashboard Screenshots +The dashboard provides visual management for all account types: -*(Add screenshots here when available)* +- **Claude Accounts**: Create isolated instances (work, personal, client) +- **OAuth Providers**: One-click auth for Gemini, Codex, Antigravity +- **API Profiles**: Configure GLM, Kimi with your keys +- **Health Monitor**: Real-time status across all profiles -## Usage Examples +**Analytics (Light/Dark Theme)** -### Basic Switching +![Analytics Light](docs/assets/screenshots/analytics-light.png) + +![Analytics Dark](docs/assets/screenshots/analytics.png) + +**API Profiles & OAuth Providers** + +![API Profiles](docs/assets/screenshots/api_profiles.png) + +![CLIProxy](docs/assets/screenshots/cliproxy.png) + +
+ +## Supported Providers + +| Provider | Auth Type | Command | Best For | +|----------|-----------|---------|----------| +| **Claude** | Subscription | `ccs` | Default, strategic planning | +| **Gemini** | OAuth | `ccs gemini` | Zero-config, fast iteration | +| **Codex** | OAuth | `ccs codex` | Code generation | +| **Antigravity** | OAuth | `ccs agy` | Alternative routing | +| **GLM** | API Key | `ccs glm` | Cost-optimized execution | +| **Kimi** | API Key | `ccs kimi` | Long-context, thinking mode | + +> **OAuth providers** authenticate via browser on first run. Tokens are cached in `~/.ccs/cliproxy/auth/`. + +
+ +## Usage + +### Basic Commands ```bash -ccs # Claude subscription (default) -ccs glm # GLM (cost-optimized) -ccs kimi # Kimi (with thinking support) +ccs # Default Claude session +ccs agy # Antigravity (OAuth) +ccs gemini # Gemini (OAuth) +ccs glm # GLM (API key) ``` -### Multi-Account Setup +### Parallel Workflows + +Run multiple terminals with different providers: + +```bash +# Terminal 1: Planning (Claude Pro) +ccs work "design the authentication system" + +# Terminal 2: Execution (GLM - cost optimized) +ccs glm "implement the user service from the plan" + +# Terminal 3: Review (Gemini) +ccs gemini "review the implementation for security issues" +``` + +### Multi-Account Claude + +Create isolated Claude instances for work/personal separation: ```bash -# Create accounts ccs auth create work -ccs auth create personal + +# Run concurrently in separate terminals +ccs work "implement feature" # Terminal 1 +ccs "review code" # Terminal 2 (personal account) ``` -**Run concurrently in separate terminals:** - -```bash -# Terminal 1 - Work -ccs work "implement feature" - -# Terminal 2 - Personal (concurrent) -ccs personal "review code" -``` - -### Help & Version - -```bash -ccs --version # Show version -ccs --help # Show all commands and options -``` - -
- -## AI-Powered Delegation - -> [!TIP] -> **New in v4.0**: Delegate tasks to cost-optimized models (GLM, Kimi) directly from your main Claude session. Save 81% on simple tasks with real-time visibility. - -### What is Delegation? - -CCS Delegation lets you **send tasks to alternative models** (`glm`, `kimi`) **from your main Claude session** using the `-p` flag or intelligent slash commands (`/ccs`, `/ccs:continue`). - -**Why use it?** -- **Token efficiency**: Simple tasks cost 81% less on GLM vs main Claude session -- **Context preservation**: Main session stays clean, no pollution from mechanical tasks -- **Real-time visibility**: See tool usage as tasks execute (`[Tool] Write: index.html`) -- **Multi-turn support**: Resume sessions with `:continue` for iterative work - -### Quick Examples - -**Direct CLI:** -```bash -# Delegate simple task to GLM (cost-optimized) -ccs glm -p "add tests for UserService" - -# Delegate long-context task to Kimi -ccs kimi -p "analyze all files in src/ and document architecture" - -# Continue previous session -ccs glm:continue -p "run the tests and fix any failures" -``` - -**Via Slash Commands** (inside Claude sessions): -```bash -# In your main Claude session: -/ccs "refactor auth.js to use async/await" # Auto-selects best profile -/ccs --glm "fix typo in documentation" # Forces GLM profile -/ccs --kimi "analyze entire architecture" # Forces Kimi profile -/ccs:continue "also update the README examples" # Continues last session -``` - -**Via Natural Language** (Claude auto-delegates): -```bash -# Claude detects delegation patterns and auto-executes: -"Use ccs glm to add tests for all *.service.js files" -"Delegate to kimi: analyze project structure" -``` - -### Real-Time Output - -See exactly what's happening as tasks execute: - -``` -$ ccs glm -p "/cook create a landing page" -[i] Delegating to GLM-4.6... -[Tool] Write: /home/user/project/index.html -[Tool] Write: /home/user/project/styles.css -[Tool] Write: /home/user/project/script.js -[Tool] Edit: /home/user/project/styles.css -[i] Execution completed in 45.2s - -╔══════════════════════════════════════════════════════╗ -║ Working Directory: /home/user/project ║ -║ Model: GLM-4.6 ║ -║ Duration: 45.2s ║ -║ Exit Code: 0 ║ -║ Session ID: 3a4f8c21 ║ -║ Total Cost: $0.0015 ║ -║ Turns: 3 ║ -╚══════════════════════════════════════════════════════╝ -``` - -### Advanced Features - -**Slash Command Support:** -Delegation preserves custom slash commands in prompts: -```bash -ccs glm -p "/cook create responsive landing page" -# Executes /cook command in delegated GLM session -``` - -**Signal Handling:** -Ctrl+C or Esc properly kills delegated processes (no orphans): -```bash -# Hit Ctrl+C during delegation -[!] Parent process terminating, killing delegated session... -``` - -**Time-Based Limits:** -10-minute default timeout with graceful termination (supports `:continue`): -```bash -ccs glm -p "complex task" # Auto-terminates after 10min if needed -ccs glm:continue -p "pick up where we left off" -``` - -### Cost Savings Example - -**Traditional (Main Session):** -``` -Context load: 2000 tokens -Discussion: 1500 tokens -Code gen: 4500 tokens -───────────────────────── -Total: 8000 tokens → $0.032 -``` - -**Delegation (GLM):** -``` -3x tasks via GLM: 1500 tokens → $0.0045 -───────────────────────────────────────── -Savings: $0.0275 (86% reduction) -``` - -### Documentation - -- **Workflow Diagrams**: See [docs/ccs-delegation-diagrams.md](docs/ccs-delegation-diagrams.md) for visual architecture -- **Skill Reference**: `.claude/skills/ccs-delegation/` for AI decision framework (replaces deprecated agents) -- **Agent Docs**: `.claude/agents/ccs-delegator.md` was deprecated in v4.3.2, functionality moved to ccs-delegation skill - -
- -## GLM with Thinking (GLMT) - -> [!CAUTION] -> ### NOT PRODUCTION READY - EXPERIMENTAL FEATURE -> -> **GLMT is experimental and requires extensive debugging**: -> - Streaming and tool support still under active development -> - May experience unexpected errors, timeouts, or incomplete responses -> - Requires frequent debugging and manual intervention -> - **Not recommended for critical workflows or production use** -> -> **Alternative for GLM Thinking**: Consider going through the **CCR hustle** with the **Transformer of Bedolla** ([ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/)) for a more stable implementation. - -> [!IMPORTANT] -> GLMT requires npm installation (`npm install -g @kaitranntt/ccs`). Not available in native shell versions (requires Node.js HTTP server). - -
- -> [!NOTE] -> ### Acknowledgments: The Foundation That Made GLMT Possible -> -> **CCS's GLMT implementation owes its existence to the groundbreaking work of [@Bedolla](https://github.com/Bedolla)**, who created [ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/) - the **first integration** to bridge [Claude Code Router (CCR)](https://github.com/musistudio/claude-code-router) with Z.AI's reasoning capabilities. -> -> **Why this matters**: Before ZaiTransformer, no one had successfully integrated Z.AI's thinking mode with Claude Code's workflow. Bedolla's work wasn't just helpful - it was **foundational**. His implementation of: -> -> - **Request/response transformation architecture** - The conceptual blueprint for how to bridge Anthropic and OpenAI formats -> - **Thinking mode control mechanisms** - The patterns for managing reasoning_content delivery -> - **Embedded proxy design** - The architecture that CCS's GLMT proxy is built upon -> -> These contributions directly inspired and enabled GLMT's design. **Without ZaiTransformer's pioneering work, GLMT wouldn't exist in its current form**. The technical patterns, transformation logic, and proxy architecture implemented in CCS are a direct evolution of the concepts Bedolla first proved viable. -> -> **Recognition**: If you benefit from GLMT's thinking capabilities, you're benefiting from Bedolla's vision and engineering. Please consider starring [ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/) to support pioneering work in the Claude Code ecosystem. - -
- -
-

GLM vs GLMT Comparison

- -
- -
- -| Feature | GLM (`ccs glm`) | GLMT (`ccs glmt`) | -|:--------|:----------------|:------------------| -| **Endpoint** | Anthropic-compatible | OpenAI-compatible | -| **Thinking** | No | Experimental (`reasoning_content`) | -| **Tool Support** | Basic | **Unstable (v3.5+)** | -| **MCP Tools** | Limited | **Buggy (v3.5+)** | -| **Streaming** | Stable | **Experimental (v3.4+)** | -| **TTFB** | <500ms | <500ms (sometimes), 2-10s+ (often) | -| **Use Case** | Reliable work | **Debugging experiments only** | - -
- -
- -
-

Tool Support (v3.5) - EXPERIMENTAL

- -
- -**GLMT attempts MCP tools and function calling:** - -- **Bidirectional Transformation**: Anthropic tools ↔ OpenAI format (unstable) -- **MCP Integration**: MCP tools sometimes execute (often output XML garbage) -- **Streaming Tool Calls**: Real-time tool calls (when not crashing) -- **Backward Compatible**: May break existing thinking support -- **Configuration Required**: Frequent manual debugging needed - -
- -
-

Streaming Support (v3.4) - OFTEN FAILS

- -
- -**GLMT attempts real-time streaming** with incremental reasoning content delivery: - -- **Default**: Streaming enabled (TTFB <500ms when it works) -- **Auto-fallback**: Frequently switches to buffered mode due to errors -- **Thinking parameter**: Claude CLI `thinking` parameter sometimes works - - May ignore `thinking.type` and `budget_tokens` - - Precedence: CLI parameter > message tags > default (when not broken) - -**Status**: Z.AI (tested, tool calls frequently break, requires constant debugging) - -
- -
-

How It Works (When It Works)

- -
- -1. CCS spawns embedded HTTP proxy on localhost (if not crashing) -2. Proxy attempts to convert Anthropic format → OpenAI format (often fails) -3. Tries to transform Anthropic tools → OpenAI function calling format (buggy) -4. Forwards to Z.AI with reasoning parameters and tools (when not timing out) -5. Attempts to convert `reasoning_content` → thinking blocks (partial or broken) -6. Attempts to convert OpenAI `tool_calls` → Anthropic `tool_use` blocks (XML garbage common) -7. Thinking and tool calls sometimes appear in Claude Code UI (when not broken) - -
- -
-

Control Tags & Keywords

- -
- -**Control Tags**: -- `` - Enable/disable reasoning blocks (default: On) -- `` - Control reasoning depth (deprecated - Z.AI only supports binary thinking) - -**Thinking Keywords** (inconsistent activation): -- `think` - Sometimes enables reasoning (low effort) -- `think hard` - Sometimes enables reasoning (medium effort) -- `think harder` - Sometimes enables reasoning (high effort) -- `ultrathink` - Attempts maximum reasoning depth (often breaks) - -
- -
-

Environment Variables

- -
- -**GLMT features** (all experimental): -- Forced English output enforcement (sometimes works) -- Random thinking mode activation (unpredictable) -- Attempted streaming with frequent fallback to buffered mode - -**General**: -- `CCS_DEBUG_LOG=1` - Enable debug file logging -- `CCS_CLAUDE_PATH=/path/to/claude` - Custom Claude CLI path - -
- -
-

API Key Setup

- -
- -```bash -# Edit GLMT settings -nano ~/.ccs/glmt.settings.json -``` - -Set Z.AI API key (requires coding plan): - -```json -{ - "env": { - "ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key" - } -} -``` - -
- -
-

Security Limits (DoS Protection)

- -
- -**v3.4 Protection Limits**: - -| Limit | Value | Purpose | -|:------|:------|:--------| -| **SSE buffer** | 1MB max per event | Prevent buffer overflow | -| **Content buffer** | 10MB max per block | Limit thinking/text blocks | -| **Content blocks** | 100 max per message | Prevent DoS attacks | -| **Request timeout** | 120s | Both streaming and buffered | - -
- -
-

Debugging

- -
- -**Enable verbose logging**: -```bash -ccs glmt --verbose "your prompt" -``` - -**Enable debug file logging**: -```bash -export CCS_DEBUG_LOG=1 -ccs glmt --verbose "your prompt" -# Logs: ~/.ccs/logs/ -``` - -**GLMT debugging**: -```bash -# Verbose logging shows streaming status and reasoning details -ccs glmt --verbose "test" -``` - -**Check reasoning content**: -```bash -cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content' -``` - -**Troubleshooting**: -- **If absent**: Z.AI API issue (verify key, account status) -- **If present**: Transformation issue (check `response-anthropic.json`) - -
-
## Maintenance ### Health Check -Run diagnostics to verify your CCS installation: - ```bash ccs doctor ``` -**Checks performed**: -- ✓ Claude CLI availability -- ✓ Configuration files (config.json, profiles) -- ✓ CCS symlinks to ~/.claude/ -- ✓ Delegation system -- ✓ File permissions +Verifies: Claude CLI, config files, symlinks, permissions. -**Output**: -``` -[?] Checking Claude CLI... [OK] -[?] Checking ~/.ccs/ directory... [OK] -[?] Checking config.json... [OK] -[?] Checking CCS symlinks... [OK] -... -Status: Installation healthy -``` - -### Updating CCS +### Update ```bash -# Update to latest stable version -ccs update - -# Force reinstall (fix corrupted installation) -ccs update --force - -# Install beta/dev channel (unstable, for testing) -ccs update --beta - -# Force reinstall from dev channel -ccs update --force --beta +ccs update # Update to latest +ccs update --force # Force reinstall +ccs update --beta # Install dev channel ``` -**Note:** `--beta` installs from the `@dev` npm tag, which contains unreleased features. Not recommended for production use. - -### Update CCS Items - -If you modify CCS items or need to re-install symlinks: +### Sync Shared Items ```bash ccs sync ``` -**What it does**: -- Re-creates selective symlinks from `~/.ccs/.claude/` to `~/.claude/` -- Backs up existing files before replacing -- Safe to run multiple times (idempotent) - -**When to use**: -- After manual modifications to ~/.claude/ -- If `ccs doctor` reports symlink issues -- After upgrading CCS to a new version +Re-creates symlinks for shared commands, skills, and settings.
-### Troubleshooting +## Configuration -#### Broken Installation +CCS auto-creates config on install. Dashboard is the recommended way to manage settings. -If CCS is corrupted or behaving unexpectedly: +**Config location**: `~/.ccs/config.yaml` + +
+Custom Claude CLI path + +If Claude CLI is installed in a non-standard location: ```bash -# Force reinstall to fix -ccs update --force +export CCS_CLAUDE_PATH="/path/to/claude" # Unix +$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows ``` -If that doesn't work, try manual reinstall: +
-```bash -npm install -g @kaitranntt/ccs@latest --force -``` +
+Windows symlink support -#### Beta Testing Issues +Enable Developer Mode for true symlinks: -If you're on the dev channel and experiencing issues: +1. **Settings** → **Privacy & Security** → **For developers** +2. Enable **Developer Mode** +3. Reinstall: `npm install -g @kaitranntt/ccs` -```bash -# Return to stable channel -ccs update -``` +Without Developer Mode, CCS falls back to copying directories. -#### Common Issues +
-- **Update fails**: Check network connection and try `ccs update --force` -- **Beta not working**: Use `ccs update` to return to stable version -- **Direct install error**: Beta channel requires npm installation +
-For detailed troubleshooting, see [Troubleshooting Guide](./docs/en/troubleshooting.md). +## Documentation + +| Topic | Link | +|-------|------| +| Installation | [docs/en/installation.md](./docs/en/installation.md) | +| Configuration | [docs/en/configuration.md](./docs/en/configuration.md) | +| OAuth Providers | [docs/en/oauth.md](./docs/en/oauth.md) | +| Multi-Account Claude | [docs/en/multi-account.md](./docs/en/multi-account.md) | +| Delegation | [docs/en/delegation.md](./docs/en/delegation.md) | +| GLMT (Experimental) | [docs/en/glmt.md](./docs/en/glmt.md) | +| Architecture | [docs/system-architecture.md](./docs/system-architecture.md) | +| Troubleshooting | [docs/en/troubleshooting.md](./docs/en/troubleshooting.md) |
## Uninstall -### npm (Recommended) - ```bash npm uninstall -g @kaitranntt/ccs ```
-Alternative Package Managers - -
+Alternative package managers ```bash -# yarn yarn global remove @kaitranntt/ccs - -# pnpm pnpm remove -g @kaitranntt/ccs - -# bun bun remove -g @kaitranntt/ccs ```
-
-Legacy Uninstallers (for native installs) -
-```bash -# macOS / Linux -curl -fsSL ccs.kaitran.ca/uninstall | bash - -# Windows PowerShell -irm ccs.kaitran.ca/uninstall | iex -``` - -
- -
- -## 🎯 Philosophy +## Philosophy - **YAGNI**: No features "just in case" -- **KISS**: Simple bash, no complexity +- **KISS**: Simple, focused implementation - **DRY**: One source of truth (config) -## 📖 Documentation +
-**Complete documentation in [docs/](./docs/)**: -- [Installation Guide](./docs/en/installation.md) -- [Configuration](./docs/en/configuration.md) -- [Usage Examples](./docs/en/usage.md) -- [System Architecture](./docs/system-architecture.md) -- [GLMT Control Mechanisms](./docs/glmt-controls.md) -- [Troubleshooting](./docs/en/troubleshooting.md) -- [Contributing](./CONTRIBUTING.md) +## Contributing -## 🤝 Contributing - -We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details. - - -## Star History - -
- -Star History Chart - -
+See [CONTRIBUTING.md](./CONTRIBUTING.md). +
## License -CCS is licensed under the [MIT License](LICENSE). +MIT License - see [LICENSE](LICENSE).
-**Made with ❤️ for developers who hit rate limits too often** +--- -[⭐ Star this repo](https://github.com/kaitranntt/ccs) | [🐛 Report issues](https://github.com/kaitranntt/ccs/issues) | [📖 Read docs](./docs/en/) +**[ccs.kaitran.ca](https://ccs.kaitran.ca)** | [Report Issues](https://github.com/kaitranntt/ccs/issues) | [Star on GitHub](https://github.com/kaitranntt/ccs)
diff --git a/docs/assets/screenshots/analytics-light.png b/docs/assets/screenshots/analytics-light.png new file mode 100644 index 00000000..3ab3f969 Binary files /dev/null and b/docs/assets/screenshots/analytics-light.png differ diff --git a/docs/assets/screenshots/analytics.png b/docs/assets/screenshots/analytics.png new file mode 100644 index 00000000..34bd1563 Binary files /dev/null and b/docs/assets/screenshots/analytics.png differ diff --git a/docs/assets/screenshots/api_profiles.png b/docs/assets/screenshots/api_profiles.png new file mode 100644 index 00000000..b6243bc1 Binary files /dev/null and b/docs/assets/screenshots/api_profiles.png differ diff --git a/docs/assets/screenshots/cliproxy.png b/docs/assets/screenshots/cliproxy.png new file mode 100644 index 00000000..a292e6a0 Binary files /dev/null and b/docs/assets/screenshots/cliproxy.png differ diff --git a/docs/ja/README.md b/docs/ja/README.md index 2ce4cbe2..4243f49a 100644 --- a/docs/ja/README.md +++ b/docs/ja/README.md @@ -2,652 +2,252 @@ # CCS - Claude Code Switch -![CCS Logo](../../docs/assets/ccs-logo-medium.png) +![CCS Logo](../assets/ccs-logo-medium.png) -### 1コマンド、ダウンタイムなし、複数アカウント +### 1つのダッシュボードで複数のAIアカウントを管理。 +Claude、Gemini、GLM、その他を同時に実行 - 競合なしで。 -**複数のClaudeアカウント、GLM、Kimiを瞬時に切り替え。** -レート制限を回避し、継続的に作業。 - -
- -[![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](LICENSE) -[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=for-the-badge)]() +[![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](../../LICENSE) [![npm](https://img.shields.io/npm/v/@kaitranntt/ccs?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@kaitranntt/ccs) [![PoweredBy](https://img.shields.io/badge/PoweredBy-ClaudeKit-C15F3C?style=for-the-badge)](https://claudekit.cc?ref=HMNKXOHN) -**Languages**: [English](../../README.md) · [Tiếng Việt](../vi/README.md) · [日本語](README.md) +**[機能 & 料金](https://ccs.kaitran.ca)** | **[ドキュメント](../en/)** | [English](../../README.md) | [Tiếng Việt](../vi/README.md)
+## 3つの柱 + +| 機能 | 説明 | 管理方法 | +|------|------|----------| +| **複数Claudeアカウント** | 仕事用 + 個人用のClaudeを同時実行 | ダッシュボード | +| **OAuthプロバイダー** | Gemini、Codex、Antigravity - APIキー不要 | ダッシュボード | +| **APIプロファイル** | 自分のAPIキーでGLM、Kimiを利用 | ダッシュボード | + +
+ ## クイックスタート -### インストール +### 1. インストール -**npmパッケージ(推奨)** - -**macOS / Linux / Windows** ```bash npm install -g @kaitranntt/ccs ``` -**主要なパッケージマネージャーすべてに対応:** +
+他のパッケージマネージャー ```bash -# yarn -yarn global add @kaitranntt/ccs - -# pnpm(ディスク使用量70%削減) -pnpm add -g @kaitranntt/ccs - -# bun(30倍高速) -bun add -g @kaitranntt/ccs +yarn global add @kaitranntt/ccs # yarn +pnpm add -g @kaitranntt/ccs # pnpm (70%ディスク節約) +bun add -g @kaitranntt/ccs # bun (30倍高速) ``` -
-[!] 非推奨: ネイティブシェルインストーラー(レガシー) - -
- -> [!WARNING] -> **これらのインストーラーは非推奨であり、将来のバージョンで削除されます。** -> 現在は npm インストールに自動リダイレクトされます。npm を直接使用してください。 - -**macOS / Linux** -```bash -curl -fsSL ccs.kaitran.ca/install | bash -``` - -**Windows PowerShell** -```powershell -irm ccs.kaitran.ca/install | iex -``` - -**注**: スクリプトは非推奨の警告を表示し、Node.jsが利用可能な場合は自動的にnpmインストールを実行します。 -
-
- -### 設定(自動作成) - -**CCSはインストール時に自動的に設定を作成します**(npm postinstallスクリプト経由)。 - -**~/.ccs/config.json**: -```json -{ - "profiles": { - "glm": "~/.ccs/glm.settings.json", - "glmt": "~/.ccs/glmt.settings.json", - "kimi": "~/.ccs/kimi.settings.json", - "default": "~/.claude/settings.json" - } -} -``` - -
-

カスタムClaude CLIパス

- -
- -Claude CLIが標準以外の場所(Dドライブ、カスタムディレクトリ)にインストールされている場合は、`CCS_CLAUDE_PATH`を設定してください: +### 2. ダッシュボードを開く ```bash -# Unix/Linux/macOS -export CCS_CLAUDE_PATH="/path/to/claude" - -# Windows PowerShell -$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" +ccs config +# http://localhost:3000 を開きます ``` -**参照**: [トラブルシューティングガイド](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location) 詳細な設定手順 +### 3. アカウントを設定 -
+ダッシュボードはすべてのアカウントタイプをビジュアルに管理できます: -
-

Windowsシンボリックリンクサポート(開発者モード)

+- **Claudeアカウント**: 分離されたインスタンスを作成(仕事、個人、クライアント) +- **OAuthプロバイダー**: Gemini、Codex、Antigravityのワンクリック認証 +- **APIプロファイル**: 自分のキーでGLM、Kimiを設定 +- **ヘルスモニター**: すべてのプロファイルのリアルタイムステータス + +**アナリティクス (ライト/ダークテーマ)** + +![Analytics Light](../assets/screenshots/analytics-light.png) + +![Analytics Dark](../assets/screenshots/analytics.png) + +**APIプロファイル & OAuthプロバイダー** + +![API Profiles](../assets/screenshots/api_profiles.png) + +![CLIProxy](../assets/screenshots/cliproxy.png)
-**Windowsユーザー**: 本物のシンボリックリンクで高速な動作と即時同期を得るために開発者モードを有効にしてください: +## サポートされているプロバイダー -1. **設定** → **プライバシーとセキュリティ** → **開発者向け** を開く -2. **開発者モード** を有効にする -3. CCSを再インストール: `npm install -g @kaitranntt/ccs` +| プロバイダー | 認証タイプ | コマンド | 最適な用途 | +|--------------|------------|----------|------------| +| **Claude** | サブスクリプション | `ccs` | デフォルト、戦略的計画 | +| **Gemini** | OAuth | `ccs gemini` | ゼロ設定、高速イテレーション | +| **Codex** | OAuth | `ccs codex` | コード生成 | +| **Antigravity** | OAuth | `ccs agy` | 代替ルーティング | +| **GLM** | APIキー | `ccs glm` | コスト最適化 | +| **Kimi** | APIキー | `ccs kimi` | ロングコンテキスト、思考モード | -**警告**: 開発者モードなしの場合、CCSは自動的にディレクトリコピーにフォールバック(動作しますが、プロファイル間の即時同期はありません) - -
+> **OAuthプロバイダー**は初回実行時にブラウザで認証します。トークンは `~/.ccs/cliproxy/auth/` にキャッシュされます。
-### 最初の切り替え +## 使用方法 -> [!IMPORTANT] -> **代替モデルを使用する前に、設定ファイルでAPIキーを更新してください:** -> -> - **GLM**: `~/.ccs/glm.settings.json`を編集してZ.AI Coding Plan APIキーを追加 -> - **GLMT**: `~/.ccs/glmt.settings.json`を編集してZ.AI Coding Plan APIキーを追加 -> - **Kimi**: `~/.ccs/kimi.settings.json`を編集してKimi APIキーを追加 - -
- -**並列ワークフロー:計画 + 実行** +### 基本コマンド ```bash -# Terminal 1 - 計画(Claude Sonnet) -ccs "認証とレート制限付きREST APIの計画" - -# Terminal 2 - 実行(GLM、コスト最適化) -ccs glm "計画からユーザー認証エンドポイントを実装" +ccs # デフォルトのClaudeセッション +ccs agy # Antigravity (OAuth) +ccs gemini # Gemini (OAuth) +ccs glm # GLM (APIキー) ``` -
-思考モデル(Kimi & GLMT) +### 並列ワークフロー -
+異なるプロバイダーで複数のターミナルを実行: ```bash -# Kimi - 安定した思考サポート -ccs kimi "トレードオフ分析付きキャッシュ戦略の設計" +# ターミナル1: 計画 (Claude Pro) +ccs work "認証システムを設計" -# GLMT - 実験的(詳細は下記参照) -ccs glmt "推論ステップ付き複雑なアルゴリズムのデバッグ" +# ターミナル2: 実行 (GLM - コスト最適化) +ccs glm "計画に基づいてユーザーサービスを実装" + +# ターミナル3: レビュー (Gemini) +ccs gemini "セキュリティ問題について実装をレビュー" ``` -**注**: GLMTは実験的で不安定です。詳細については下記の[GLM with Thinking (GLMT)](#glm-with-thinking-glmt)セクションを参照してください。 +### マルチアカウントClaude -
- -
- -## 開発者の日常的な課題 - -
- -### **切り替えを停止。調整を開始。** - -**セッション制限がフロー状態を殺すべきではありません。** -
- -実装に深く集中しています。コンテキストが読み込まれました。解決策が結晶化しています。
-その後: 🔴 _"使用制限に達しました。"_ - -**モチベーションが失われました。コンテキストが失われました。生産性が崩壊しました。** - -## **解決策:並列ワークフロー** - -
-❌ 古い方法: 制限に達した時に切り替える(反応的) - -### 現在のワークフロー: -- **14時:** 機能開発、ゾーン状態 -- **15時:** 🔴 使用制限に達した -- **15:05:** 作業停止、`~/.claude/settings.json`を編集 -- **15:15:** アカウント切り替え、コンテキストが失われる -- **15:30:** フロー状態に戻ろうと試みる -- **16時:** ついに生産性が回復 - -- **結果:** 1時間失われ、モチベーションが破壊され、不満が蓄積 - -
- -
-✨ 新しい方法: 最初から並列で実行(主導的) - 推奨 - -### 新しいワークフロー: -- **14時:** **ターミナル1:** `ccs "APIアーキテクチャを計画"` → 戦略的思考(Claude Pro) -- **14時:** **ターミナル2:** `ccs glm "エンドポイントを実装"` → コード実行(GLM) -- **15時:** まだ開発継続、割れなし -- **16時:** フロー状態達成、生産性急上昇 -- **17時:** 機能が完了、コンテキスト維持 - -- **結果:** ダウムタイムなし、継続的生産性、不満減少 - -### 💰 **価値提案:** -- **設定:** 既存のClaude Pro + GLM Lite(費用対効果の高い追加) -- **価値:** 1時間/日 × 20労働日 = 20時間/月を回収 -- **ROI:** 開発時間は設定コスト以上の価値がある -- **現実:** オーバーヘッドより速く出荷 - -
- -## あなたの道を選択 - -
-予算重視: GLMのみ - -- **最適:** 費用意識の高い開発、基本的なコード生成 -- **使用法:** 費用効果の高いAI支援のために`ccs glm`を直接使用 -- **現実:** Claudeアクセスなし、多くのコーディングタスクに対応可能 -- **設定:** GLM APIキーのみ、非常に手頃 - -
- -
-✨ 日々の開発に推奨: 1 Claude Pro + 1 GLM Lite - -- **最適:** 日々のコードデリバリー、真剣な開発作業 -- **使用法:** `ccs`で計画 + `ccs glm`で実行(並列ワークフロー) -- **現実:** ほとんどの開発者にとって能力と費用の完璧なバランス -- **価値:** セッション制限に達せず、継続的生産性 - -
- -
-パワーユーザー: 複数のClaude Pro + GLM Pro - -- **最適:** 重い作業量、並行プロジェクト、ソロ開発 -- **解放:** セッション・週次制限を決して枯渇させない -- **ワークフロー:** 3+以上のターミナルで専門タスクを同時実行 - -
- -
-プライバシー重視: 仕事/個人の分離 - -- **必要時:** 仕事と個人AIコンテキストの厳格な分離 -- **設定:** `ccs auth create work` + `ccs auth create personal` -- **注意:** 高度な機能 - ほとんどのユーザーには不要 - -
- ---- - -## 手動切り替えではなくCCSを使う理由は? - -
- -**CCSは「午後3時に制限に達したら切り替える」ことではありません。** - -## **それは最初から並列で実行することです。** - -
- -### コアな違い - -| **手動切り替え** | **CCSオーケストレーション** | -|:---|:---| -| 🔴 制限達成 → 作業停止 → 設定ファイル編集 → 再起動 | ✅ 最初から異なるモデルで複数ターミナルを実行 | -| 😰 コンテキストロスとフロー状態中断 | 😌 コンテキスト維持での継続的生産性 | -| 📝 逐次的タスク処理 | ⚡ 並列ワークフロー(計画 + 実行を同時に) | -| 🛠️ ブロックされた時の反応的問題解決 | 🎯 ブロックを防ぐ主導的ワークフロー設計 | - -### CCSが提供するもの - -- **ゼロコンテキスト切り替え:** 割れずにフロー状態を維持 -- **並列生産性:** 1ターミナルで戦略計画、もう1つでコード実行 -- **即座アカウント管理:** 1コマンド切り替え、設定ファイル編集不要 -- **仕事と生活の分離:** ログアウトせずにコンテキストを分離 -- **クロスプラットフォーム一貫性:** macOS、Linux、Windowsで同じスムーズな体験 - -
- -## アーキテクチャ - -### プロファイルタイプ - -**設定ベース**: GLM, GLMT, Kimi, default -- 設定ファイルを指す`--settings`フラグを使用 -- GLMT: 思考モードサポートの埋め込みプロキシ - -**アカウントベース**: work, personal, team -- 分離されたインスタンスに`CLAUDE_CONFIG_DIR`を使用 -- `ccs auth create `で作成 - -### 共有データ(v3.1) - -コマンドとスキルは`~/.ccs/shared/`からシンボリックリンク - プロファイル間の重複なし。 - -```plaintext -~/.ccs/ -├── shared/ # すべてのプロファイルで共有 -│ ├── agents/ -│ ├── commands/ -│ └── skills/ -├── instances/ # プロファイル固有のデータ -│ └── work/ -│ ├── agents@ → shared/agents/ -│ ├── commands@ → shared/commands/ -│ ├── skills@ → shared/skills/ -│ ├── settings.json # APIキー、認証情報 -│ ├── sessions/ # 会話履歴 -│ └── ... -``` - -| タイプ | ファイル | -|:-----|:------| -| **共有** | `commands/`, `skills/`, `agents/` | -| **プロファイル固有** | `settings.json`, `sessions/`, `todolists/`, `logs/` | - -> [!NOTE] -> **Windows**: シンボリックリンクが利用できない場合はディレクトリをコピー(本物のシンボリックリンクには開発者モードを有効にしてください) - -
- -## 使用例 - -### 基本的な切り替え +仕事/個人用に分離されたClaudeインスタンスを作成: ```bash -ccs # Claudeサブスクリプション(デフォルト) -ccs glm # GLM(コスト最適化) -ccs kimi # Kimi(思考サポート付き) -``` - -### マルチアカウント設定 - -```bash -# アカウントを作成 ccs auth create work -ccs auth create personal + +# 別々のターミナルで同時実行 +ccs work "機能を実装" # ターミナル1 +ccs "コードをレビュー" # ターミナル2 (個人アカウント) ``` -**別々のターミナルで同時に実行:** +
+ +## メンテナンス + +### ヘルスチェック ```bash -# Terminal 1 - 業務用 -ccs work "機能を実装" - -# Terminal 2 - 個人用(同時) -ccs personal "コードレビュー" +ccs doctor ``` -### ヘルプとバージョン +検証: Claude CLI、設定ファイル、シンボリックリンク、パーミッション。 + +### アップデート ```bash -ccs --version # バージョンを表示 -ccs --help # すべてのコマンドとオプションを表示 +ccs update # 最新版にアップデート +ccs update --force # 強制再インストール +ccs update --beta # devチャンネルをインストール ``` -
- -## GLM with Thinking (GLMT) - -> [!CAUTION] -> ### 本番環境未対応 - 実験的機能 -> -> **GLMTは実験的で広範なデバッグが必要です**: -> - ストリーミングとツールサポートはまだ開発中 -> - 予期せぬエラー、タイムアウト、不完全な応答が発生する可能性 -> - 頻繁なデバッグと手動介入が必要 -> - **重要なワークフローや本番使用には推奨されません** -> -> **GLM Thinkingの代替案**: **CCR hustle**と**BedollaのTransformer**([ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/))を通じて、より安定した実装を検討してください。 - -> [!IMPORTANT] -> GLMTはnpmインストールが必要です(`npm install -g @kaitranntt/ccs`)。ネイティブシェルバージョンでは利用できません(Node.js HTTPサーバーが必要)。 - -
- -> [!NOTE] -> ### 謝辞:GLMTを可能にした基盤 -> -> **CCSのGLMT実装は、[@Bedolla](https://github.com/Bedolla)の画期的な仕事に存在を負っています**。彼は[Claude Code Router (CCR)](https://github.com/musistudio/claude-code-router)とZ.AIの推論能力をブリッジする[最初の統合](https://github.com/Bedolla/ZaiTransformer/)を作成しました。 -> -> ZaiTransformer以前、誰もZ.AIの思考モードとClaude Codeのワークフローを正常に統合できませんでした。Bedollaの仕事は単なる有用なものではなく、**基盤的**でした。彼のリクエスト/レスポンストランスフォーメーションアーキテクチャ、思考モード制御メカニズム、埋め込みプロキシ設計の実装は、GLMTの設計に直接インスピレーションを与え、可能にしました。 -> -> **ZaiTransformerの先駆的な仕事なしでは、GLMTは現在の形では存在しませんでした。** GLMTの思考能力から利益を得る場合は、Claude Codeエコシステムでの先駆的な仕事をサポートするために[ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/)にスターを付けてください。 - -
- -
-

GLM vs GLMT 比較

- -
- -
- -| 機能 | GLM (`ccs glm`) | GLMT (`ccs glmt`) | -|:--------|:----------------|:------------------| -| **エンドポイント** | Anthropic互換 | OpenAI互換 | -| **思考** | なし | 実験的(reasoning_content) | -| **ツールサポート** | 基本的 | **不安定(v3.5+)** | -| **MCPツール** | 制限あり | **バグあり(v3.5+)** | -| **ストリーミング** | 安定 | **実験的(v3.4+)** | -| **TTFB** | <500ms | <500ms(時々)、2-10秒+(頻繁) | -| **使用例** | 信頼性の高い作業 | **デバッグ実験のみ** | - -
- -
- -
- -
-

ツールサポート(v3.5) - 実験的

- -
- -**GLMTはMCPツールと関数呼び出しを試行:** - -- **双方向トランスフォーメーション**: Anthropicツール ↔ OpenAI形式(不安定) -- **MCP統合**: MCPツールが時々実行(多くの場合XMLガベージを出力) -- **ストリーミングツール呼び出し**: リアルタイムツール呼び出し(クラッシュしない場合) -- **後方互換**: 既存の思考サポートを破壊する可能性 -- **設定が必要**: 頻繁な手動デバッグが必要 - -
- -
-

ストリーミングサポート(v3.4) - しばしば失敗

- -
- -**GLMTは増分推論コンテンツ配信でリアルタイムストリーミングを試行:** - -- **デフォルト**: ストリーミング有効(動作時TTFB <500ms) -- **自動フォールバック**: エラーにより頻繁にバッファモードに切り替え -- **思考パラメータ**: Claude CLI `thinking`パラメータが時々動作 - - `thinking.type`と`budget_tokens`を無視する場合 - - 優先順位: CLIパラメータ > メッセージタグ > デフォルト(破壊されていない場合) - -**ステータス**: Z.AI(テスト済み、ツール呼び出しが頻繁に破壊、継続的なデバッグが必要) - -
- -
-

動作原理(動作時)

- -
- -1. CCSがlocalhostに埋め込みHTTPプロキシを生成(クラッシュしない場合) -2. プロキシがAnthropic形式 → OpenAI形式への変換を試行(多くの場合失敗) -3. Anthropicツール → OpenAI関数呼び出し形式への変換を試行(バグあり) -4. 推論パラメータとツールを付けてZ.AIに転送(タイムアウトしない場合) -5. `reasoning_content` → 思考ブロックへの変換を試行(部分的または破壊) -6. OpenAI `tool_calls` → Anthropic `tool_use` ブロックへの変換を試行(XMLガベージが一般的) -7. 思考とツール呼び出しが時々Claude Code UIに表示(破壊されていない場合) - -
- -
-

制御タグとキーワード

- -
- -**制御タグ**: -- `` - 推論ブロックの有効/無効(デフォルト: On) -- `` - 推論深度の制御(非推奨 - Z.AIはバイナリ思考のみサポート) - -**思考キーワード**(不安定なアクティベーション): -- `think` - 時々推論を有効化(低労力) -- `think hard` - 時々推論を有効化(中労力) -- `think harder` - 時々推論を有効化(高労力) -- `ultrathink` - 最大推論深度を試行(多くの場合破壊) - -
- -
-

環境変数

- -
- -**GLMT機能**(すべて実験的): -- 強制的な英語出力強制(時々動作) -- ランダムな思考モードアクティベーション(予測不可能) -- 頻繁なバッファモードへのフォールバック付きストリーミング試行 - -**一般**: -- `CCS_DEBUG_LOG=1` - デバッグファイルロギングを有効化 -- `CCS_CLAUDE_PATH=/path/to/claude` - カスタムClaude CLIパス - -
- -
-

APIキー設定

- -
+### 共有アイテムの同期 ```bash -# GLMT設定を編集 -nano ~/.ccs/glmt.settings.json +ccs sync ``` -Z.AI APIキーを設定(コーディングプランが必要): +共有コマンド、スキル、設定のシンボリックリンクを再作成します。 -```json -{ - "env": { - "ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key" - } -} +
+ +## 設定 + +CCSはインストール時に自動的に設定を作成します。ダッシュボードが設定管理の推奨方法です。 + +**設定の場所**: `~/.ccs/config.yaml` + +
+カスタムClaude CLIパス + +Claude CLIが標準以外の場所にインストールされている場合: + +```bash +export CCS_CLAUDE_PATH="/path/to/claude" # Unix +$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows ```
-

セキュリティ制限(DoS保護)

+Windowsシンボリックリンクサポート -
+真のシンボリックリンクには開発者モードを有効にしてください: -**v3.4 保護制限**: +1. **設定** → **プライバシーとセキュリティ** → **開発者向け** +2. **開発者モード**を有効化 +3. 再インストール: `npm install -g @kaitranntt/ccs` -| 制限 | 値 | 目的 | -|:------|:------|:--------| -| **SSEバッファ** | イベントあたり最大1MB | バッファオーバーフローを防止 | -| **コンテンツバッファ** | ブロックあたり最大10MB | 思考/テキストブロックを制限 | -| **コンテンツブロック** | メッセージあたり最大100 | DoS攻撃を防止 | -| **リクエストタイムアウト** | 120秒 | ストリーミングとバッファの両方 | +開発者モードがない場合、CCSはディレクトリコピーにフォールバックします。
-
-

デバッグ

-
-**詳細ロギングを有効化**: -```bash -ccs glmt --verbose "your prompt" -``` +## ドキュメント -**デバッグファイルロギングを有効化**: -```bash -export CCS_DEBUG_LOG=1 -ccs glmt --verbose "your prompt" -# ログ: ~/.ccs/logs/ -``` - -**GLMTデバッグ**: -```bash -# 詳細ロギングでストリーミングステータスと推論詳細を表示 -ccs glmt --verbose "test" -``` - -**推論コンテンツを確認**: -```bash -cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content' -``` - -**トラブルシューティング**: -- **存在しない場合**: Z.AI APIの問題(キー、アカウントステータスを確認) -- **存在する場合**: トランスフォーメーションの問題(`response-anthropic.json`を確認) - -
+| トピック | リンク | +|----------|--------| +| インストール | [docs/en/installation.md](../en/installation.md) | +| 設定 | [docs/en/configuration.md](../en/configuration.md) | +| OAuthプロバイダー | [docs/en/oauth.md](../en/oauth.md) | +| マルチアカウントClaude | [docs/en/multi-account.md](../en/multi-account.md) | +| デリゲーション | [docs/en/delegation.md](../en/delegation.md) | +| GLMT (実験的) | [docs/en/glmt.md](../en/glmt.md) | +| アーキテクチャ | [docs/system-architecture.md](../system-architecture.md) | +| トラブルシューティング | [docs/en/troubleshooting.md](../en/troubleshooting.md) |
## アンインストール -
-

パッケージマネージャー

+```bash +npm uninstall -g @kaitranntt/ccs +``` -
+
+他のパッケージマネージャー ```bash -# npm -npm uninstall -g @kaitranntt/ccs - -# yarn yarn global remove @kaitranntt/ccs - -# pnpm pnpm remove -g @kaitranntt/ccs - -# bun bun remove -g @kaitranntt/ccs ```
-
-

公式アンインストーラー

+
+ +## 哲学 + +- **YAGNI**: 「念のため」の機能なし +- **KISS**: シンプルで焦点を絞った実装 +- **DRY**: 単一の信頼できる情報源(設定)
-```bash -# macOS / Linux -curl -fsSL ccs.kaitran.ca/uninstall | bash +## コントリビューション -# Windows PowerShell -irm ccs.kaitran.ca/uninstall | iex -``` - -
+[CONTRIBUTING.md](../../CONTRIBUTING.md)をご覧ください。
-## 🎯 哲学 - -- **YAGNI**: 「念のため」の機能は追加しない -- **KISS**: シンプルなbash、複雑さなし -- **DRY**: 単一の情報源(設定) - -## 📖 ドキュメント - -**[docs/](./docs/)の完全なドキュメント**: -- [インストールガイド](./docs/en/installation.md) -- [設定](./docs/en/configuration.md) -- [使用例](./docs/en/usage.md) -- [システムアーキテクチャ](./docs/system-architecture.md) -- [GLMT制御メカニズム](./docs/glmt-controls.md) -- [トラブルシューティング](./docs/en/troubleshooting.md) -- [貢献](./CONTRIBUTING.md) - -## 🤝 貢献 - -貢献を歓迎します!詳細については[貢献ガイド](./CONTRIBUTING.md)をご覧ください。 - -## Star History - -
- -Star History Chart - -
- - ## ライセンス -CCSは[MITライセンス](LICENSE)の下でライセンスされています。 +MITライセンス - [LICENSE](../../LICENSE)をご覧ください。
-**レート制限に頻繁に遭遇する開発者のために ❤️ を込めて作成** +--- -[⭐ このリポジトリにスター](https://github.com/kaitranntt/ccs) | [🐛 問題を報告](https://github.com/kaitranntt/ccs/issues) | [📖 ドキュメントを読む](./docs/en/) +**[ccs.kaitran.ca](https://ccs.kaitran.ca)** | [問題を報告](https://github.com/kaitranntt/ccs/issues) | [GitHubでスター](https://github.com/kaitranntt/ccs) -
\ No newline at end of file + diff --git a/docs/vi/README.md b/docs/vi/README.md index c2bb5c0e..5ecb9f8c 100644 --- a/docs/vi/README.md +++ b/docs/vi/README.md @@ -2,652 +2,252 @@ # CCS - Claude Code Switch -![CCS Logo](../../docs/assets/ccs-logo-medium.png) +![CCS Logo](../assets/ccs-logo-medium.png) -### Một lệnh, không downtime, nhiều tài khoản +### Quản lý nhiều tài khoản AI từ một dashboard. +Chạy Claude, Gemini, GLM, và nhiều hơn nữa - đồng thời, không xung đột. -**Chuyển đổi giữa nhiều tài khoản Claude, GLM, và Kimi ngay lập tức.** -Ngừng hitting rate limits. Làm việc liên tục. - -
- -[![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](LICENSE) -[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=for-the-badge)]() +[![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](../../LICENSE) [![npm](https://img.shields.io/npm/v/@kaitranntt/ccs?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@kaitranntt/ccs) [![PoweredBy](https://img.shields.io/badge/PoweredBy-ClaudeKit-C15F3C?style=for-the-badge)](https://claudekit.cc?ref=HMNKXOHN) -**Languages**: [English](../../README.md) · [Tiếng Việt](README.md) · [日本語](../ja/README.md) +**[Tính năng & Bảng giá](https://ccs.kaitran.ca)** | **[Tài liệu](../en/)** | [English](../../README.md) | [日本語](../ja/README.md)
+## Ba Trụ Cột + +| Khả năng | Chức năng | Quản lý qua | +|----------|-----------|-------------| +| **Nhiều Tài khoản Claude** | Chạy Claude công việc + cá nhân đồng thời | Dashboard | +| **Nhà cung cấp OAuth** | Gemini, Codex, Antigravity - không cần API key | Dashboard | +| **Hồ sơ API** | GLM, Kimi với API key của bạn | Dashboard | + +
+ ## Bắt Đầu Nhanh -### Cài Đặt +### 1. Cài Đặt -**npm Package (Được khuyến nghị)** - -**macOS / Linux / Windows** ```bash npm install -g @kaitranntt/ccs ``` -**Tất cả các trình quản lý package chính đều được hỗ trợ:** +
+Trình quản lý package khác ```bash -# yarn -yarn global add @kaitranntt/ccs - -# pnpm (ít hơn 70% dung lượng đĩa) -pnpm add -g @kaitranntt/ccs - -# bun (nhanh hơn 30x) -bun add -g @kaitranntt/ccs +yarn global add @kaitranntt/ccs # yarn +pnpm add -g @kaitranntt/ccs # pnpm (tiết kiệm 70% dung lượng) +bun add -g @kaitranntt/ccs # bun (nhanh hơn 30x) ``` -
-[!] LỖI THỜI: Trình cài đặt shell gốc (Cũ) - -
- -> [!WARNING] -> **Các trình cài đặt này đã lỗi thời và sẽ bị xóa trong phiên bản tương lai.** -> Hiện tại chúng tự động chuyển hướng đến cài đặt npm. Vui lòng sử dụng npm trực tiếp. - -**macOS / Linux** -```bash -curl -fsSL ccs.kaitran.ca/install | bash -``` - -**Windows PowerShell** -```powershell -irm ccs.kaitran.ca/install | iex -``` - -**Lưu ý**: Script hiển thị cảnh báo lỗi thời và tự động chạy cài đặt npm nếu Node.js khả dụng. -
-
- -### Cấu Hình (Tự Tạo) - -**CCS tự động tạo cấu hình trong quá trình cài đặt** (thông qua script postinstall của npm). - -**~/.ccs/config.json**: -```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

- -
- -Nếu Claude CLI được cài đặt ở vị trí không chuẩn (ổ D, thư mục tùy chỉnh), đặt `CCS_CLAUDE_PATH`: +### 2. Mở Dashboard ```bash -# Unix/Linux/macOS -export CCS_CLAUDE_PATH="/path/to/claude" - -# Windows PowerShell -$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" +ccs config +# Mở http://localhost:3000 ``` -**Xem thêm**: [Hướng dẫn Khắc phục Sự cố](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location) để biết chi tiết cài đặt. +### 3. Cấu Hình Tài Khoản -
+Dashboard cung cấp giao diện quản lý trực quan cho tất cả loại tài khoản: -
-

Windows Symlink Support (Developer Mode)

+- **Tài khoản Claude**: Tạo các instance riêng biệt (công việc, cá nhân, khách hàng) +- **Nhà cung cấp OAuth**: Xác thực một cú nhấp cho Gemini, Codex, Antigravity +- **Hồ sơ API**: Cấu hình GLM, Kimi với key của bạn +- **Giám sát Sức khỏe**: Trạng thái thời gian thực cho tất cả profile + +**Analytics (Giao diện Sáng/Tối)** + +![Analytics Light](../assets/screenshots/analytics-light.png) + +![Analytics Dark](../assets/screenshots/analytics.png) + +**API Profiles & Nhà cung cấp OAuth** + +![API Profiles](../assets/screenshots/api_profiles.png) + +![CLIProxy](../assets/screenshots/cliproxy.png)
-**Người dùng Windows**: Bật Chế độ Nhà phát triển để có symlink thực sự (hiệu suất tốt hơn, đồng bộ hóa tức thì): +## Nhà Cung Cấp Được Hỗ Trợ -1. Mở **Settings** → **Privacy & Security** → **For developers** -2. Bật **Developer Mode** -3. Cài đặt lại CCS: `npm install -g @kaitranntt/ccs` +| Nhà cung cấp | Loại xác thực | Lệnh | Phù hợp nhất cho | +|--------------|---------------|------|------------------| +| **Claude** | Subscription | `ccs` | Mặc định, lập kế hoạch chiến lược | +| **Gemini** | OAuth | `ccs gemini` | Zero-config, lặp nhanh | +| **Codex** | OAuth | `ccs codex` | Tạo code | +| **Antigravity** | OAuth | `ccs agy` | Routing thay thế | +| **GLM** | API Key | `ccs glm` | Tối ưu chi phí | +| **Kimi** | API Key | `ccs kimi` | Long-context, thinking mode | -**Cảnh báo**: Nếu không có Chế độ Nhà phát triển, CCS tự động chuyển sang sao chép thư mục (hoạt động nhưng không đồng bộ tức thì trên các profile). - -
+> **Nhà cung cấp OAuth** xác thực qua trình duyệt khi chạy lần đầu. Token được lưu cache tại `~/.ccs/cliproxy/auth/`.
-### Lần Chuyển Đổi Đầu Tiên +## Sử Dụng -> [!IMPORTANT] -> **Trước khi dùng các mô hình thay thế, cập nhật API keys trong file settings:** -> -> - **GLM**: Chỉnh sửa `~/.ccs/glm.settings.json` và thêm Z.AI Coding Plan API Key của bạn -> - **GLMT**: Chỉnh sửa `~/.ccs/glmt.settings.json` và thêm Z.AI Coding Plan API Key của bạn -> - **Kimi**: Chỉnh sửa `~/.ccs/kimi.settings.json` và thêm Kimi API key của bạn - -
- -**Parallel Workflow: Planning + Execution** +### Lệnh Cơ Bản ```bash -# Terminal 1 - Planning (Claude Sonnet) -ccs "Plan a REST API with authentication and rate limiting" - -# Terminal 2 - Execution (GLM, cost-optimized) -ccs glm "Implement the user authentication endpoints from the plan" +ccs # Session Claude mặc định +ccs agy # Antigravity (OAuth) +ccs gemini # Gemini (OAuth) +ccs glm # GLM (API key) ``` -
-Thinking Models (Kimi & GLMT) +### Luồng Công Việc Song Song -
+Chạy nhiều terminal với các provider khác nhau: ```bash -# Kimi - Stable thinking support -ccs kimi "Design a caching strategy with trade-off analysis" +# Terminal 1: Lập kế hoạch (Claude Pro) +ccs work "thiết kế hệ thống xác thực" -# GLMT - Experimental (see full disclaimer below) -ccs glmt "Debug complex algorithm with reasoning steps" +# Terminal 2: Thực thi (GLM - tối ưu chi phí) +ccs glm "triển khai user service theo kế hoạch" + +# Terminal 3: Review (Gemini) +ccs gemini "review implementation về các lỗ hổng bảo mật" ``` -**Lưu ý:** GLMT là thử nghiệm và không ổn định. Xem phần [GLM with Thinking (GLMT)](#glm-with-thinking-glmt) dưới đây để biết chi tiết. +### Multi-Account Claude -
- -
- -## The Daily Developer Pain Point - -
- -### **DỪNG việc chuyển đổi. BẮT ĐẦU điều phối.** - -**Giới hạn phiên không nên phá hỏng trạng thái dòng chảy của bạn.** -
- -Bạn đang sâu trong triển khai. Ngữ cảnh đã tải. Giải pháp đang kết tinh.
-Sau đó: 🔴 _"Bạn đã đạt đến giới hạn sử dụng."_ - -**Động lực mất đi. Ngữ cảnh mất. Năng suất sụp đổ.** - -## **Giải pháp: Quy trình công việc song song** - -
-❌ CÁCH CŨ: Chuyển đổi khi bạn đạt đến giới hạn (Phản ứng) - -### Quy trình làm việc hiện tại của bạn: -- **2pm:** Xây dựng tính năng, trong vùng -- **3pm:** 🔴 Đạt giới hạn sử dụng -- **3:05pm:** Dừng công việc, chỉnh sửa `~/.claude/settings.json` -- **3:15pm:** Chuyển tài khoản, mất ngữ cảnh -- **3:30pm:** Cố gắng quay lại trạng thái dòng chảy -- **4pm:** Cuối cùng cũng năng suất trở lại - -- **Kết quả:** Mất 1 giờ, động lực bị phá hủy, sự thất vọng tăng lên - -
- -
-✨ CÁCH MỚI: Chạy song song ngay từ đầu (Chủ động) - ĐƯỢC KHUYÊN NGHỊ - -### Quy trình làm việc mới của bạn: -- **2pm:** **Terminal 1:** `ccs "Lập kế hoạch kiến trúc API"` → Tư duy chiến lược (Claude Pro) -- **2pm:** **Terminal 2:** `ccs glm "Triển khai các điểm cuối API"` → Thực thi mã (GLM) -- **3pm:** Vẫn đang giao hàng, không có gián đoạn -- **4pm:** Đạt trạng thái dòng chảy, năng suất tăng vọt -- **5pm:** Tính năng đã giao hàng, ngữ cảnh được duy trì - -- **Kết quả:** Không có thời gian chết, năng suất liên tục, ít thất vọng hơn - -### 💰 **Giá trị đề xuất:** -- **Thiết lập:** Claude Pro hiện tại của bạn + GLM Lite (add-on hiệu quả về chi phí) -- **Giá trị:** Tiết kiệm 1 giờ/ngày × 20 ngày làm việc = 20 giờ/tháng được phục hồi -- **ROI:** Thời gian phát triển của bạn có giá trị hơn chi phí thiết lập -- **Thực tế:** Giao hàng nhanh hơn chi phí vận hành - -
- -## Chọn con đường của bạn - -
-Tập trung vào ngân sách: Chỉ GLM - -- **Tốt nhất cho:** Phát triển tiết kiệm chi phí, tạo mã cơ bản -- **Sử dụng:** Chỉ sử dụng `ccs glm` trực tiếp để được trợ giúp AI hiệu quả về chi phí -- **Thực tế:** Không có quyền truy cập Claude, nhưng có khả năng cho nhiều nhiệm vụ mã hóa -- **Thiết lập:** Chỉ cần API key GLM, rất phải chăng - -
- -
-✨ Được khuyên nghị cho phát triển hàng ngày: 1 Claude Pro + 1 GLM Lite - -- **Tốt nhất cho:** Giao hàng mã hàng ngày, công việc phát triển nghiêm túc -- **Sử dụng:** `ccs` để lập kế hoạch + `ccs glm` để thực thi (quy trình công việc song song) -- **Thực tế:** Cân bằng hoàn hảo giữa khả năng và chi phí cho hầu hết các nhà phát triển -- **Giá trị:** Không bao giờ đạt đến giới hạn phiên, năng suất liên tục - -
- -
-Power User: Nhiều Claude Pro + GLM Pro - -- **Tốt nhất cho:** Nhiều công việc, dự án đồng thời, solo dev -- **Mở khóa:** Không bao giờ cạn kiệt giới hạn phiên hoặc hàng tuần -- **Quy trình làm việc:** 3+ terminal chạy các nhiệm vụ chuyên biệt đồng thời - -
- -
-Tập trung vào quyền riêng tư: Cách ly Công việc/Cá nhân - -- **Khi cần:** Cách ly nghiêm ngặt ngữ cảnh AI công việc và cá nhân -- **Thiết lập:** `ccs auth create work` + `ccs auth create personal` -- **Lưu ý:** Tính năng nâng cao - hầu hết người dùng không cần điều này - -
- ---- - -## Why CCS Instead of Manual Switching? - -
- -**CCS không phải về "chuyển đổi khi bạn đạt đến giới hạn lúc 3pm."** - -## **Nó về việc chạy song song ngay từ đầu.** - -
- -### Sự khác biệt cốt lõi - -| **Chuyển đổi thủ công** | **Điều phối CCS** | -|:---|:---| -| 🔴 Đạt giới hạn → Dừng công việc → Chỉnh sửa tệp cấu hình → Khởi động lại | ✅ Nhiều terminal chạy các mô hình khác nhau ngay từ đầu | -| 😰 Mất ngữ cảnh và gián đoạn trạng thái dòng chảy | 😌 Năng suất liên tục với ngữ cảnh được bảo toàn | -| 📝 Xử lý nhiệm vụ tuần tự | ⚡ Quy trình công việc song song (lập kế hoạch + thực thi đồng thời) | -| 🛠️ Giải quyết vấn đề phản ứng khi bị chặn | 🎯 Thiết kế quy trình công việc chủ động ngăn chặn chặn | - -### CCS mang lại cho bạn - -- **Không chuyển đổi ngữ cảnh:** Duy trì trạng thái dòng chảy của bạn mà không bị gián đoạn -- **Năng suất song song:** Lập kế hoạch chiến lược trong một terminal, thực thi mã trong terminal khác -- **Quản lý tài khoản tức thì:** Một lệnh chuyển đổi, không cần chỉnh sửa tệp cấu hình -- **Cách ly công việc-cuộc sống:** Cách ly ngữ cảnh mà không cần đăng xuất -- **Tính nhất quán đa nền tảng:** Trải nghiệm mượt mà tương tự trên 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 ` - -### Shared Data (v3.1) - -Commands and skills symlinked from `~/.ccs/shared/` - **no duplication across profiles**. - -```plaintext -~/.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 -│ └── ... -``` - -| Type | Files | -|:-----|:------| -| **Shared** | `commands/`, `skills/`, `agents/` | -| **Profile-specific** | `settings.json`, `sessions/`, `todolists/`, `logs/` | - -> [!NOTE] -> **Windows**: Copies directories if symlinks unavailable (enable Developer Mode for true symlinks) - -
- -## Usage Examples - -### Basic Switching +Tạo các instance Claude riêng biệt cho công việc/cá nhân: ```bash -ccs # Claude subscription (default) -ccs glm # GLM (cost-optimized) -ccs kimi # Kimi (with thinking support) -``` - -### Multi-Account Setup - -```bash -# Create accounts ccs auth create work -ccs auth create personal + +# Chạy đồng thời trong các terminal riêng +ccs work "implement feature" # Terminal 1 +ccs "review code" # Terminal 2 (tài khoản cá nhân) ``` -**Run concurrently in separate terminals:** +
+ +## Bảo Trì + +### Kiểm Tra Sức Khỏe ```bash -# Terminal 1 - Work -ccs work "implement feature" - -# Terminal 2 - Personal (concurrent) -ccs personal "review code" +ccs doctor ``` -### Help & Version +Xác minh: Claude CLI, file cấu hình, symlinks, permissions. + +### Cập Nhật ```bash -ccs --version # Show version -ccs --help # Show all commands and options +ccs update # Cập nhật lên bản mới nhất +ccs update --force # Cài đặt lại bắt buộc +ccs update --beta # Cài đặt kênh dev ``` -
- -## GLM with Thinking (GLMT) - -> [!CAUTION] -> ### NOT PRODUCTION READY - EXPERIMENTAL FEATURE -> -> **GLMT is experimental and requires extensive debugging**: -> - Streaming and tool support still under active development -> - May experience unexpected errors, timeouts, or incomplete responses -> - Requires frequent debugging and manual intervention -> - **Not recommended for critical workflows or production use** -> -> **Alternative for GLM Thinking**: Consider going through the **CCR hustle** with the **Transformer of Bedolla** ([ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/)) for a more stable implementation. - -> [!IMPORTANT] -> GLMT requires npm installation (`npm install -g @kaitranntt/ccs`). Not available in native shell versions (requires Node.js HTTP server). - -
- -> [!NOTE] -> ### Acknowledgments: The Foundation That Made GLMT Possible -> -> **CCS's GLMT implementation owes its existence to the groundbreaking work of [@Bedolla](https://github.com/Bedolla)**, who created [ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/) - the **first integration** to bridge [Claude Code Router (CCR)](https://github.com/musistudio/claude-code-router) with Z.AI's reasoning capabilities. -> -> Before ZaiTransformer, no one had successfully integrated Z.AI's thinking mode with Claude Code's workflow. Bedolla's work wasn't just helpful - it was **foundational**. His implementation of request/response transformation architecture, thinking mode control mechanisms, and embedded proxy design directly inspired and enabled GLMT's design. -> -> **Without ZaiTransformer's pioneering work, GLMT wouldn't exist in its current form.** If you benefit from GLMT's thinking capabilities, please consider starring [ZaiTransformer](https://github.com/Bedolla/ZaiTransformer/) to support pioneering work in the Claude Code ecosystem. - -
- -
-

GLM vs GLMT Comparison

- -
- -
- -| Feature | GLM (`ccs glm`) | GLMT (`ccs glmt`) | -|:--------|:----------------|:------------------| -| **Endpoint** | Anthropic-compatible | OpenAI-compatible | -| **Thinking** | No | Experimental (`reasoning_content`) | -| **Tool Support** | Basic | **Unstable (v3.5+)** | -| **MCP Tools** | Limited | **Buggy (v3.5+)** | -| **Streaming** | Stable | **Experimental (v3.4+)** | -| **TTFB** | <500ms | <500ms (sometimes), 2-10s+ (often) | -| **Use Case** | Reliable work | **Debugging experiments only** | - -
- -
- -
- -
-

Tool Support (v3.5) - EXPERIMENTAL

- -
- -**GLMT attempts MCP tools and function calling:** - -- **Bidirectional Transformation**: Anthropic tools ↔ OpenAI format (unstable) -- **MCP Integration**: MCP tools sometimes execute (often output XML garbage) -- **Streaming Tool Calls**: Real-time tool calls (when not crashing) -- **Backward Compatible**: May break existing thinking support -- **Configuration Required**: Frequent manual debugging needed - -
- -
-

Streaming Support (v3.4) - OFTEN FAILS

- -
- -**GLMT attempts real-time streaming** with incremental reasoning content delivery: - -- **Default**: Streaming enabled (TTFB <500ms when it works) -- **Auto-fallback**: Frequently switches to buffered mode due to errors -- **Thinking parameter**: Claude CLI `thinking` parameter sometimes works - - May ignore `thinking.type` and `budget_tokens` - - Precedence: CLI parameter > message tags > default (when not broken) - -**Status**: Z.AI (tested, tool calls frequently break, requires constant debugging) - -
- -
-

How It Works (When It Works)

- -
- -1. CCS spawns embedded HTTP proxy on localhost (if not crashing) -2. Proxy attempts to convert Anthropic format → OpenAI format (often fails) -3. Tries to transform Anthropic tools → OpenAI function calling format (buggy) -4. Forwards to Z.AI with reasoning parameters and tools (when not timing out) -5. Attempts to convert `reasoning_content` → thinking blocks (partial or broken) -6. Attempts to convert OpenAI `tool_calls` → Anthropic `tool_use` blocks (XML garbage common) -7. Thinking and tool calls sometimes appear in Claude Code UI (when not broken) - -
- -
-

Control Tags & Keywords

- -
- -**Control Tags**: -- `` - Enable/disable reasoning blocks (default: On) -- `` - Control reasoning depth (deprecated - Z.AI only supports binary thinking) - -**Thinking Keywords** (inconsistent activation): -- `think` - Sometimes enables reasoning (low effort) -- `think hard` - Sometimes enables reasoning (medium effort) -- `think harder` - Sometimes enables reasoning (high effort) -- `ultrathink` - Attempts maximum reasoning depth (often breaks) - -
- -
-

Environment Variables

- -
- -**GLMT features** (all experimental): -- Forced English output enforcement (sometimes works) -- Random thinking mode activation (unpredictable) -- Attempted streaming with frequent fallback to buffered mode - -**General**: -- `CCS_DEBUG_LOG=1` - Enable debug file logging -- `CCS_CLAUDE_PATH=/path/to/claude` - Custom Claude CLI path - -
- -
-

API Key Setup

- -
+### Đồng Bộ Shared Items ```bash -# Edit GLMT settings -nano ~/.ccs/glmt.settings.json +ccs sync ``` -Set Z.AI API key (requires coding plan): +Tạo lại symlinks cho commands, skills, và settings được chia sẻ. -```json -{ - "env": { - "ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key" - } -} +
+ +## Cấu Hình + +CCS tự động tạo config khi cài đặt. Dashboard là cách được khuyến nghị để quản lý settings. + +**Vị trí config**: `~/.ccs/config.yaml` + +
+Custom Claude CLI path + +Nếu Claude CLI được cài đặt ở vị trí không chuẩn: + +```bash +export CCS_CLAUDE_PATH="/path/to/claude" # Unix +$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows ```
-

Security Limits (DoS Protection)

+Hỗ trợ symlink Windows -
+Bật Developer Mode để có symlinks thực sự: -**v3.4 Protection Limits**: +1. **Settings** → **Privacy & Security** → **For developers** +2. Bật **Developer Mode** +3. Cài đặt lại: `npm install -g @kaitranntt/ccs` -| Limit | Value | Purpose | -|:------|:------|:--------| -| **SSE buffer** | 1MB max per event | Prevent buffer overflow | -| **Content buffer** | 10MB max per block | Limit thinking/text blocks | -| **Content blocks** | 100 max per message | Prevent DoS attacks | -| **Request timeout** | 120s | Both streaming and buffered | - -
- -
-

Debugging

- -
- -**Enable verbose logging**: -```bash -ccs glmt --verbose "your prompt" -``` - -**Enable debug file logging**: -```bash -export CCS_DEBUG_LOG=1 -ccs glmt --verbose "your prompt" -# Logs: ~/.ccs/logs/ -``` - -**GLMT debugging**: -```bash -# Verbose logging shows streaming status and reasoning details -ccs glmt --verbose "test" -``` - -**Check reasoning content**: -```bash -cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content' -``` - -**Troubleshooting**: -- **If absent**: Z.AI API issue (verify key, account status) -- **If present**: Transformation issue (check `response-anthropic.json`) +Không có Developer Mode, CCS sẽ fallback sang copy thư mục.

-## Uninstall +## Tài Liệu -
-

Package Managers

+| Chủ đề | Liên kết | +|--------|----------| +| Cài đặt | [docs/en/installation.md](../en/installation.md) | +| Cấu hình | [docs/en/configuration.md](../en/configuration.md) | +| Nhà cung cấp OAuth | [docs/en/oauth.md](../en/oauth.md) | +| Multi-Account Claude | [docs/en/multi-account.md](../en/multi-account.md) | +| Delegation | [docs/en/delegation.md](../en/delegation.md) | +| GLMT (Thử nghiệm) | [docs/en/glmt.md](../en/glmt.md) | +| Kiến trúc | [docs/system-architecture.md](../system-architecture.md) | +| Xử lý sự cố | [docs/en/troubleshooting.md](../en/troubleshooting.md) |
+## Gỡ Cài Đặt + ```bash -# npm npm uninstall -g @kaitranntt/ccs +``` -# yarn +
+Trình quản lý package khác + +```bash yarn global remove @kaitranntt/ccs - -# pnpm pnpm remove -g @kaitranntt/ccs - -# bun bun remove -g @kaitranntt/ccs ```
-
-

Official Uninstaller

+
+ +## Triết Lý + +- **YAGNI**: Không có tính năng "phòng hờ" +- **KISS**: Triển khai đơn giản, tập trung +- **DRY**: Một nguồn sự thật (config)
-```bash -# macOS / Linux -curl -fsSL ccs.kaitran.ca/uninstall | bash +## Đóng Góp -# Windows PowerShell -irm ccs.kaitran.ca/uninstall | iex -``` - -
+Xem [CONTRIBUTING.md](../../CONTRIBUTING.md).
-## 🎯 Philosophy +## Giấy Phép -- **YAGNI**: No features "just in case" -- **KISS**: Simple bash, no complexity -- **DRY**: One source of truth (config) - -## 📖 Documentation - -**Complete documentation in [docs/](./docs/)**: -- [Installation Guide](./docs/en/installation.md) -- [Configuration](./docs/en/configuration.md) -- [Usage Examples](./docs/en/usage.md) -- [System Architecture](./docs/system-architecture.md) -- [GLMT Control Mechanisms](./docs/glmt-controls.md) -- [Troubleshooting](./docs/en/troubleshooting.md) -- [Contributing](./CONTRIBUTING.md) - -## 🤝 Contributing - -We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details. - -## Star History +MIT License - xem [LICENSE](../../LICENSE).
-Star History Chart +--- + +**[ccs.kaitran.ca](https://ccs.kaitran.ca)** | [Báo cáo lỗi](https://github.com/kaitranntt/ccs/issues) | [Star trên GitHub](https://github.com/kaitranntt/ccs)
- - -## License - -CCS is licensed under the [MIT License](LICENSE). - -
- -**Made with ❤️ for developers who hit rate limits too often** - -[⭐ Star this repo](https://github.com/kaitranntt/ccs) | [🐛 Report issues](https://github.com/kaitranntt/ccs/issues) | [📖 Read docs](./docs/en/) - -
\ No newline at end of file