-
-[optional body]
-
-[optional footer(s)]
-```
-
-**Examples:**
-```bash
-feat(cliproxy): add OAuth token refresh
-fix(doctor): handle missing config gracefully
-feat!: remove deprecated GLMT proxy
-docs: update installation guide
-```
-
-## Workflow Examples
-
-### Stable Release
-
-```bash
-# 1. Work on feature branch
-git checkout -b feat/new-feature
-git commit -m "feat(scope): add new feature"
-
-# 2. Open PR to main
-gh pr create --base main
-
-# 3. Merge PR → CI auto-releases to npm @latest
-```
-
-### Dev Release
-
-```bash
-# 1. Switch to dev branch
-git checkout dev
-git merge feat/experimental
-
-# 2. Push → CI auto-releases to npm @dev
-git push origin dev
-```
-
-### Installing Different Channels
-
-```bash
-# Stable (default)
-npm install -g @kaitranntt/ccs
-
-# Dev
-npm install -g @kaitranntt/ccs@dev
-
-# Specific version
-npm install -g @kaitranntt/ccs@5.1.0-dev.1
-```
-
-## Version Files
-
-These files are automatically synced by semantic-release:
-
-| File | Purpose |
-|------|---------|
-| `VERSION` | Shell scripts, runtime display |
-| `package.json` | npm package version |
-| `installers/install.sh` | Standalone bash installer |
-| `installers/install.ps1` | Standalone PowerShell installer |
-| `CHANGELOG.md` | Auto-generated release notes |
-
-## Local Commit Validation
-
-Commits are validated locally via husky + commitlint:
-
-```bash
-# This will be rejected:
-git commit -m "added new feature"
-
-# This will pass:
-git commit -m "feat: add new feature"
-```
-
-## Emergency Manual Release
-
-For emergencies only (e.g., CI broken, hotfix needed):
-
-```bash
-./scripts/bump-version.sh patch
-git add -A
-git commit -m "chore(release): emergency release"
-git push origin main
-npm publish
-```
-
-## Tooling
-
-| Tool | Purpose |
-|------|---------|
-| `semantic-release` | Automated versioning and publishing |
-| `@semantic-release/changelog` | Auto-update CHANGELOG.md |
-| `@semantic-release/git` | Commit version files back |
-| `commitlint` | Validate commit message format |
-| `husky` | Git hooks for local validation |
-
-## Configuration Files
-
-- `.releaserc.json` - semantic-release configuration
-- `commitlint.config.cjs` - commit message rules
-- `.husky/commit-msg` - commit validation hook
-- `.github/workflows/release.yml` - CI release workflow
-
-## Troubleshooting
-
-### Commit rejected by commitlint
-
-```bash
-# Check what's wrong
-bunx commitlint --edit
-
-# Fix commit message format
-git commit --amend
-```
-
-### No release triggered
-
-Check if commits include releasable types (`feat:`, `fix:`, `perf:`). Documentation-only commits (`docs:`) don't trigger releases.
-
-### Dev out of sync with main
-
-```bash
-git checkout dev
-git rebase main
-git push --force-with-lease origin dev
-```
diff --git a/docs/vi/README.md b/docs/vi/README.md
deleted file mode 100644
index 7a1ad3fd..00000000
--- a/docs/vi/README.md
+++ /dev/null
@@ -1,653 +0,0 @@
-
-
-# CCS - Claude Code Switch
-
-
-
-### Trình quản lý profile AI đa năng cho Claude Code
-
-**Chuyển đổi giữa nhiều tài khoản Claude, kết nối bất kỳ API tương thích Anthropic, và sử dụng OAuth providers (Gemini, Codex, Antigravity) ngay lập tức.**
-Ngừng bị rate limits. Làm việc liên tục với vô số profiles.
-
-
-
-[](LICENSE)
-[]()
-[](https://www.npmjs.com/package/@kaitranntt/ccs)
-[](https://claudekit.cc?ref=HMNKXOHN)
-
-**Languages**: [English](../../README.md) · [Tiếng Việt](README.md) · [日本語](../ja/README.md)
-
-
-
-
-
-## Bắt Đầu Nhanh
-
-### 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ợ:**
-
-```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
-```
-
-
-[!] 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`:
-
-```bash
-# Unix/Linux/macOS
-export CCS_CLAUDE_PATH="/path/to/claude"
-
-# Windows PowerShell
-$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe"
-```
-
-**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.
-
-
-
-
-Windows Symlink Support (Developer Mode)
-
-
-
-**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ì):
-
-1. Mở **Settings** → **Privacy & Security** → **For developers**
-2. Bật **Developer Mode**
-3. Cài đặt lại CCS: `npm install -g @kaitranntt/ccs`
-
-**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).
-
-
-
-
-
-### Lần Chuyển Đổi Đầu Tiên
-
-> [!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**
-
-```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"
-```
-
-**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.
-
-
-
-
-
-## 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
-
-```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
-```
-
-**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
-```
-
-
-
-## 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
-
-
-
-```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`)
-
-
-
-
-
-## Uninstall
-
-
-Package Managers
-
-
-
-```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
-```
-
-
-
-
-Official Uninstaller
-
-
-
-```bash
-# macOS / Linux
-curl -fsSL ccs.kaitran.ca/uninstall | bash
-
-# Windows PowerShell
-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/](./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
-
-
-
-

-
-
-
-
-## 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
diff --git a/docs/vi/configuration.vi.md b/docs/vi/configuration.vi.md
deleted file mode 100644
index f272bdd9..00000000
--- a/docs/vi/configuration.vi.md
+++ /dev/null
@@ -1,164 +0,0 @@
-# Hướng Dẫn Cấu Hình CCS
-
-## Cấu Hình Tự Động
-
-Installer tự động tạo config và mẫu profile trong quá trình cài đặt:
-
-**macOS / Linux**: `~/.ccs/config.json`
-
-**Windows**: `%USERPROFILE%\.ccs\config.json`
-
-## Định Dạng Cấu Hình
-
-### Cài Đặt Cơ Bản
-
-```json
-{
- "profiles": {
- "glm": "~/.ccs/glm.settings.json",
- "default": "~/.claude/settings.json"
- }
-}
-```
-
-### Cài Đặt Nâng Cao (Nhiều Profile)
-
-```json
-{
- "profiles": {
- "glm": "~/.ccs/glm.settings.json",
- "haiku": "~/.ccs/haiku.settings.json",
- "custom": "~/.ccs/custom.settings.json",
- "default": "~/.claude/settings.json"
- }
-}
-```
-
-## Cấu Hình Profile
-
-### Ví Dụ Profile GLM
-
-**Vị trí**: `~/.ccs/glm.settings.json`
-
-```json
-{
- "env": {
- "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
- "ANTHROPIC_AUTH_TOKEN": "your_glm_api_key",
- "ANTHROPIC_MODEL": "glm-4.6",
- "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.6",
- "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.6",
- "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.6"
- }
-}
-```
-
-### Profile Claude (Mặc Định)
-
-- Sử dụng `~/.claude/settings.json` (config Claude CLI hiện tại của bạn)
-- CCS không bao giờ sửa file này (tiếp cận không xâm phạm)
-
-## Cách Hoạt Động Cấu Hình
-
-1. CCS đọc tên profile từ dòng lệnh (mặc định là "default")
-2. Tìm đường dẫn file settings trong `~/.ccs/config.json`
-3. Thực thi `claude --settings [remaining-args]`
-
-Không có magic. Không sửa file. Chuyển giao thuần túy. Hoạt động giống nhau trên tất cả nền tảng.
-
-## Biến Môi Trường
-
-### CCS_CONFIG
-
-Ghi đè vị trí config mặc định:
-```bash
-export CCS_CONFIG=~/my-custom-config.json
-ccs glm
-```
-
-### NO_COLOR
-
-Tắt output màu trên terminal:
-```bash
-export NO_COLOR=1
-ccs glm
-```
-
-**Trường Hợp Sử Dụng**:
-- CI/CD pipelines
-- Log files
-- Terminal không hỗ trợ màu
-- Tùy chọn trợ năng
-
-Khi `NO_COLOR` được đặt, CCS sử dụng output ASCII thuần không có mã màu ANSI.
-
-## Lưu Ý Tùy Theo Nền Tảng
-
-### Cấu Hình Windows
-
-Windows dùng cấu trúc file và phương pháp giống như Linux/macOS.
-
-**Định dạng config** (`~/.ccs/config.json`):
-```json
-{
- "profiles": {
- "glm": "~/.ccs/glm.settings.json",
- "default": "~/.claude/settings.json"
- }
-}
-```
-
-### Cấu Hình macOS / Linux
-
-Sử dụng đường dẫn file settings với mở rộng `~`:
-
-```json
-{
- "profiles": {
- "glm": "~/.ccs/glm.settings.json",
- "default": "~/.claude/settings.json"
- }
-}
-```
-
-Mỗi profile trỏ đến một file settings JSON của Claude. Tạo file settings theo [tài liệu Claude CLI](https://docs.claude.com/en/docs/claude-code/installation).
-
-## Vấn Đề Cấu Hình
-
-### Không tìm thấy profile
-
-```
-Error: Profile 'foo' not found in ~/.ccs/config.json
-```
-
-**Fix**: Thêm profile vào `~/.ccs/config.json`:
-```json
-{
- "profiles": {
- "foo": "~/.ccs/foo.settings.json"
- }
-}
-```
-
-### Thiếu file settings
-
-```
-Error: Settings file not found: ~/.ccs/foo.settings.json
-```
-
-**Fix**: Tạo file settings hoặc sửa đường dẫn trong config.
-
-### Thiếu profile mặc định
-
-```
-Error: Profile 'default' not found in ~/.ccs/config.json
-```
-
-**Fix**: Thêm profile "default" hoặc luôn chỉ định tên profile:
-```json
-{
- "profiles": {
- "default": "~/.claude/settings.json"
- }
-}
-```
\ No newline at end of file
diff --git a/docs/vi/installation.vi.md b/docs/vi/installation.vi.md
deleted file mode 100644
index 66b79e82..00000000
--- a/docs/vi/installation.vi.md
+++ /dev/null
@@ -1,237 +0,0 @@
-# Hướng Dẫn Cài Đặt CCS
-
-> [!WARNING]
-> **Trình cài đặt shell gốc (curl/irm) đã lỗi thời.**
-> Sử dụng cài đặt npm cho tất cả các nền tảng. Trình cài đặt cũ sẽ bị xóa trong v5.0.
-
-## Cài Đặt npm Package (Được khuyến nghị)
-
-### Cài Đặt Đa Nền Tảng
-
-**macOS / Linux / Windows**
-```bash
-npm install -g @kaitranntt/ccs
-```
-
-**Tương thích với tất cả các trình quản lý package:**
-- `npm install -g @kaitranntt/ccs`
-- `yarn global add @kaitranntt/ccs`
-- `pnpm add -g @kaitranntt/ccs`
-- `bun add -g @kaitranntt/ccs`
-
-**Lợi ích của việc cài đặt npm:**
-- ✅ Tương thích đa nền tảng
-- ✅ Cấu hình PATH tự động
-- ✅ Tự động tạo file cấu hình qua script postinstall
-- ✅ Cập nhật dễ dàng: `npm update -g @kaitranntt/ccs`
-- ✅ Gỡ cài đặt sạch: `npm uninstall -g @kaitranntt/ccs`
-- ✅ Hỗ trợ version pinning
-- ✅ Quản lý dependencies
-
-**Những Gì Xảy Ra Trong Quá Trình Cài Đặt:**
-1. npm tải xuống và cài đặt package
-2. Script postinstall tự động tạo `~/.ccs/config.json` và `~/.ccs/glm.settings.json`
-3. npm tạo lệnh `ccs` trong PATH của bạn
-
-**Lưu ý**: Nếu bạn dùng `npm install --ignore-scripts`, file cấu hình sẽ không được tạo. Chạy lại mà không có flag đó:
-```bash
-npm install -g @kaitranntt/ccs --force
-```
-
-## [!] LỖI THỜI: Cài Đặt Một Dòng Lệnh (Cũ)
-
-> [!WARNING]
-> **Các trình cài đặt này đã lỗi thời và sẽ bị xóa trong v5.0.**
-> 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
-# URL ngắn (qua CloudFlare)
-curl -fsSL ccs.kaitran.ca/install | bash
-
-# Hoặc trực tiếp từ GitHub
-curl -fsSL https://raw.githubusercontent.com/kaitranntt/ccs/main/installers/install.sh | bash
-```
-
-**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.
-
-### Windows PowerShell
-
-```powershell
-# URL ngắn (qua CloudFlare)
-irm ccs.kaitran.ca/install.ps1 | iex
-
-# Hoặc trực tiếp từ GitHub
-irm https://raw.githubusercontent.com/kaitranntt/ccs/main/installers/install.ps1 | 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ài Đặt qua Git Clone
-
-### macOS / Linux
-
-```bash
-git clone https://github.com/kaitranntt/ccs.git
-cd ccs
-./installers/install.sh
-```
-
-### Windows PowerShell
-
-```powershell
-git clone https://github.com/kaitranntt/ccs.git
-cd ccs
-.\installers\install.ps1
-```
-
-**Lưu ý**: Hoạt động với git worktrees và submodules - installer phát hiện cả thư mục `.git` và file `.git`.
-
-## Cài Đặt Thủ Công
-
-### macOS / Linux
-
-```bash
-# Tạo thư mục
-mkdir -p ~/.local/bin
-
-# Tải script
-curl -fsSL https://raw.githubusercontent.com/kaitranntt/ccs/main/ccs -o ~/.local/bin/ccs
-chmod +x ~/.local/bin/ccs
-
-# Thêm vào PATH (chọn shell của bạn)
-# Cho bash
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
-source ~/.bashrc
-
-# Cho zsh
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
-source ~/.zshrc
-
-# Cho fish
-echo 'set -gx PATH $HOME/.local/bin $PATH' >> ~/.config/fish/config.fish
-```
-
-### Windows PowerShell
-
-```powershell
-# Tạo thư mục
-New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.ccs"
-
-# Tải script
-Invoke-WebRequest -Uri "https://raw.githubusercontent.com/kaitranntt/ccs/main/ccs.ps1" -OutFile "$env:USERPROFILE\.ccs\ccs.ps1"
-
-# Thêm vào PATH (khởi động lại terminal sau)
-$Path = [Environment]::GetEnvironmentVariable("Path", "User")
-[Environment]::SetEnvironmentVariable("Path", "$Path;$env:USERPROFILE\.ccs", "User")
-```
-
-## Những Gì Được Cài Đặt
-
-**Vị Trí Tệp Thực Thi**:
-- macOS / Linux: `~/.local/bin/ccs` (symlink đến `~/.ccs/ccs`)
-- Windows: `%USERPROFILE%\.ccs\ccs.ps1`
-
-**Thư Mục Cấu Hình** (`~/.ccs/`):
-```bash
-~/.ccs/
-├── ccs # Tệp thực thi chính (symlink target)
-├── config.json # Cấu hình profile
-├── config.json.backup # Bản backup duy nhất (ghi đè mỗi lần cài)
-├── glm.settings.json # Profile GLM
-├── VERSION # File version
-├── uninstall.sh # Trình gỡ cài đặt
-└── .claude/ # Tích hợp Claude Code
- ├── commands/ccs.md # meta-command /ccs
- └── skills/ # Kỹ năng delegation
-```
-
-## Nâng Cấp CCS
-
-### macOS / Linux
-
-```bash
-# Từ git clone
-cd ccs && git pull && ./install.sh
-
-# Từ cài đặt curl
-curl -fsSL ccs.kaitran.ca/install | bash
-```
-
-### Windows PowerShell
-
-```powershell
-# Từ git clone
-cd ccs
-git pull
-.\install.ps1
-
-# Từ cài đặt irm
-irm ccs.kaitran.ca/install.ps1 | iex
-```
-
-## Cấu Hình PATH Tự Động
-
-Installer tự động cấu hình PATH của shell:
-
-**Shell Được Hỗ Trợ**:
-- bash (`.bashrc` hoặc `.bash_profile`)
-- zsh (`.zshrc`)
-- fish (`.config/fish/config.fish`)
-
-**Cách Hoạt Động**:
-1. Phát hiện shell hiện tại từ biến môi trường `$SHELL`
-2. Kiểm tra nếu `~/.local/bin` đã có trong PATH
-3. Nếu chưa, thêm export phù hợp vào shell profile
-4. Hiển thị hướng dẫn reload
-
-**Idempotent**:
-- An toàn khi chạy nhiều lần
-- Kiểm tra entry PATH của CCS trước khi thêm
-- Không tạo entry trùng lặp
-
-**Thiết Lập PATH Thủ Công** (nếu auto-config thất bại):
-
-Bash/Zsh:
-```bash
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc # hoặc ~/.zshrc
-source ~/.bashrc # hoặc source ~/.zshrc
-```
-
-Fish:
-```fish
-echo 'set -gx PATH $HOME/.local/bin $PATH' >> ~/.config/fish/config.fish
-```
-
-## Yêu Cầu
-
-### macOS / Linux
-- `bash` 3.2+
-- `jq` (trình xử lý JSON, tùy chọn cho tính năng nâng cao)
-- [Claude CLI](https://docs.claude.com/en/docs/claude-code/installation)
-
-### Windows
-- PowerShell 5.1+ (đã cài sẵn trên Windows 10+)
-- [Claude CLI](https://docs.claude.com/en/docs/claude-code/installation)
-
-### Cài đặt jq (macOS / Linux, tùy chọn)
-
-```bash
-# macOS
-brew install jq
-
-# Ubuntu/Debian
-sudo apt install jq
-
-# Fedora
-sudo dnf install jq
-
-# Arch
-sudo pacman -S jq
-```
-
-**Lưu ý**:
-- jq nâng cao quá trình tạo profile GLM nhưng không bắt buộc
-- Windows dùng JSON support có sẵn của PowerShell - không cần jq
-- Installer tạo template cơ bản mà không cần jq
\ No newline at end of file
diff --git a/docs/vi/troubleshooting.vi.md b/docs/vi/troubleshooting.vi.md
deleted file mode 100644
index f738aaa7..00000000
--- a/docs/vi/troubleshooting.vi.md
+++ /dev/null
@@ -1,468 +0,0 @@
-# Hướng Dẫn Khắc Phục Sự Cố CCS
-
-## Cảnh báo lỗi thời của trình cài đặt gốc
-
-**Vấn đề:** "Tại sao trình cài đặt curl/irm hiển thị cảnh báo lỗi thời?"
-
-**Nguyên nhân:** Trình cài đặt shell gốc đã lỗi thời, ưu tiên cài đặt npm.
-
-**Giải pháp:**
-```bash
-# Gỡ cài đặt phiên bản cũ (nếu cài qua curl/irm)
-ccs-uninstall # hoặc: curl -fsSL ccs.kaitran.ca/uninstall | bash
-
-# Cài đặt qua npm (khuyến nghị)
-npm install -g @kaitranntt/ccs
-```
-
-**Lưu ý:** Trình cài đặt cũ hiện tự động chạy npm install nếu Node.js khả dụng.
-
-## Vấn Đề Riêng Của Windows
-
-### PowerShell Execution Policy
-
-Nếu bạn thấy "cannot be loaded because running scripts is disabled":
-
-```powershell
-# Kiểm tra policy hiện tại
-Get-ExecutionPolicy
-
-# Cho phép user hiện tại chạy scripts (khuyến nghị)
-Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
-# Hoặc chạy với bypass (một lần)
-powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.ccs\ccs.ps1" glm
-```
-
-### PATH chưa được cập nhật (Windows)
-
-Nếu lệnh `ccs` không tìm thấy sau khi cài đặt:
-
-1. Khởi động lại terminal của bạn
-2. Hoặc thêm thủ công vào PATH:
- - Mở "Edit environment variables for your account"
- - Thêm `%USERPROFILE%\.ccs` vào User PATH
- - Khởi động lại terminal
-
-### Claude CLI không tìm thấy (Windows)
-
-```powershell
-# Kiểm tra Claude CLI
-where.exe claude
-
-# Nếu thiếu, cài đặt từ tài liệu Claude
-```
-
-## Claude CLI Ở Vị Trí Không Chuẩn
-
-Nếu Claude CLI được cài đặt trên ổ đĩa khác hoặc vị trí tùy chỉnh (phổ biến trên Windows với ổ D:):
-
-### Triệu Chứng
-```
-╔═════════════════════════════════════════════╗
-║ ERROR ║
-╚═════════════════════════════════════════════╝
-
-Claude CLI not found
-
-Searched:
- - CCS_CLAUDE_PATH: (not set)
- - System PATH: not found
- - Common locations: not found
-```
-
-### Giải Pháp: Đặt CCS_CLAUDE_PATH
-
-**Bước 1: Tìm Vị Trí Claude CLI**
-
-*Windows*:
-```powershell
-# Tìm kiếm tất cả ổ đĩa
-Get-ChildItem -Path C:\,D:\,E:\ -Filter claude.exe -Recurse -ErrorAction SilentlyContinue | Select-Object FullName
-
-# Các vị trí phổ biến cần kiểm tra thủ công
-D:\Program Files\Claude\claude.exe
-D:\Tools\Claude\claude.exe
-D:\Users\\AppData\Local\Claude\claude.exe
-```
-
-*Unix/Linux/macOS*:
-```bash
-# Tìm kiếm hệ thống
-sudo find / -name claude 2>/dev/null
-
-# Hoặc kiểm tra các vị trí cụ thể
-ls -la /usr/local/bin/claude
-ls -la ~/.local/bin/claude
-ls -la /opt/homebrew/bin/claude
-```
-
-**Bước 2: Đặt Biến Môi Trường**
-
-*Windows (PowerShell) - Vĩnh viễn*:
-```powershell
-# Thay bằng đường dẫn thực tế của bạn
-$ClaudePath = "D:\Program Files\Claude\claude.exe"
-
-# Đặt cho phiên hiện tại
-$env:CCS_CLAUDE_PATH = $ClaudePath
-
-# Đặt vĩnh viễn cho user
-[Environment]::SetEnvironmentVariable("CCS_CLAUDE_PATH", $ClaudePath, "User")
-
-# Khởi động lại terminal để áp dụng
-```
-
-*Unix (bash) - Vĩnh viễn*:
-```bash
-# Thay bằng đường dẫn thực tế của bạn
-CLAUDE_PATH="/opt/custom/location/claude"
-
-# Thêm vào shell profile
-echo "export CCS_CLAUDE_PATH=\"$CLAUDE_PATH\"" >> ~/.bashrc
-
-# Reload profile
-source ~/.bashrc
-```
-
-*Unix (zsh) - Vĩnh viễn*:
-```bash
-# Thay bằng đường dẫn thực tế của bạn
-CLAUDE_PATH="/opt/custom/location/claude"
-
-# Thêm vào shell profile
-echo "export CCS_CLAUDE_PATH=\"$CLAUDE_PATH\"" >> ~/.zshrc
-
-# Reload profile
-source ~/.zshrc
-```
-
-**Bước 3: Xác Minh Cấu Hình**
-
-```bash
-# Kiểm tra biến môi trường đã được đặt
-echo $CCS_CLAUDE_PATH # Unix
-$env:CCS_CLAUDE_PATH # Windows
-
-# Kiểm tra CCS có thể tìm thấy Claude
-ccs --version
-
-# Kiểm tra với profile thực tế
-ccs glm --version
-```
-
-### Các Vấn Đề Phổ Biến
-
-**Đường Dẫn Không Hợp Lệ**:
-```
-Error: File not found: D:\Program Files\Claude\claude.exe
-```
-
-**Sửa**: Kiểm tra kỹ đường dẫn, đảm bảo file tồn tại:
-```powershell
-Test-Path "D:\Program Files\Claude\claude.exe" # Windows
-ls -la "/path/to/claude" # Unix
-```
-
-**Thư Mục Thay Vì File**:
-```
-Error: Path is a directory: D:\Program Files\Claude
-```
-
-**Sửa**: Đường dẫn phải trỏ đến file `claude.exe`, không phải thư mục:
-```powershell
-# Sai
-$env:CCS_CLAUDE_PATH = "D:\Program Files\Claude"
-
-# Đúng
-$env:CCS_CLAUDE_PATH = "D:\Program Files\Claude\claude.exe"
-```
-
-**Không Thể Thực Thi**:
-```
-Error: File is not executable: /path/to/claude
-```
-
-**Sửa** (chỉ Unix):
-```bash
-chmod +x /path/to/claude
-```
-
-### Cấu Hình Riêng Cho WSL
-
-Khi sử dụng Claude trên Windows từ WSL:
-
-```bash
-# Định dạng đường dẫn mount: /mnt/d/ cho ổ D:
-export CCS_CLAUDE_PATH="/mnt/d/Program Files/Claude/claude.exe"
-
-# Thêm vào ~/.bashrc để lưu
-echo 'export CCS_CLAUDE_PATH="/mnt/d/Program Files/Claude/claude.exe"' >> ~/.bashrc
-source ~/.bashrc
-```
-
-**Lưu ý**: Khoảng trắng trong đường dẫn Windows hoạt động đúng từ WSL khi được quote đúng cách.
-
-### Debug Phát Hiện
-
-Để xem CCS đã kiểm tra gì:
-
-```bash
-# Tạm thời di chuyển claude ra khỏi PATH để kiểm tra
-# Sau đó chạy ccs - thông báo lỗi sẽ hiển thị những gì đã được kiểm tra
-
-ccs --version
-# Sẽ hiển thị:
-# - CCS_CLAUDE_PATH: (status)
-# - System PATH: not found
-# - Common locations: not found
-```
-
-### Phương Án Thay Thế: Thêm Vào PATH
-
-Nếu bạn không muốn dùng CCS_CLAUDE_PATH, thêm thư mục Claude vào PATH:
-
-*Windows (PowerShell)*:
-```powershell
-# Thêm D:\Program Files\Claude vào PATH
-$ClaudeDir = "D:\Program Files\Claude"
-$env:Path += ";$ClaudeDir"
-[Environment]::SetEnvironmentVariable("Path", $env:Path, "User")
-
-# Khởi động lại terminal
-```
-
-*Unix (bash)*:
-```bash
-# Thêm /opt/claude/bin vào PATH
-echo 'export PATH="/opt/claude/bin:$PATH"' >> ~/.bashrc
-source ~/.bashrc
-```
-
-**Lưu ý**: CCS_CLAUDE_PATH có ưu tiên cao hơn PATH, cho phép ghi đè cho từng dự án.
-
-## Vấn Đề Cài Đặt
-
-### Lỗi BASH_SOURCE unbound variable
-
-Lỗi này xảy ra khi chạy installer trong một số shells hoặc môi trường.
-
-**Đã sửa trong phiên bản mới nhất**: Installer bây giờ xử lý cả thực thi qua pipe (`curl | bash`) và thực thi trực tiếp (`./install.sh`).
-
-**Giải pháp**: Nâng cấp lên phiên bản mới nhất:
-```bash
-curl -fsSL https://raw.githubusercontent.com/kaitranntt/ccs/main/installers/install.sh | bash
-```
-
-### Git worktree không được phát hiện
-
-Nếu cài từ git worktree hoặc submodule, các phiên bản cũ có thể không phát hiện repository git.
-
-**Đã sửa trong phiên bản mới nhất**: Installer bây giờ phát hiện cả thư mục `.git` (clone chuẩn) và file `.git` (worktree/submodule).
-
-**Giải pháp**: Nâng cấp lên phiên bản mới nhất hoặc dùng phương pháp cài đặt curl.
-
-## Vấn Đề Cấu Hình
-
-### Không tìm thấy profile
-
-```
-Error: Profile 'foo' not found in ~/.ccs/config.json
-```
-
-**Fix**: Thêm profile vào `~/.ccs/config.json`:
-```json
-{
- "profiles": {
- "foo": "~/.ccs/foo.settings.json"
- }
-}
-```
-
-### Thiếu file settings
-
-```
-Error: Settings file not found: ~/.ccs/foo.settings.json
-```
-
-**Fix**: Tạo file settings hoặc sửa đường dẫn trong config.
-
-### jq chưa được cài đặt
-
-```
-Error: jq is required but not installed
-```
-
-**Fix**: Cài đặt jq (xem hướng dẫn cài đặt).
-
-**Lưu ý**: Installer tạo các mẫu cơ bản ngay cả khi không có jq, nhưng các tính năng nâng cao cần jq.
-
-## Vấn Đề Cấu Hình PATH
-
-### Cấu Hình PATH Tự Động
-
-v2.2.0+ tự động cấu hình shell PATH. Nếu bạn thấy hướng dẫn reload sau khi cài, hãy làm theo:
-
-**Cho bash**:
-```bash
-source ~/.bashrc
-```
-
-**Cho zsh**:
-```bash
-source ~/.zshrc
-```
-
-**Cho fish**:
-```fish
-source ~/.config/fish/config.fish
-```
-
-**Hoặc mở cửa sổ terminal mới** (PATH tự động load).
-
-### PATH Chưa Được Cấu Hình
-
-Nếu lệnh `ccs` không tìm thấy sau khi cài và reload:
-
-**Xác minh PATH entry tồn tại**:
-```bash
-# Cho bash/zsh
-grep "\.local/bin" ~/.bashrc ~/.zshrc
-
-# Cho fish
-grep "\.local/bin" ~/.config/fish/config.fish
-```
-
-**Sửa thủ công** (nếu auto-config thất bại):
-
-Bash:
-```bash
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
-source ~/.bashrc
-```
-
-Zsh:
-```bash
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
-source ~/.zshrc
-```
-
-Fish:
-```fish
-echo 'set -gx PATH $HOME/.local/bin $PATH' >> ~/.config/fish/config.fish
-source ~/.config/fish/config.fish
-```
-
-### Shell Profile Sai
-
-Nếu auto-config thêm vào file sai:
-
-**Tìm profile đang active**:
-```bash
-echo $SHELL # Hiển thị shell hiện tại
-```
-
-**Tình huống phổ biến**:
-- macOS bash dùng `~/.bash_profile` (không phải `~/.bashrc`)
-- Shell tùy chỉnh cần config thủ công
-- Tmux/screen có thể dùng shell khác
-
-**Giải pháp**: Thêm PATH thủ công vào file profile đúng.
-
-### Shell Không Được Phát Hiện
-
-Nếu installer không thể phát hiện shell:
-
-**Triệu chứng**:
-- Không có cảnh báo PATH hiển thị
-- Lệnh `ccs` không tìm thấy sau khi cài
-
-**Giải pháp**: Thiết lập PATH thủ công (xem ở trên).
-
-### Thiếu profile mặc định
-
-```
-Error: Profile 'default' not found in ~/.ccs/config.json
-```
-
-**Fix**: Thêm profile "default" hoặc luôn chỉ định tên profile:
-```json
-{
- "profiles": {
- "default": "~/.claude/settings.json"
- }
-}
-```
-
-## Vấn Đề Phổ Biến
-
-### Claude CLI không tìm thấy
-
-```
-Error: claude command not found
-```
-
-**Giải pháp**: Cài đặt Claude CLI từ [tài liệu chính thức](https://docs.claude.com/en/docs/claude-code/installation).
-
-### Permission denied (Unix)
-
-```
-Error: Permission denied: ~/.local/bin/ccs
-```
-
-**Giải pháp**: Cho phép script thực thi:
-```bash
-chmod +x ~/.local/bin/ccs
-```
-
-### Không tìm thấy file config
-
-```
-Error: Config file not found: ~/.ccs/config.json
-```
-
-**Giải pháp**: Chạy lại installer hoặc tạo config thủ công:
-```bash
-mkdir -p ~/.ccs
-echo '{"profiles":{"default":"~/.claude/settings.json"}}' > ~/.ccs/config.json
-```
-
-## Nhận Trợ Giúp
-
-Nếu bạn gặp các vấn đề không được đề cập ở đây:
-
-1. Kiểm tra [GitHub Issues](https://github.com/kaitranntt/ccs/issues)
-2. Tạo issue mới với:
- - Hệ điều hành của bạn
- - Phiên bản CCS (`ccs --version`)
- - Thông báo lỗi chính xác
- - Các bước để tái tạo vấn đề
-
-## Chế Độ Debug
-
-Bật verbose output để khắc phục sự cố:
-
-```bash
-ccs --verbose glm
-```
-
-Điều này sẽ hiển thị:
-- File config nào đang được đọc
-- Profile nào đang được chọn
-- File settings nào đang được sử dụng
-- Lệnh chính xác đang được thực thi
-
-## Tắt Output Có Màu
-
-Nếu output có màu gây vấn đề trong terminal hoặc logs của bạn:
-
-```bash
-export NO_COLOR=1
-ccs glm
-```
-
-**Trường Hợp Sử Dụng**:
-- Môi trường CI/CD
-- Tạo log file
-- Terminal không hỗ trợ màu
-- Tùy chọn trợ năng
\ No newline at end of file
diff --git a/docs/vi/usage.vi.md b/docs/vi/usage.vi.md
deleted file mode 100644
index 7f6f2495..00000000
--- a/docs/vi/usage.vi.md
+++ /dev/null
@@ -1,231 +0,0 @@
-# Hướng Dẫn Sử Dụng CCS
-
-## Tại Sao Dùng CCS?
-
-**Được xây dựng cho lập trình viên có cả Claude subscription và GLM Coding Plan.**
-
-### Hai Tình Huống Thực Tế
-
-#### 1. Chọn Model Phù Hợp Với Tác Vụ
-
-**Claude Sonnet 4.5** xuất sắc trong:
-- Quyết định kiến trúc phức tạp
-- Thiết kế hệ thống và lập kế hoạch
-- Gỡ lỗi các vấn đề khó
-- Review code cần suy luận sâu
-
-**GLM 4.6** hoạt động tốt cho:
-- Sửa lỗi đơn giản
-- Triển khai thẳng thắn
-- Refactoring hàng ngày
-- Viết tài liệu
-
-**Với CCS**: Chuyển model dựa trên độ phức tạp của tác vụ, tối đa hóa chất lượng trong khi quản lý chi phí.
-
-```bash
-ccs # Lên kế hoạch kiến trúc tính năng mới
-# Đã có kế hoạch? Triển khai với GLM:
-ccs glm # Viết code đơn giản
-```
-
-#### 2. Quản Lý Rate Limit
-
-Nếu bạn có cả Claude subscription và GLM Coding Plan, bạn biết sự khó khăn:
-- Claude hết rate limit giữa chừng dự án
-- Bạn phải copy thủ công config GLM vào `~/.claude/settings.json`
-- 5 phút sau, cần chuyển lại
-- Lặp lại 10 lần mỗi ngày
-
-**CCS giải quyết điều này**:
-- Một lệnh để chuyển: `ccs` (mặc định) hoặc `ccs glm` (fallback)
-- Lưu cả hai config dạng profiles
-- Chuyển trong <1 giây
-- Không phải sửa file, không copy-paste, không sai sót
-
-### Tính Năng
-
-- Chuyển profile tức thì (Claude ↔ GLM)
-- Chuyển tất cả args của Claude CLI
-- Cài đặt thông minh: phát hiện provider hiện tại của bạn
-- Tự động tạo configs khi cài đặt
-- Không proxy, không magic—chỉ bash + jq
-
-## Sử Dụng Cơ Bản
-
-### Chuyển Profiles
-
-```bash
-# Hoạt động trên macOS, Linux, và Windows
-ccs # Dùng Claude subscription (mặc định)
-ccs glm # Dùng GLM fallback
-```
-
-**Lưu ý Windows**: Lệnh hoạt động giống nhau trong PowerShell, CMD, và Git Bash.
-
-### Với Arguments
-
-Tất cả args sau tên profile được chuyển trực tiếp cho Claude CLI:
-
-```bash
-ccs glm --verbose
-ccs /plan "add feature"
-ccs glm /code "implement feature"
-```
-
-### Lệnh Tiện Ích
-
-```bash
-ccs --version # Hiển thị thông tin phiên bản nâng cao với chi tiết cài đặt
-ccs --help # Hiển thị tài liệu trợ giúp riêng của CCS
-```
-
-**Ví Dụ Output `--version`**:
-```
-CCS (Claude Code Switch) v2.4.4
-
-Installation:
- Location: /home/user/.local/bin/ccs -> /home/user/.ccs/ccs
- Config: ~/.ccs/config.json
-
-Documentation: https://github.com/kaitranntt/ccs
-License: MIT
-
-Run 'ccs --help' for usage information
-```
-
-**Tính Năng Nâng Cứa `--help`**:
-- Tài liệu riêng của CCS (không còn delegate cho Claude CLI)
-- Ví dụ sử dụng và mô tả flag đầy đủ
-- Hướng dẫn cài đặt và gỡ bỏ
-- Hướng dẫn cụ thể theo nền tảng
-- Vị trí file cấu hình và khắc phục sự cố
-
-**Gỡ Cài Đặt Chính Thức (Khuyến Nghị)**:
-```bash
-# macOS/Linux
-curl -fsSL ccs.kaitran.ca/uninstall | bash
-
-# Windows PowerShell
-irm ccs.kaitran.ca/uninstall | iex
-```
-
-Uninstaller chính thức gỡ bỏ hoàn toàn CCS bao gồm cả cấu hình và PATH modifications.
-
-### Cài Đặt Commands và Skills
-
-### 🚧 Tính Năng Đang Phát Triển
-
-#### Tích hợp .claude/
-
-Delegation tác vụ qua flags `--install` / `--uninstall` đang được phát triển.
-
-**Trạng Thái**: Testing chưa hoàn tất, không có sẵn trong release hiện tại
-
-**Implementation**: Chức năng cốt lõi đã có nhưng bị vô hiệu hóa pending testing
-
-**Timeline**: Chưa có ETA - theo dõi GitHub issues để cập nhật
-
-**Hiện Tại**: Sử dụng chuyển profile trực tiếp (`ccs glm`) để lựa chọn model
-
-**Ví Dụ Output**:
-```
-┌─ Installing CCS Commands & Skills
-│ Source: /path/to/ccs/.claude
-│ Target: /home/user/.claude
-│
-│ Installing commands...
-│ │ [OK] Installed command: ccs.md
-│
-│ Installing skills...
-│ │ [OK] Installed skill: ccs-delegation
-└─
-
-[OK] Installation complete!
- Installed: 2 items
- Skipped: 0 items (already exist)
-
-You can now use the /ccs command in Claude CLI for task delegation.
-Example: /ccs glm /plan 'add user authentication'
-```
-
-**Lưu ý**:
-- Output dùng ký hiệu ASCII ([OK], [i], [X]) thay vì emoji
-- Output có màu trên terminal TTY (tắt với `NO_COLOR=1`)
-- File đã tồn tại tự động bỏ qua (an toàn khi chạy lại)
-
-## Delegation Tác Vụ
-
-**CCS bao gồm delegation tác vụ thông minh** qua meta-command `/ccs`:
-
-```bash
-# Delegation lập kế hoạch cho GLM (tiết kiệm tokens Sonnet)
-/ccs glm /plan "add user authentication"
-
-# Delegation coding cho GLM
-/ccs glm /code "implement auth endpoints"
-
-# Câu hỏi nhanh với Haiku
-/ccs haiku /ask "explain this error"
-```
-
-**Lợi ích**:
-- ✅ Tiết kiệm tokens bằng cách delegation tác vụ đơn giản cho model rẻ hơn
-- ✅ Dùng đúng model cho từng tác vụ tự động
-- ✅ Lệnh có thể tái sử dụng trên tất cả dự án (user-scope)
-- ✅ Tích hợp liền mạch với workflows hiện có
-
-## Workflow Thực Tế
-
-### Chọn Model Dựa Trên Tác Vụ
-
-**Tình huống**: Xây dựng tính năng tích hợp thanh toán mới
-
-```bash
-# Bước 1: Kiến trúc & Lập kế hoạch (cần trí tuệ của Claude)
-ccs
-/plan "Design payment integration with Stripe, handle webhooks, errors, retries"
-# → Claude Sonnet 4.5 suy nghĩ sâu về edge cases, bảo mật, kiến trúc
-
-# Bước 2: Triển khai (coding đơn giản, dùng GLM)
-ccs glm
-/code "implement the payment webhook handler from the plan"
-# → GLM 4.6 viết code hiệu quả, tiết kiệm usage của Claude
-
-# Bước 3: Code Review (cần phân tích sâu)
-ccs
-/review "check the payment handler for security issues"
-# → Claude Sonnet 4.5 phát hiện các lỗ hổng tinh vi
-
-# Bước 4: Sửa Lỗi (đơn giản)
-ccs glm
-/fix "update error message formatting"
-# → GLM 4.6 xử lý các sửa lỗi hàng ngày
-```
-
-**Kết quả**: Model tốt nhất cho từng tác vụ, chi phí thấp hơn, chất lượng tốt hơn.
-
-### Quản Lý Rate Limit
-
-```bash
-# Làm việc với refactoring phức tạp bằng Claude
-ccs
-/plan "refactor authentication system"
-
-# Claude hết rate limit giữa chừng tác vụ
-# → Error: Rate limit exceeded
-
-# Chuyển sang GLM ngay lập tức
-ccs glm
-# Tiếp tục làm việc không gián đoạn
-
-# Rate limit reset? Chuyển lại
-ccs
-```
-
-## Cách Hoạt Động
-
-1. Đọc tên profile (mặc định là "default" nếu bỏ qua)
-2. Tìm đường dẫn file settings trong `~/.ccs/config.json`
-3. Thực thi `claude --settings [remaining-args]`
-
-Không có magic. Không sửa file. Chuyển giao thuần túy. Hoạt động giống nhau trên tất cả nền tảng.
\ No newline at end of file
diff --git a/package.json b/package.json
index 51a66bb8..c7c23092 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@kaitranntt/ccs",
- "version": "5.17.0",
+ "version": "5.17.0-dev.7",
"description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
"keywords": [
"cli",
diff --git a/src/commands/version-command.ts b/src/commands/version-command.ts
index 5c4ab2a0..f9cde90a 100644
--- a/src/commands/version-command.ts
+++ b/src/commands/version-command.ts
@@ -77,9 +77,7 @@ export async function handleVersionCommand(): Promise {
console.log('');
}
- console.log(
- `${subheader('Documentation:')} ${color('https://github.com/kaitranntt/ccs', 'path')}`
- );
+ console.log(`${subheader('Documentation:')} ${color('https://docs.ccs.kaitran.ca', 'path')}`);
console.log(`${subheader('License:')} MIT`);
console.log('');
console.log(color("Run 'ccs --help' for usage information", 'command'));
diff --git a/src/web-server/usage-routes.ts b/src/web-server/usage-routes.ts
index c6835a90..2f255b62 100644
--- a/src/web-server/usage-routes.ts
+++ b/src/web-server/usage-routes.ts
@@ -640,10 +640,11 @@ function validateOffset(offset?: string): number {
* Filter data by date range
*/
function filterByDateRange(
- data: T[],
+ data: T[] | undefined,
since?: string,
until?: string
): T[] {
+ if (!data || !Array.isArray(data)) return [];
if (!since && !until) return data;
return data.filter((item) => {
@@ -824,6 +825,7 @@ usageRoutes.get(
*
* Returns hourly usage trends for chart visualization.
* Query: ?since=YYYYMMDD&until=YYYYMMDD (defaults to last 24 hours)
+ * Fills in gaps with zero values for hours without activity.
*/
usageRoutes.get(
'/hourly',
@@ -834,8 +836,8 @@ usageRoutes.get(
const hourlyData = await getCachedHourlyData();
- // Filter by date range
- const filtered = hourlyData.filter((h) => {
+ // Filter by date range (guard against undefined)
+ const filtered = (hourlyData || []).filter((h) => {
// Extract date from hour format "YYYY-MM-DD HH:00"
const hourDate = h.hour.slice(0, 10).replace(/-/g, '');
if (since && hourDate < since) return false;
@@ -855,12 +857,12 @@ usageRoutes.get(
requests: hour.modelBreakdowns.length,
}));
- // Sort by hour ascending for chart display
- trends.sort((a, b) => a.hour.localeCompare(b.hour));
+ // Fill gaps with zero values for hours without activity
+ const filledTrends = fillHourlyGaps(trends, since, until);
res.json({
success: true,
- data: trends,
+ data: filledTrends,
});
} catch (error) {
errorResponse(res, error, 'Failed to fetch hourly usage');
@@ -868,6 +870,103 @@ usageRoutes.get(
}
);
+/**
+ * Fill gaps in hourly data with zero values
+ * Ensures continuous timeline for chart display
+ */
+function fillHourlyGaps(
+ data: Array<{
+ hour: string;
+ tokens: number;
+ inputTokens: number;
+ outputTokens: number;
+ cacheTokens: number;
+ cost: number;
+ modelsUsed: number;
+ requests: number;
+ }>,
+ since?: string,
+ until?: string
+): typeof data {
+ // If no date range specified, return as-is
+ if (!since && !until) {
+ return data.sort((a, b) => a.hour.localeCompare(b.hour));
+ }
+
+ // Create a map of existing hours for O(1) lookup
+ const hourMap = new Map(data.map((d) => [d.hour, d]));
+
+ // Determine the hour range (use UTC to match stored hour keys)
+ const now = new Date();
+ const startDate = since
+ ? new Date(
+ Date.UTC(
+ parseInt(since.slice(0, 4)),
+ parseInt(since.slice(4, 6)) - 1,
+ parseInt(since.slice(6, 8)),
+ 0,
+ 0,
+ 0
+ )
+ )
+ : new Date(now.getTime() - 24 * 60 * 60 * 1000); // Default: 24 hours ago
+
+ const endDate = until
+ ? new Date(
+ Date.UTC(
+ parseInt(until.slice(0, 4)),
+ parseInt(until.slice(4, 6)) - 1,
+ parseInt(until.slice(6, 8)),
+ 23,
+ 59,
+ 59
+ )
+ )
+ : now;
+
+ // Cap endDate at current time to avoid filling future hours with zeros
+ const cappedEndDate = endDate > now ? now : endDate;
+
+ const result: typeof data = [];
+
+ // Iterate through each hour in the range
+ const current = new Date(startDate);
+ current.setMinutes(0, 0, 0);
+
+ while (current <= cappedEndDate) {
+ // Format hour key as "YYYY-MM-DD HH:00" in UTC to match storage format
+ const year = current.getUTCFullYear();
+ const month = String(current.getUTCMonth() + 1).padStart(2, '0');
+ const day = String(current.getUTCDate()).padStart(2, '0');
+ const hour = String(current.getUTCHours()).padStart(2, '0');
+ const hourKey = `${year}-${month}-${day} ${hour}:00`;
+
+ if (hourMap.has(hourKey)) {
+ const entry = hourMap.get(hourKey);
+ if (entry) {
+ result.push(entry);
+ }
+ } else {
+ // Insert zero entry for this hour
+ result.push({
+ hour: hourKey,
+ tokens: 0,
+ inputTokens: 0,
+ outputTokens: 0,
+ cacheTokens: 0,
+ cost: 0,
+ modelsUsed: 0,
+ requests: 0,
+ });
+ }
+
+ // Move to next hour
+ current.setTime(current.getTime() + 60 * 60 * 1000);
+ }
+
+ return result;
+}
+
/**
* GET /api/usage/models
*