@kaitranntt/ccs 3.4.6 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +470 -146
- package/README.md +338 -151
- package/README.vi.md +484 -157
- package/VERSION +1 -1
- package/bin/auth/auth-commands.js +98 -13
- package/bin/auth/profile-detector.js +11 -6
- package/bin/ccs.js +87 -2
- package/bin/utils/error-codes.js +59 -0
- package/bin/utils/error-manager.js +38 -32
- package/bin/utils/helpers.js +65 -1
- package/bin/utils/progress-indicator.js +111 -0
- package/bin/utils/prompt.js +134 -0
- package/bin/utils/shell-completion.js +234 -0
- package/lib/ccs +541 -25
- package/lib/ccs.ps1 +381 -20
- package/lib/error-codes.ps1 +55 -0
- package/lib/error-codes.sh +63 -0
- package/lib/progress-indicator.ps1 +120 -0
- package/lib/progress-indicator.sh +117 -0
- package/lib/prompt.ps1 +109 -0
- package/lib/prompt.sh +99 -0
- package/package.json +1 -1
- package/scripts/completion/README.md +308 -0
- package/scripts/completion/ccs.bash +81 -0
- package/scripts/completion/ccs.fish +92 -0
- package/scripts/completion/ccs.ps1 +157 -0
- package/scripts/completion/ccs.zsh +130 -0
- package/scripts/postinstall.js +24 -0
package/README.vi.md
CHANGED
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
# CCS - Claude Code Switch
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
2
|
|
|
3
|
+
# CCS - Claude Code Switch
|
|
4
|
+
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Một lệnh, không downtime, nhiều tài khoản
|
|
8
8
|
|
|
9
|
-
Chuyển đổi giữa nhiều tài khoản Claude, GLM, và Kimi ngay lập tức
|
|
9
|
+
**Chuyển đổi giữa nhiều tài khoản Claude, GLM, và Kimi ngay lập tức.**
|
|
10
10
|
Ngừng hitting rate limits. Làm việc liên tục.
|
|
11
11
|
|
|
12
|
+
<br>
|
|
12
13
|
|
|
13
14
|
[](LICENSE)
|
|
14
15
|
[]()
|
|
16
|
+
[](https://www.npmjs.com/package/@kaitranntt/ccs)
|
|
15
17
|
[](https://claudekit.cc?ref=HMNKXOHN)
|
|
16
18
|
|
|
17
|
-
**
|
|
19
|
+
**Languages**: [English](README.md) · [Tiếng Việt](README.vi.md) · [日本語](README.ja.md)
|
|
18
20
|
|
|
19
21
|
</div>
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## 🚀 Bắt Đầu Nhanh
|
|
23
|
+
<br>
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Bắt Đầu Nhanh
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
claude /login
|
|
30
|
-
```
|
|
27
|
+
### Cài Đặt
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#### Option 1: npm Package (Được khuyến nghị)
|
|
29
|
+
**npm Package (Được khuyến nghị)**
|
|
35
30
|
|
|
36
31
|
**macOS / Linux / Windows**
|
|
37
32
|
```bash
|
|
38
33
|
npm install -g @kaitranntt/ccs
|
|
39
34
|
```
|
|
40
35
|
|
|
41
|
-
Tất cả các trình quản lý package chính đều được hỗ tr
|
|
36
|
+
**Tất cả các trình quản lý package chính đều được hỗ trợ:**
|
|
42
37
|
|
|
43
38
|
```bash
|
|
44
39
|
# yarn
|
|
@@ -51,7 +46,10 @@ pnpm add -g @kaitranntt/ccs
|
|
|
51
46
|
bun add -g @kaitranntt/ccs
|
|
52
47
|
```
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
<details>
|
|
50
|
+
<summary><strong>Phương án thay thế: Cài Đặt Trực Tiếp (Truyền thống)</strong></summary>
|
|
51
|
+
|
|
52
|
+
<br>
|
|
55
53
|
|
|
56
54
|
**macOS / Linux**
|
|
57
55
|
```bash
|
|
@@ -63,7 +61,11 @@ curl -fsSL ccs.kaitran.ca/install | bash
|
|
|
63
61
|
irm ccs.kaitran.ca/install | iex
|
|
64
62
|
```
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
**Lưu ý**: Cài truyền thống bỏ qua Node.js routing để khởi động nhanh hơn, nhưng ưu tiên npm cho dễ dàng tự động hóa triển khai.
|
|
65
|
+
|
|
66
|
+
</details>
|
|
67
|
+
|
|
68
|
+
<br>
|
|
67
69
|
|
|
68
70
|
### Cấu Hình (Tự Tạo)
|
|
69
71
|
|
|
@@ -74,186 +76,503 @@ irm ccs.kaitran.ca/install | iex
|
|
|
74
76
|
{
|
|
75
77
|
"profiles": {
|
|
76
78
|
"glm": "~/.ccs/glm.settings.json",
|
|
79
|
+
"glmt": "~/.ccs/glmt.settings.json",
|
|
80
|
+
"kimi": "~/.ccs/kimi.settings.json",
|
|
77
81
|
"default": "~/.claude/settings.json"
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
```
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
<details>
|
|
87
|
+
<summary><h3>Custom Claude CLI Path</h3></summary>
|
|
88
|
+
|
|
89
|
+
<br>
|
|
83
90
|
|
|
84
91
|
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`:
|
|
85
92
|
|
|
86
93
|
```bash
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
# Unix/Linux/macOS
|
|
95
|
+
export CCS_CLAUDE_PATH="/path/to/claude"
|
|
96
|
+
|
|
97
|
+
# Windows PowerShell
|
|
98
|
+
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe"
|
|
89
99
|
```
|
|
90
100
|
|
|
91
|
-
**Xem [Hướng dẫn Khắc phục Sự cố](./docs/
|
|
101
|
+
**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.
|
|
92
102
|
|
|
93
|
-
|
|
103
|
+
</details>
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary><h3>Windows Symlink Support (Developer Mode)</h3></summary>
|
|
107
|
+
|
|
108
|
+
<br>
|
|
109
|
+
|
|
110
|
+
**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ì):
|
|
111
|
+
|
|
112
|
+
1. Mở **Settings** → **Privacy & Security** → **For developers**
|
|
113
|
+
2. Bật **Developer Mode**
|
|
114
|
+
3. Cài đặt lại CCS: `npm install -g @kaitranntt/ccs`
|
|
115
|
+
|
|
116
|
+
**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).
|
|
117
|
+
|
|
118
|
+
</details>
|
|
119
|
+
|
|
120
|
+
<br>
|
|
94
121
|
|
|
95
122
|
### Lần Chuyển Đổi Đầu Tiên
|
|
96
123
|
|
|
97
|
-
>
|
|
98
|
-
>
|
|
124
|
+
> [!IMPORTANT]
|
|
125
|
+
> **Trước khi dùng các mô hình thay thế, cập nhật API keys trong file settings:**
|
|
126
|
+
>
|
|
127
|
+
> - **GLM**: Chỉnh sửa `~/.ccs/glm.settings.json` và thêm Z.AI Coding Plan API Key của bạn
|
|
128
|
+
> - **GLMT**: Chỉnh sửa `~/.ccs/glmt.settings.json` và thêm Z.AI Coding Plan API Key của bạn
|
|
99
129
|
> - **Kimi**: Chỉnh sửa `~/.ccs/kimi.settings.json` và thêm Kimi API key của bạn
|
|
100
130
|
|
|
131
|
+
<br>
|
|
132
|
+
|
|
133
|
+
**Parallel Workflow: Planning + Execution**
|
|
134
|
+
|
|
101
135
|
```bash
|
|
102
|
-
#
|
|
103
|
-
ccs "
|
|
136
|
+
# Terminal 1 - Planning (Claude Sonnet)
|
|
137
|
+
ccs "Plan a REST API with authentication and rate limiting"
|
|
138
|
+
|
|
139
|
+
# Terminal 2 - Execution (GLM, cost-optimized)
|
|
140
|
+
ccs glm "Implement the user authentication endpoints from the plan"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
<details>
|
|
144
|
+
<summary><strong>Thinking Models (Kimi & GLMT)</strong></summary>
|
|
104
145
|
|
|
105
|
-
|
|
106
|
-
ccs glm "Tạo REST API đơn giản"
|
|
146
|
+
<br>
|
|
107
147
|
|
|
108
|
-
|
|
109
|
-
|
|
148
|
+
```bash
|
|
149
|
+
# Kimi - Stable thinking support
|
|
150
|
+
ccs kimi "Design a caching strategy with trade-off analysis"
|
|
151
|
+
|
|
152
|
+
# GLMT - Experimental (see full disclaimer below)
|
|
153
|
+
ccs glmt "Debug complex algorithm with reasoning steps"
|
|
110
154
|
```
|
|
111
155
|
|
|
112
|
-
|
|
156
|
+
**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.
|
|
157
|
+
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
<br>
|
|
161
|
+
|
|
162
|
+
## The Daily Developer Pain Point
|
|
163
|
+
|
|
164
|
+
<div align="center">
|
|
165
|
+
|
|
166
|
+
### **DỪNG việc chuyển đổi. BẮT ĐẦU điều phối.**
|
|
167
|
+
|
|
168
|
+
**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.**
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
Bạn đang sâu trong triển khai. Ngữ cảnh đã tải. Giải pháp đang kết tinh.<br>
|
|
172
|
+
Sau đó: 🔴 _"Bạn đã đạt đến giới hạn sử dụng."_
|
|
173
|
+
|
|
174
|
+
**Động lực mất đi. Ngữ cảnh mất. Năng suất sụp đổ.**
|
|
113
175
|
|
|
114
|
-
##
|
|
176
|
+
## **Giải pháp: Quy trình công việc song song**
|
|
115
177
|
|
|
116
|
-
|
|
178
|
+
<details>
|
|
179
|
+
<summary><strong>❌ CÁCH CŨ:</strong> Chuyển đổi khi bạn đạt đến giới hạn (Phản ứng)</summary>
|
|
117
180
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
181
|
+
### Quy trình làm việc hiện tại của bạn:
|
|
182
|
+
- **2pm:** Xây dựng tính năng, trong vùng
|
|
183
|
+
- **3pm:** 🔴 Đạt giới hạn sử dụng
|
|
184
|
+
- **3:05pm:** Dừng công việc, chỉnh sửa `~/.claude/settings.json`
|
|
185
|
+
- **3:15pm:** Chuyển tài khoản, mất ngữ cảnh
|
|
186
|
+
- **3:30pm:** Cố gắng quay lại trạng thái dòng chảy
|
|
187
|
+
- **4pm:** Cuối cùng cũng năng suất trở lại
|
|
122
188
|
|
|
123
|
-
|
|
189
|
+
- **Kết quả:** Mất 1 giờ, động lực bị phá hủy, sự thất vọng tăng lên
|
|
124
190
|
|
|
125
|
-
|
|
191
|
+
</details>
|
|
192
|
+
|
|
193
|
+
<details open>
|
|
194
|
+
<summary><strong>✨ CÁCH MỚI:</strong> Chạy song song ngay từ đầu (Chủ động) - <strong>ĐƯỢC KHUYÊN NGHỊ</strong></summary>
|
|
195
|
+
|
|
196
|
+
### Quy trình làm việc mới của bạn:
|
|
197
|
+
- **2pm:** **Terminal 1:** `ccs "Lập kế hoạch kiến trúc API"` → Tư duy chiến lược (Claude Pro)
|
|
198
|
+
- **2pm:** **Terminal 2:** `ccs glm "Triển khai các điểm cuối API"` → Thực thi mã (GLM)
|
|
199
|
+
- **3pm:** Vẫn đang giao hàng, không có gián đoạn
|
|
200
|
+
- **4pm:** Đạt trạng thái dòng chảy, năng suất tăng vọt
|
|
201
|
+
- **5pm:** Tính năng đã giao hàng, ngữ cảnh được duy trì
|
|
202
|
+
|
|
203
|
+
- **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
|
|
204
|
+
|
|
205
|
+
### 💰 **Giá trị đề xuất:**
|
|
206
|
+
- **Thiết lập:** Claude Pro hiện tại của bạn + GLM Lite (add-on hiệu quả về chi phí)
|
|
207
|
+
- **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
|
|
208
|
+
- **ROI:** Thời gian phát triển của bạn có giá trị hơn chi phí thiết lập
|
|
209
|
+
- **Thực tế:** Giao hàng nhanh hơn chi phí vận hành
|
|
210
|
+
|
|
211
|
+
</details>
|
|
212
|
+
|
|
213
|
+
## Chọn con đường của bạn
|
|
214
|
+
|
|
215
|
+
<details>
|
|
216
|
+
<summary><strong>Tập trung vào ngân sách:</strong> Chỉ GLM</summary>
|
|
217
|
+
|
|
218
|
+
- **Tốt nhất cho:** Phát triển tiết kiệm chi phí, tạo mã cơ bản
|
|
219
|
+
- **Sử dụng:** Chỉ sử dụng `ccs glm` trực tiếp để được trợ giúp AI hiệu quả về chi phí
|
|
220
|
+
- **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
|
|
221
|
+
- **Thiết lập:** Chỉ cần API key GLM, rất phải chăng
|
|
222
|
+
|
|
223
|
+
</details>
|
|
224
|
+
|
|
225
|
+
<details open>
|
|
226
|
+
<summary><strong>✨ Được khuyên nghị cho phát triển hàng ngày:</strong> 1 Claude Pro + 1 GLM Lite</summary>
|
|
227
|
+
|
|
228
|
+
- **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
|
|
229
|
+
- **Sử dụng:** `ccs` để lập kế hoạch + `ccs glm` để thực thi (quy trình công việc song song)
|
|
230
|
+
- **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
|
|
231
|
+
- **Giá trị:** Không bao giờ đạt đến giới hạn phiên, năng suất liên tục
|
|
232
|
+
|
|
233
|
+
</details>
|
|
234
|
+
|
|
235
|
+
<details>
|
|
236
|
+
<summary><strong>Power User:</strong> Nhiều Claude Pro + GLM Pro</summary>
|
|
237
|
+
|
|
238
|
+
- **Tốt nhất cho:** Nhiều công việc, dự án đồng thời, solo dev
|
|
239
|
+
- **Mở khóa:** Không bao giờ cạn kiệt giới hạn phiên hoặc hàng tuần
|
|
240
|
+
- **Quy trình làm việc:** 3+ terminal chạy các nhiệm vụ chuyên biệt đồng thời
|
|
241
|
+
|
|
242
|
+
</details>
|
|
243
|
+
|
|
244
|
+
<details>
|
|
245
|
+
<summary><strong>Tập trung vào quyền riêng tư:</strong> Cách ly Công việc/Cá nhân</summary>
|
|
246
|
+
|
|
247
|
+
- **Khi cần:** Cách ly nghiêm ngặt ngữ cảnh AI công việc và cá nhân
|
|
248
|
+
- **Thiết lập:** `ccs auth create work` + `ccs auth create personal`
|
|
249
|
+
- **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
|
|
250
|
+
|
|
251
|
+
</details>
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Why CCS Instead of Manual Switching?
|
|
126
256
|
|
|
127
257
|
<div align="center">
|
|
128
258
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
| **Tối Ưu Chi Phí** | 2-3 account Pro vs Max 5x chi phí |
|
|
133
|
-
| **Chuyển Đổi Tức Thì** | Một lệnh, không sửa file |
|
|
134
|
-
| **Không Downtime** | Không gián đoạn workflow |
|
|
135
|
-
| **Quản Lý Rate Limit** | Chuyển account khi hết limit |
|
|
136
|
-
| **Đa Nền Tảng** | macOS, Linux, Windows |
|
|
259
|
+
**CCS không phải về "chuyển đổi khi bạn đạt đến giới hạn lúc 3pm."**
|
|
260
|
+
|
|
261
|
+
## **Nó về việc chạy song song ngay từ đầu.**
|
|
137
262
|
|
|
138
263
|
</div>
|
|
139
264
|
|
|
140
|
-
|
|
265
|
+
### Sự khác biệt cốt lõi
|
|
266
|
+
|
|
267
|
+
| **Chuyển đổi thủ công** | **Điều phối CCS** |
|
|
268
|
+
|:---|:---|
|
|
269
|
+
| 🔴 Đạ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 |
|
|
270
|
+
| 😰 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 |
|
|
271
|
+
| 📝 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) |
|
|
272
|
+
| 🛠️ 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 |
|
|
273
|
+
|
|
274
|
+
### CCS mang lại cho bạn
|
|
275
|
+
|
|
276
|
+
- **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
|
|
277
|
+
- **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
|
|
278
|
+
- **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
|
|
279
|
+
- **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
|
|
280
|
+
- **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
|
|
281
|
+
|
|
282
|
+
<br>
|
|
283
|
+
|
|
284
|
+
## Architecture
|
|
285
|
+
|
|
286
|
+
### Profile Types
|
|
287
|
+
|
|
288
|
+
**Settings-based**: GLM, GLMT, Kimi, default
|
|
289
|
+
- Uses `--settings` flag pointing to config files
|
|
290
|
+
- GLMT: Embedded proxy for thinking mode support
|
|
291
|
+
|
|
292
|
+
**Account-based**: work, personal, team
|
|
293
|
+
- Uses `CLAUDE_CONFIG_DIR` for isolated instances
|
|
294
|
+
- Create with `ccs auth create <profile>`
|
|
295
|
+
|
|
296
|
+
### Shared Data (v3.1)
|
|
297
|
+
|
|
298
|
+
Commands and skills symlinked from `~/.ccs/shared/` - **no duplication across profiles**.
|
|
299
|
+
|
|
300
|
+
```plaintext
|
|
301
|
+
~/.ccs/
|
|
302
|
+
├── shared/ # Shared across all profiles
|
|
303
|
+
│ ├── agents/
|
|
304
|
+
│ ├── commands/
|
|
305
|
+
│ └── skills/
|
|
306
|
+
├── instances/ # Profile-specific data
|
|
307
|
+
│ └── work/
|
|
308
|
+
│ ├── agents@ → shared/agents/
|
|
309
|
+
│ ├── commands@ → shared/commands/
|
|
310
|
+
│ ├── skills@ → shared/skills/
|
|
311
|
+
│ ├── settings.json # API keys, credentials
|
|
312
|
+
│ ├── sessions/ # Conversation history
|
|
313
|
+
│ └── ...
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
| Type | Files |
|
|
317
|
+
|:-----|:------|
|
|
318
|
+
| **Shared** | `commands/`, `skills/`, `agents/` |
|
|
319
|
+
| **Profile-specific** | `settings.json`, `sessions/`, `todolists/`, `logs/` |
|
|
320
|
+
|
|
321
|
+
> [!NOTE]
|
|
322
|
+
> **Windows**: Copies directories if symlinks unavailable (enable Developer Mode for true symlinks)
|
|
323
|
+
|
|
324
|
+
<br>
|
|
325
|
+
|
|
326
|
+
## Usage Examples
|
|
327
|
+
|
|
328
|
+
### Basic Switching
|
|
329
|
+
|
|
141
330
|
```bash
|
|
142
|
-
ccs
|
|
143
|
-
ccs
|
|
144
|
-
ccs
|
|
145
|
-
ccs kimi # Chuyển sang Kimi cho lựa chọn thay thế
|
|
146
|
-
# Hết rate limit? Chuyển ngay:
|
|
147
|
-
ccs glm # Tiếp tục làm việc với GLM
|
|
148
|
-
# Cần account công ty khác?
|
|
149
|
-
ccs cong-ty-2 # Chuyển sang account công ty thứ hai
|
|
331
|
+
ccs # Claude subscription (default)
|
|
332
|
+
ccs glm # GLM (cost-optimized)
|
|
333
|
+
ccs kimi # Kimi (with thinking support)
|
|
150
334
|
```
|
|
151
335
|
|
|
152
|
-
|
|
336
|
+
### Multi-Account Setup
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# Create accounts
|
|
340
|
+
ccs auth create work
|
|
341
|
+
ccs auth create personal
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Run concurrently in separate terminals:**
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
# Terminal 1 - Work
|
|
348
|
+
ccs work "implement feature"
|
|
349
|
+
|
|
350
|
+
# Terminal 2 - Personal (concurrent)
|
|
351
|
+
ccs personal "review code"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Help & Version
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
ccs --version # Show version
|
|
358
|
+
ccs --help # Show all commands and options
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
<br>
|
|
362
|
+
|
|
363
|
+
## GLM with Thinking (GLMT)
|
|
364
|
+
|
|
365
|
+
> [!CAUTION]
|
|
366
|
+
> ### NOT PRODUCTION READY - EXPERIMENTAL FEATURE
|
|
367
|
+
>
|
|
368
|
+
> **GLMT is experimental and requires extensive debugging**:
|
|
369
|
+
> - Streaming and tool support still under active development
|
|
370
|
+
> - May experience unexpected errors, timeouts, or incomplete responses
|
|
371
|
+
> - Requires frequent debugging and manual intervention
|
|
372
|
+
> - **Not recommended for critical workflows or production use**
|
|
373
|
+
>
|
|
374
|
+
> **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.
|
|
375
|
+
|
|
376
|
+
> [!IMPORTANT]
|
|
377
|
+
> GLMT requires npm installation (`npm install -g @kaitranntt/ccs`). Not available in native shell versions (requires Node.js HTTP server).
|
|
378
|
+
|
|
379
|
+
<br>
|
|
380
|
+
|
|
381
|
+
> [!NOTE]
|
|
382
|
+
> ### Acknowledgments: The Foundation That Made GLMT Possible
|
|
383
|
+
>
|
|
384
|
+
> **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.
|
|
385
|
+
>
|
|
386
|
+
> 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.
|
|
387
|
+
>
|
|
388
|
+
> **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.
|
|
389
|
+
|
|
390
|
+
<br>
|
|
391
|
+
|
|
392
|
+
<details>
|
|
393
|
+
<summary><h3>GLM vs GLMT Comparison</h3></summary>
|
|
394
|
+
|
|
395
|
+
<br>
|
|
396
|
+
|
|
397
|
+
<div align="center">
|
|
398
|
+
|
|
399
|
+
| Feature | GLM (`ccs glm`) | GLMT (`ccs glmt`) |
|
|
400
|
+
|:--------|:----------------|:------------------|
|
|
401
|
+
| **Endpoint** | Anthropic-compatible | OpenAI-compatible |
|
|
402
|
+
| **Thinking** | No | Experimental (`reasoning_content`) |
|
|
403
|
+
| **Tool Support** | Basic | **Unstable (v3.5+)** |
|
|
404
|
+
| **MCP Tools** | Limited | **Buggy (v3.5+)** |
|
|
405
|
+
| **Streaming** | Stable | **Experimental (v3.4+)** |
|
|
406
|
+
| **TTFB** | <500ms | <500ms (sometimes), 2-10s+ (often) |
|
|
407
|
+
| **Use Case** | Reliable work | **Debugging experiments only** |
|
|
408
|
+
|
|
409
|
+
</div>
|
|
410
|
+
|
|
411
|
+
</details>
|
|
412
|
+
|
|
413
|
+
<br>
|
|
414
|
+
|
|
415
|
+
<details>
|
|
416
|
+
<summary><h3>Tool Support (v3.5) - EXPERIMENTAL</h3></summary>
|
|
417
|
+
|
|
418
|
+
<br>
|
|
419
|
+
|
|
420
|
+
**GLMT attempts MCP tools and function calling:**
|
|
421
|
+
|
|
422
|
+
- **Bidirectional Transformation**: Anthropic tools ↔ OpenAI format (unstable)
|
|
423
|
+
- **MCP Integration**: MCP tools sometimes execute (often output XML garbage)
|
|
424
|
+
- **Streaming Tool Calls**: Real-time tool calls (when not crashing)
|
|
425
|
+
- **Backward Compatible**: May break existing thinking support
|
|
426
|
+
- **Configuration Required**: Frequent manual debugging needed
|
|
427
|
+
|
|
428
|
+
</details>
|
|
429
|
+
|
|
430
|
+
<details>
|
|
431
|
+
<summary><h3>Streaming Support (v3.4) - OFTEN FAILS</h3></summary>
|
|
432
|
+
|
|
433
|
+
<br>
|
|
434
|
+
|
|
435
|
+
**GLMT attempts real-time streaming** with incremental reasoning content delivery:
|
|
436
|
+
|
|
437
|
+
- **Default**: Streaming enabled (TTFB <500ms when it works)
|
|
438
|
+
- **Auto-fallback**: Frequently switches to buffered mode due to errors
|
|
439
|
+
- **Thinking parameter**: Claude CLI `thinking` parameter sometimes works
|
|
440
|
+
- May ignore `thinking.type` and `budget_tokens`
|
|
441
|
+
- Precedence: CLI parameter > message tags > default (when not broken)
|
|
442
|
+
|
|
443
|
+
**Status**: Z.AI (tested, tool calls frequently break, requires constant debugging)
|
|
153
444
|
|
|
154
|
-
|
|
445
|
+
</details>
|
|
155
446
|
|
|
156
|
-
|
|
447
|
+
<details>
|
|
448
|
+
<summary><h3>How It Works (When It Works)</h3></summary>
|
|
157
449
|
|
|
158
|
-
|
|
159
|
-
flowchart TD
|
|
160
|
-
subgraph "Người Dùng Input"
|
|
161
|
-
USER["User chạy: ccs <profile> [args...]"]
|
|
162
|
-
end
|
|
450
|
+
<br>
|
|
163
451
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
452
|
+
1. CCS spawns embedded HTTP proxy on localhost (if not crashing)
|
|
453
|
+
2. Proxy attempts to convert Anthropic format → OpenAI format (often fails)
|
|
454
|
+
3. Tries to transform Anthropic tools → OpenAI function calling format (buggy)
|
|
455
|
+
4. Forwards to Z.AI with reasoning parameters and tools (when not timing out)
|
|
456
|
+
5. Attempts to convert `reasoning_content` → thinking blocks (partial or broken)
|
|
457
|
+
6. Attempts to convert OpenAI `tool_calls` → Anthropic `tool_use` blocks (XML garbage common)
|
|
458
|
+
7. Thinking and tool calls sometimes appear in Claude Code UI (when not broken)
|
|
167
459
|
|
|
168
|
-
|
|
169
|
-
SETTINGS["Settings-based<br/>glm, kimi, default"]
|
|
170
|
-
ACCOUNT["Account-based<br/>work, personal, team"]
|
|
171
|
-
end
|
|
172
|
-
end
|
|
460
|
+
</details>
|
|
173
461
|
|
|
174
|
-
|
|
175
|
-
|
|
462
|
+
<details>
|
|
463
|
+
<summary><h3>Control Tags & Keywords</h3></summary>
|
|
176
464
|
|
|
177
|
-
|
|
178
|
-
SETTINGS_MGR["SettingsManager<br/>→ --settings flag"]
|
|
179
|
-
INSTANCE_MGR["InstanceManager<br/>→ CLAUDE_CONFIG_DIR"]
|
|
180
|
-
end
|
|
181
|
-
end
|
|
465
|
+
<br>
|
|
182
466
|
|
|
183
|
-
|
|
184
|
-
|
|
467
|
+
**Control Tags**:
|
|
468
|
+
- `<Thinking:On|Off>` - Enable/disable reasoning blocks (default: On)
|
|
469
|
+
- `<Effort:Low|Medium|High>` - Control reasoning depth (deprecated - Z.AI only supports binary thinking)
|
|
185
470
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
471
|
+
**Thinking Keywords** (inconsistent activation):
|
|
472
|
+
- `think` - Sometimes enables reasoning (low effort)
|
|
473
|
+
- `think hard` - Sometimes enables reasoning (medium effort)
|
|
474
|
+
- `think harder` - Sometimes enables reasoning (high effort)
|
|
475
|
+
- `ultrathink` - Attempts maximum reasoning depth (often breaks)
|
|
191
476
|
|
|
192
|
-
|
|
193
|
-
API["API Response<br/>Claude Sonnet 4.5<br/>GLM 4.6<br/>Kimi K2 Thinking"]
|
|
194
|
-
end
|
|
477
|
+
</details>
|
|
195
478
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
DETECT --> PROFILE_CHECK
|
|
199
|
-
PROFILE_CHECK -->|Có| SETTINGS
|
|
200
|
-
PROFILE_CHECK -->|Có| ACCOUNT
|
|
479
|
+
<details>
|
|
480
|
+
<summary><h3>Environment Variables</h3></summary>
|
|
201
481
|
|
|
202
|
-
|
|
203
|
-
ACCOUNT --> CONFIG
|
|
482
|
+
<br>
|
|
204
483
|
|
|
205
|
-
|
|
206
|
-
|
|
484
|
+
**GLMT features** (all experimental):
|
|
485
|
+
- Forced English output enforcement (sometimes works)
|
|
486
|
+
- Random thinking mode activation (unpredictable)
|
|
487
|
+
- Attempted streaming with frequent fallback to buffered mode
|
|
207
488
|
|
|
208
|
-
|
|
209
|
-
|
|
489
|
+
**General**:
|
|
490
|
+
- `CCS_DEBUG_LOG=1` - Enable debug file logging
|
|
491
|
+
- `CCS_CLAUDE_PATH=/path/to/claude` - Custom Claude CLI path
|
|
210
492
|
|
|
211
|
-
|
|
212
|
-
INSTANCE_EXEC --> CLAUDE_DETECT
|
|
493
|
+
</details>
|
|
213
494
|
|
|
214
|
-
|
|
495
|
+
<details>
|
|
496
|
+
<summary><h3>API Key Setup</h3></summary>
|
|
497
|
+
|
|
498
|
+
<br>
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
# Edit GLMT settings
|
|
502
|
+
nano ~/.ccs/glmt.settings.json
|
|
215
503
|
```
|
|
216
504
|
|
|
217
|
-
|
|
505
|
+
Set Z.AI API key (requires coding plan):
|
|
218
506
|
|
|
219
|
-
|
|
507
|
+
```json
|
|
508
|
+
{
|
|
509
|
+
"env": {
|
|
510
|
+
"ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key"
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
```
|
|
220
514
|
|
|
221
|
-
|
|
222
|
-
- **Phiên Đồng Thời** - Chạy nhiều profile cùng lúc ở các terminal khác nhau
|
|
223
|
-
- **Instance Riêng Biệt** - Mỗi profile có config riêng (`~/.ccs/instances/<profile>/`)
|
|
224
|
-
- **Đa Nền Tảng** - macOS, Linux, Windows - hoạt động giống nhau
|
|
225
|
-
- **Không Downtime** - Chuyển đổi ngay lập tức, không gián đoạn workflow
|
|
515
|
+
</details>
|
|
226
516
|
|
|
517
|
+
<details>
|
|
518
|
+
<summary><h3>Security Limits (DoS Protection)</h3></summary>
|
|
227
519
|
|
|
228
|
-
|
|
520
|
+
<br>
|
|
229
521
|
|
|
230
|
-
|
|
522
|
+
**v3.4 Protection Limits**:
|
|
231
523
|
|
|
524
|
+
| Limit | Value | Purpose |
|
|
525
|
+
|:------|:------|:--------|
|
|
526
|
+
| **SSE buffer** | 1MB max per event | Prevent buffer overflow |
|
|
527
|
+
| **Content buffer** | 10MB max per block | Limit thinking/text blocks |
|
|
528
|
+
| **Content blocks** | 100 max per message | Prevent DoS attacks |
|
|
529
|
+
| **Request timeout** | 120s | Both streaming and buffered |
|
|
530
|
+
|
|
531
|
+
</details>
|
|
532
|
+
|
|
533
|
+
<details>
|
|
534
|
+
<summary><h3>Debugging</h3></summary>
|
|
535
|
+
|
|
536
|
+
<br>
|
|
537
|
+
|
|
538
|
+
**Enable verbose logging**:
|
|
232
539
|
```bash
|
|
233
|
-
ccs
|
|
234
|
-
ccs glm # Dùng GLM fallback
|
|
235
|
-
ccs --version # Hiển thị phiên bản CCS và vị trí cài đặt
|
|
540
|
+
ccs glmt --verbose "your prompt"
|
|
236
541
|
```
|
|
237
542
|
|
|
238
|
-
|
|
543
|
+
**Enable debug file logging**:
|
|
239
544
|
```bash
|
|
240
|
-
|
|
241
|
-
ccs
|
|
242
|
-
|
|
243
|
-
|
|
545
|
+
export CCS_DEBUG_LOG=1
|
|
546
|
+
ccs glmt --verbose "your prompt"
|
|
547
|
+
# Logs: ~/.ccs/logs/
|
|
548
|
+
```
|
|
244
549
|
|
|
245
|
-
|
|
246
|
-
|
|
550
|
+
**GLMT debugging**:
|
|
551
|
+
```bash
|
|
552
|
+
# Verbose logging shows streaming status and reasoning details
|
|
553
|
+
ccs glmt --verbose "test"
|
|
554
|
+
```
|
|
247
555
|
|
|
248
|
-
|
|
249
|
-
|
|
556
|
+
**Check reasoning content**:
|
|
557
|
+
```bash
|
|
558
|
+
cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content'
|
|
250
559
|
```
|
|
251
560
|
|
|
252
|
-
|
|
561
|
+
**Troubleshooting**:
|
|
562
|
+
- **If absent**: Z.AI API issue (verify key, account status)
|
|
563
|
+
- **If present**: Transformation issue (check `response-anthropic.json`)
|
|
564
|
+
|
|
565
|
+
</details>
|
|
253
566
|
|
|
254
|
-
|
|
567
|
+
<br>
|
|
568
|
+
|
|
569
|
+
## Uninstall
|
|
570
|
+
|
|
571
|
+
<details>
|
|
572
|
+
<summary><h3>Package Managers</h3></summary>
|
|
573
|
+
|
|
574
|
+
<br>
|
|
255
575
|
|
|
256
|
-
**Package Managers**
|
|
257
576
|
```bash
|
|
258
577
|
# npm
|
|
259
578
|
npm uninstall -g @kaitranntt/ccs
|
|
@@ -268,55 +587,63 @@ pnpm remove -g @kaitranntt/ccs
|
|
|
268
587
|
bun remove -g @kaitranntt/ccs
|
|
269
588
|
```
|
|
270
589
|
|
|
271
|
-
|
|
590
|
+
</details>
|
|
591
|
+
|
|
592
|
+
<details>
|
|
593
|
+
<summary><h3>Official Uninstaller</h3></summary>
|
|
594
|
+
|
|
595
|
+
<br>
|
|
272
596
|
|
|
273
|
-
**macOS / Linux**
|
|
274
597
|
```bash
|
|
598
|
+
# macOS / Linux
|
|
275
599
|
curl -fsSL ccs.kaitran.ca/uninstall | bash
|
|
276
|
-
```
|
|
277
600
|
|
|
278
|
-
|
|
279
|
-
```powershell
|
|
601
|
+
# Windows PowerShell
|
|
280
602
|
irm ccs.kaitran.ca/uninstall | iex
|
|
281
603
|
```
|
|
282
604
|
|
|
283
|
-
|
|
605
|
+
</details>
|
|
284
606
|
|
|
285
|
-
|
|
607
|
+
<br>
|
|
286
608
|
|
|
287
|
-
|
|
288
|
-
- **KISS**: Bash đơn giản, không phức tạp
|
|
289
|
-
- **DRY**: Một nguồn chân lý duy nhất (config)
|
|
609
|
+
## 🎯 Philosophy
|
|
290
610
|
|
|
291
|
-
|
|
611
|
+
- **YAGNI**: No features "just in case"
|
|
612
|
+
- **KISS**: Simple bash, no complexity
|
|
613
|
+
- **DRY**: One source of truth (config)
|
|
292
614
|
|
|
293
|
-
## 📖
|
|
615
|
+
## 📖 Documentation
|
|
294
616
|
|
|
295
|
-
**
|
|
296
|
-
- [
|
|
297
|
-
- [
|
|
298
|
-
- [
|
|
299
|
-
- [
|
|
300
|
-
- [
|
|
617
|
+
**Complete documentation in [docs/](./docs/)**:
|
|
618
|
+
- [Installation Guide](./docs/en/installation.md)
|
|
619
|
+
- [Configuration](./docs/en/configuration.md)
|
|
620
|
+
- [Usage Examples](./docs/en/usage.md)
|
|
621
|
+
- [System Architecture](./docs/system-architecture.md)
|
|
622
|
+
- [GLMT Control Mechanisms](./docs/glmt-controls.md)
|
|
623
|
+
- [Troubleshooting](./docs/en/troubleshooting.md)
|
|
624
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
301
625
|
|
|
302
|
-
|
|
626
|
+
## 🤝 Contributing
|
|
303
627
|
|
|
304
|
-
|
|
628
|
+
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
305
629
|
|
|
306
|
-
|
|
630
|
+
## Star History
|
|
307
631
|
|
|
308
|
-
|
|
632
|
+
<div align="center">
|
|
309
633
|
|
|
310
|
-
|
|
634
|
+
<img src="https://api.star-history.com/svg?repos=kaitranntt/ccs&type=timeline&logscale&legend=top-left" alt="Star History Chart" width="800">
|
|
311
635
|
|
|
312
|
-
|
|
636
|
+
</div>
|
|
313
637
|
|
|
314
|
-
|
|
638
|
+
|
|
639
|
+
## License
|
|
640
|
+
|
|
641
|
+
CCS is licensed under the [MIT License](LICENSE).
|
|
315
642
|
|
|
316
643
|
<div align="center">
|
|
317
644
|
|
|
318
|
-
|
|
645
|
+
**Made with ❤️ for developers who hit rate limits too often**
|
|
319
646
|
|
|
320
|
-
[⭐ Star repo
|
|
647
|
+
[⭐ Star this repo](https://github.com/kaitranntt/ccs) | [🐛 Report issues](https://github.com/kaitranntt/ccs/issues) | [📖 Read docs](./docs/en/)
|
|
321
648
|
|
|
322
|
-
</div>
|
|
649
|
+
</div>
|