@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.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
+
### One command, zero downtime, multiple accounts
|
|
8
8
|
|
|
9
|
-
Switch between multiple Claude accounts, GLM, and Kimi instantly
|
|
9
|
+
**Switch between multiple Claude accounts, GLM, and Kimi instantly.**<br>
|
|
10
10
|
Stop hitting rate limits. Keep working continuously.
|
|
11
11
|
|
|
12
12
|
|
|
@@ -19,27 +19,20 @@ Stop hitting rate limits. Keep working continuously.
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## 🚀 Quick Start
|
|
22
|
+
<br>
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**Before installing CCS, make sure you're logged into Claude CLI with your subscription account:**
|
|
29
|
-
```bash
|
|
30
|
-
claude /login
|
|
31
|
-
```
|
|
24
|
+
## Quick Start
|
|
32
25
|
|
|
33
26
|
### Installation
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
**npm Package (Recommended)**
|
|
36
29
|
|
|
37
30
|
**macOS / Linux / Windows**
|
|
38
31
|
```bash
|
|
39
32
|
npm install -g @kaitranntt/ccs
|
|
40
33
|
```
|
|
41
34
|
|
|
42
|
-
All major package managers are supported
|
|
35
|
+
**All major package managers are supported:**
|
|
43
36
|
|
|
44
37
|
```bash
|
|
45
38
|
# yarn
|
|
@@ -52,7 +45,10 @@ pnpm add -g @kaitranntt/ccs
|
|
|
52
45
|
bun add -g @kaitranntt/ccs
|
|
53
46
|
```
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+
<details>
|
|
49
|
+
<summary><strong>Alternative: Direct Install (Traditional)</strong></summary>
|
|
50
|
+
|
|
51
|
+
<br>
|
|
56
52
|
|
|
57
53
|
**macOS / Linux**
|
|
58
54
|
```bash
|
|
@@ -64,7 +60,11 @@ curl -fsSL ccs.kaitran.ca/install | bash
|
|
|
64
60
|
irm ccs.kaitran.ca/install | iex
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
**Note:** Traditional installs bypass Node.js routing for faster startup, but npm is prioritized for easier deployment automation.
|
|
64
|
+
|
|
65
|
+
</details>
|
|
66
|
+
|
|
67
|
+
<br>
|
|
68
68
|
|
|
69
69
|
### Configuration (Auto-created)
|
|
70
70
|
|
|
@@ -82,7 +82,10 @@ irm ccs.kaitran.ca/install | iex
|
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
<details>
|
|
86
|
+
<summary><h3>Custom Claude CLI Path</h3></summary>
|
|
87
|
+
|
|
88
|
+
<br>
|
|
86
89
|
|
|
87
90
|
If Claude CLI is installed in a non-standard location (D drive, custom directory), set `CCS_CLAUDE_PATH`:
|
|
88
91
|
|
|
@@ -91,9 +94,14 @@ export CCS_CLAUDE_PATH="/path/to/claude" # Unix
|
|
|
91
94
|
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
|
|
92
95
|
```
|
|
93
96
|
|
|
94
|
-
**See [Troubleshooting Guide](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location) for detailed setup instructions
|
|
97
|
+
**See also:** [Troubleshooting Guide](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location) for detailed setup instructions.
|
|
98
|
+
|
|
99
|
+
</details>
|
|
100
|
+
|
|
101
|
+
<details>
|
|
102
|
+
<summary><h3>Windows Symlink Support (Developer Mode)</h3></summary>
|
|
95
103
|
|
|
96
|
-
|
|
104
|
+
<br>
|
|
97
105
|
|
|
98
106
|
**Windows users**: Enable Developer Mode for true symlinks (better performance, instant sync):
|
|
99
107
|
|
|
@@ -101,60 +109,175 @@ $env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
|
|
|
101
109
|
2. Enable **Developer Mode**
|
|
102
110
|
3. Reinstall CCS: `npm install -g @kaitranntt/ccs`
|
|
103
111
|
|
|
104
|
-
**Without Developer Mode
|
|
112
|
+
**Warning:** Without Developer Mode, CCS automatically falls back to copying directories (works but no instant sync across profiles).
|
|
105
113
|
|
|
106
|
-
|
|
114
|
+
</details>
|
|
115
|
+
|
|
116
|
+
<br>
|
|
107
117
|
|
|
108
118
|
### Your First Switch
|
|
109
119
|
|
|
110
|
-
>
|
|
111
|
-
>
|
|
112
|
-
>
|
|
120
|
+
> [!IMPORTANT]
|
|
121
|
+
> **Before using alternative models, update API keys in settings files:**
|
|
122
|
+
>
|
|
123
|
+
> - **GLM**: Edit `~/.ccs/glm.settings.json` and add your Z.AI Coding Plan API Key
|
|
124
|
+
> - **GLMT**: Edit `~/.ccs/glmt.settings.json` and add your Z.AI Coding Plan API Key
|
|
113
125
|
> - **Kimi**: Edit `~/.ccs/kimi.settings.json` and add your Kimi API key
|
|
114
126
|
|
|
127
|
+
<br>
|
|
128
|
+
|
|
129
|
+
**Parallel Workflow: Planning + Execution**
|
|
130
|
+
|
|
115
131
|
```bash
|
|
116
|
-
#
|
|
117
|
-
ccs "Plan
|
|
132
|
+
# Terminal 1 - Planning (Claude Sonnet)
|
|
133
|
+
ccs "Plan a REST API with authentication and rate limiting"
|
|
134
|
+
|
|
135
|
+
# Terminal 2 - Execution (GLM, cost-optimized)
|
|
136
|
+
ccs glm "Implement the user authentication endpoints from the plan"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary><strong>Thinking Models (Kimi & GLMT)</strong></summary>
|
|
118
141
|
|
|
119
|
-
|
|
120
|
-
ccs glm "Create REST API"
|
|
142
|
+
<br>
|
|
121
143
|
|
|
122
|
-
|
|
123
|
-
|
|
144
|
+
```bash
|
|
145
|
+
# Kimi - Stable thinking support
|
|
146
|
+
ccs kimi "Design a caching strategy with trade-off analysis"
|
|
124
147
|
|
|
125
|
-
#
|
|
126
|
-
ccs
|
|
148
|
+
# GLMT - Experimental (see full disclaimer below)
|
|
149
|
+
ccs glmt "Debug complex algorithm with reasoning steps"
|
|
127
150
|
```
|
|
128
151
|
|
|
129
|
-
|
|
152
|
+
**Note:** GLMT is experimental and unstable. See [GLM with Thinking (GLMT)](#glm-with-thinking-glmt) section below for full details.
|
|
153
|
+
|
|
154
|
+
</details>
|
|
155
|
+
|
|
156
|
+
<br>
|
|
130
157
|
|
|
131
158
|
## The Daily Developer Pain Point
|
|
132
159
|
|
|
133
|
-
|
|
160
|
+
<div align="center">
|
|
161
|
+
|
|
162
|
+
### **STOP Switching. START Orchestrating.**
|
|
163
|
+
|
|
164
|
+
**Session limits shouldn't kill your flow state.**
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
You're deep in implementation. Context loaded. Solution crystallizing.<br>
|
|
168
|
+
Then: 🔴 _"You've reached your usage limit."_
|
|
169
|
+
|
|
170
|
+
**Momentum gone. Context lost. Productivity crater.**
|
|
171
|
+
|
|
172
|
+
## **The Solution: Parallel Workflows**
|
|
173
|
+
|
|
174
|
+
<details>
|
|
175
|
+
<summary><strong>❌ OLD WAY:</strong> Switch When You Hit Limits (Reactive)</summary>
|
|
176
|
+
|
|
177
|
+
### Your Current Workflow:
|
|
178
|
+
- **2pm:** Building features, in the zone
|
|
179
|
+
- **3pm:** 🔴 Usage limit hit
|
|
180
|
+
- **3:05pm:** Stop work, edit `~/.claude/settings.json`
|
|
181
|
+
- **3:15pm:** Switch accounts, lose context
|
|
182
|
+
- **3:30pm:** Try to get back in flow state
|
|
183
|
+
- **4pm:** Finally productive again
|
|
184
|
+
|
|
185
|
+
- **Result:** 1 hour lost, momentum destroyed, frustration builds
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
<details open>
|
|
190
|
+
<summary><strong>✨ NEW WAY:</strong> Run Parallel From Start (Proactive) - <strong>RECOMMENDED</strong></summary>
|
|
191
|
+
|
|
192
|
+
### Your New Workflow:
|
|
193
|
+
- **2pm:** **Terminal 1:** `ccs "Plan the API architecture"` → Strategic thinking (Claude Pro)
|
|
194
|
+
- **2pm:** **Terminal 2:** `ccs glm "Implement the endpoints"` → Code execution (GLM)
|
|
195
|
+
- **3pm:** Still shipping, no interruptions
|
|
196
|
+
- **4pm:** Flow state achieved, productivity spiking
|
|
197
|
+
- **5pm:** Features shipped, context maintained
|
|
198
|
+
|
|
199
|
+
- **Result:** Zero downtime, continuous productivity, less frustration
|
|
200
|
+
|
|
201
|
+
### 💰 **The Value Proposition:**
|
|
202
|
+
- **Setup:** Your existing Claude Pro + GLM Lite (cost-effective add-on)
|
|
203
|
+
- **Value:** Save 1 hour/day × 20 workdays = 20 hours/month recovered
|
|
204
|
+
- **ROI:** Your development time is worth more than the setup cost
|
|
205
|
+
- **Reality:** Shipping faster than the overhead
|
|
206
|
+
|
|
207
|
+
</details>
|
|
208
|
+
|
|
209
|
+
## Choose Your Path
|
|
210
|
+
|
|
211
|
+
<details>
|
|
212
|
+
<summary><strong>Budget-Focused:</strong> GLM Only</summary>
|
|
213
|
+
|
|
214
|
+
- **Best for:** Cost-conscious development, basic code generation
|
|
215
|
+
- **Usage:** Just use `ccs glm` directly for cost-effective AI assistance
|
|
216
|
+
- **Reality:** No Claude access, but capable for many coding tasks
|
|
217
|
+
- **Setup:** GLM API key only, very affordable
|
|
218
|
+
|
|
219
|
+
</details>
|
|
134
220
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
3. **Cost Management**: 2-3 Pro subscriptions ($20/month each) vs Claude Max at 5x cost ($100/month) → Pro tier is the practical ceiling for most developers
|
|
138
|
-
4. **Model Choice**: Different tasks benefit from different model strengths → manual switching
|
|
221
|
+
<details open>
|
|
222
|
+
<summary><strong>✨ Recommended for Daily Development:</strong> 1 Claude Pro + 1 GLM Lite</summary>
|
|
139
223
|
|
|
140
|
-
|
|
224
|
+
- **Best for:** Daily code delivery, serious development work
|
|
225
|
+
- **Usage:** `ccs` for planning + `ccs glm` for execution (parallel workflow)
|
|
226
|
+
- **Reality:** Perfect balance of capability and cost for most developers
|
|
227
|
+
- **Value:** Never hit session limits, continuous productivity
|
|
228
|
+
|
|
229
|
+
</details>
|
|
230
|
+
|
|
231
|
+
<details>
|
|
232
|
+
<summary><strong>Power User:</strong> Multiple Claude Pro + GLM Pro</summary>
|
|
233
|
+
|
|
234
|
+
- **Best for:** Heavy workloads, concurrent projects, solo dev
|
|
235
|
+
- **Unlocks:** Never drain session or weekly limits
|
|
236
|
+
- **Workflow:** 3+ terminals running specialized tasks simultaneously
|
|
237
|
+
|
|
238
|
+
</details>
|
|
239
|
+
|
|
240
|
+
<details>
|
|
241
|
+
<summary><strong>Privacy-Focused:</strong> Work/Personal Isolation</summary>
|
|
242
|
+
|
|
243
|
+
- **When needed:** Strict separation of work and personal AI contexts
|
|
244
|
+
- **Setup:** `ccs auth create work` + `ccs auth create personal`
|
|
245
|
+
- **Note:** Advanced feature - most users don't need this
|
|
246
|
+
|
|
247
|
+
</details>
|
|
248
|
+
|
|
249
|
+
---
|
|
141
250
|
|
|
142
251
|
## Why CCS Instead of Manual Switching?
|
|
143
252
|
|
|
144
253
|
<div align="center">
|
|
145
254
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| **Cost Optimization** | 2-3 Pro accounts vs Max at 5x cost |
|
|
150
|
-
| **Instant Switching** | One command, no file editing |
|
|
151
|
-
| **Zero Downtime** | Never interrupt workflow |
|
|
152
|
-
| **Rate Limit Management** | Switch accounts when limits hit |
|
|
153
|
-
| **Cross-Platform** | macOS, Linux, Windows |
|
|
255
|
+
**CCS isn't about "switching when you hit limits at 3pm."**
|
|
256
|
+
|
|
257
|
+
## **It's about running in parallel from the start.**
|
|
154
258
|
|
|
155
259
|
</div>
|
|
156
260
|
|
|
157
|
-
|
|
261
|
+
### The Core Difference
|
|
262
|
+
|
|
263
|
+
| **Manual Switching** | **CCS Orchestration** |
|
|
264
|
+
|:---|:---|
|
|
265
|
+
| 🔴 Hit limits → Stop work → Edit config files → Restart | ✅ Multiple terminals running different models from the start |
|
|
266
|
+
| 😰 Context loss and flow state interruption | 😌 Continuous productivity with preserved context |
|
|
267
|
+
| 📝 Sequential task handling | ⚡ Parallel workflows (planning + execution simultaneously) |
|
|
268
|
+
| 🛠️ Reactive problem solving when blocked | 🎯 Proactive workflow design prevents blocks |
|
|
269
|
+
|
|
270
|
+
### What CCS Gives You
|
|
271
|
+
|
|
272
|
+
- **Zero Context Switching**: Keep your flow state without interruption
|
|
273
|
+
- **Parallel Productivity**: Strategic planning in one terminal, code execution in another
|
|
274
|
+
- **Instant Account Management**: One command switches, no config file editing
|
|
275
|
+
- **Work-Life Separation**: Isolate contexts without logging out
|
|
276
|
+
- **Cross-Platform Consistency**: Same smooth experience on macOS, Linux, Windows
|
|
277
|
+
|
|
278
|
+
**Manual context switching breaks workflow. CCS orchestrates seamlessly.**
|
|
279
|
+
|
|
280
|
+
<br>
|
|
158
281
|
|
|
159
282
|
## Architecture
|
|
160
283
|
|
|
@@ -170,9 +293,9 @@ Manual context switching breaks your workflow. **CCS manages it seamlessly**.
|
|
|
170
293
|
|
|
171
294
|
### Shared Data (v3.1)
|
|
172
295
|
|
|
173
|
-
Commands and skills symlinked from `~/.ccs/shared/` - no duplication across profiles
|
|
296
|
+
Commands and skills symlinked from `~/.ccs/shared/` - **no duplication across profiles**.
|
|
174
297
|
|
|
175
|
-
```
|
|
298
|
+
```plaintext
|
|
176
299
|
~/.ccs/
|
|
177
300
|
├── shared/ # Shared across all profiles
|
|
178
301
|
│ ├── agents/
|
|
@@ -184,20 +307,61 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
184
307
|
│ ├── commands@ → shared/commands/
|
|
185
308
|
│ ├── skills@ → shared/skills/
|
|
186
309
|
│ ├── settings.json # API keys, credentials
|
|
187
|
-
│
|
|
310
|
+
│ ├── sessions/ # Conversation history
|
|
188
311
|
│ └── ...
|
|
189
312
|
```
|
|
190
313
|
|
|
191
|
-
|
|
192
|
-
|
|
314
|
+
| Type | Files |
|
|
315
|
+
|:-----|:------|
|
|
316
|
+
| **Shared** | `commands/`, `skills/`, `agents/` |
|
|
317
|
+
| **Profile-specific** | `settings.json`, `sessions/`, `todolists/`, `logs/` |
|
|
193
318
|
|
|
194
|
-
|
|
319
|
+
> [!NOTE]
|
|
320
|
+
> **Windows**: Copies directories if symlinks unavailable (enable Developer Mode for true symlinks)
|
|
195
321
|
|
|
196
|
-
|
|
322
|
+
<br>
|
|
323
|
+
|
|
324
|
+
## Usage Examples
|
|
325
|
+
|
|
326
|
+
### Basic Switching
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
ccs # Claude subscription (default)
|
|
330
|
+
ccs glm # GLM (cost-optimized)
|
|
331
|
+
ccs kimi # Kimi (with thinking support)
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Multi-Account Setup
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
# Create accounts
|
|
338
|
+
ccs auth create work
|
|
339
|
+
ccs auth create personal
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**Run concurrently in separate terminals:**
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
# Terminal 1 - Work
|
|
346
|
+
ccs work "implement feature"
|
|
347
|
+
|
|
348
|
+
# Terminal 2 - Personal (concurrent)
|
|
349
|
+
ccs personal "review code"
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Help & Version
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
ccs --version # Show version
|
|
356
|
+
ccs --help # Show all commands and options
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
<br>
|
|
197
360
|
|
|
198
361
|
## GLM with Thinking (GLMT)
|
|
199
362
|
|
|
200
|
-
>
|
|
363
|
+
> [!CAUTION]
|
|
364
|
+
> ### NOT PRODUCTION READY - EXPERIMENTAL FEATURE
|
|
201
365
|
>
|
|
202
366
|
> **GLMT is experimental and requires extensive debugging**:
|
|
203
367
|
> - Streaming and tool support still under active development
|
|
@@ -205,13 +369,15 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
205
369
|
> - Requires frequent debugging and manual intervention
|
|
206
370
|
> - **Not recommended for critical workflows or production use**
|
|
207
371
|
>
|
|
208
|
-
> **Alternative for GLM Thinking**: Consider going through the **CCR hustle** with the **Transformer of Bedolla** (ZaiTransformer) for a more stable implementation.
|
|
209
|
-
|
|
210
|
-
>
|
|
372
|
+
> **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.
|
|
373
|
+
|
|
374
|
+
> [!IMPORTANT]
|
|
375
|
+
> GLMT requires npm installation (`npm install -g @kaitranntt/ccs`). Not available in native shell versions (requires Node.js HTTP server).
|
|
211
376
|
|
|
212
|
-
|
|
377
|
+
<br>
|
|
213
378
|
|
|
214
|
-
>
|
|
379
|
+
> [!NOTE]
|
|
380
|
+
> ### Acknowledgments: The Foundation That Made GLMT Possible
|
|
215
381
|
>
|
|
216
382
|
> **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.
|
|
217
383
|
>
|
|
@@ -225,23 +391,35 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
225
391
|
>
|
|
226
392
|
> **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.
|
|
227
393
|
|
|
228
|
-
|
|
394
|
+
<br>
|
|
395
|
+
|
|
396
|
+
<details>
|
|
397
|
+
<summary><h3>GLM vs GLMT Comparison</h3></summary>
|
|
398
|
+
|
|
399
|
+
<br>
|
|
229
400
|
|
|
230
|
-
|
|
401
|
+
<div align="center">
|
|
231
402
|
|
|
232
403
|
| Feature | GLM (`ccs glm`) | GLMT (`ccs glmt`) |
|
|
233
|
-
|
|
404
|
+
|:--------|:----------------|:------------------|
|
|
234
405
|
| **Endpoint** | Anthropic-compatible | OpenAI-compatible |
|
|
235
|
-
| **Thinking** | No | Experimental (reasoning_content) |
|
|
406
|
+
| **Thinking** | No | Experimental (`reasoning_content`) |
|
|
236
407
|
| **Tool Support** | Basic | **Unstable (v3.5+)** |
|
|
237
408
|
| **MCP Tools** | Limited | **Buggy (v3.5+)** |
|
|
238
409
|
| **Streaming** | Stable | **Experimental (v3.4+)** |
|
|
239
410
|
| **TTFB** | <500ms | <500ms (sometimes), 2-10s+ (often) |
|
|
240
411
|
| **Use Case** | Reliable work | **Debugging experiments only** |
|
|
241
412
|
|
|
242
|
-
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
</details>
|
|
243
416
|
|
|
244
|
-
|
|
417
|
+
<details>
|
|
418
|
+
<summary><h3>Tool Support (v3.5) - EXPERIMENTAL</h3></summary>
|
|
419
|
+
|
|
420
|
+
<br>
|
|
421
|
+
|
|
422
|
+
**GLMT attempts MCP tools and function calling:**
|
|
245
423
|
|
|
246
424
|
- **Bidirectional Transformation**: Anthropic tools ↔ OpenAI format (unstable)
|
|
247
425
|
- **MCP Integration**: MCP tools sometimes execute (often output XML garbage)
|
|
@@ -249,9 +427,14 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
249
427
|
- **Backward Compatible**: May break existing thinking support
|
|
250
428
|
- **Configuration Required**: Frequent manual debugging needed
|
|
251
429
|
|
|
252
|
-
|
|
430
|
+
</details>
|
|
431
|
+
|
|
432
|
+
<details>
|
|
433
|
+
<summary><h3>Streaming Support (v3.4) - OFTEN FAILS</h3></summary>
|
|
253
434
|
|
|
254
|
-
|
|
435
|
+
<br>
|
|
436
|
+
|
|
437
|
+
**GLMT attempts real-time streaming** with incremental reasoning content delivery:
|
|
255
438
|
|
|
256
439
|
- **Default**: Streaming enabled (TTFB <500ms when it works)
|
|
257
440
|
- **Auto-fallback**: Frequently switches to buffered mode due to errors
|
|
@@ -259,19 +442,29 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
259
442
|
- May ignore `thinking.type` and `budget_tokens`
|
|
260
443
|
- Precedence: CLI parameter > message tags > default (when not broken)
|
|
261
444
|
|
|
262
|
-
**
|
|
445
|
+
**Status**: Z.AI (tested, tool calls frequently break, requires constant debugging)
|
|
446
|
+
|
|
447
|
+
</details>
|
|
448
|
+
|
|
449
|
+
<details>
|
|
450
|
+
<summary><h3>How It Works (When It Works)</h3></summary>
|
|
263
451
|
|
|
264
|
-
|
|
452
|
+
<br>
|
|
265
453
|
|
|
266
454
|
1. CCS spawns embedded HTTP proxy on localhost (if not crashing)
|
|
267
455
|
2. Proxy attempts to convert Anthropic format → OpenAI format (often fails)
|
|
268
456
|
3. Tries to transform Anthropic tools → OpenAI function calling format (buggy)
|
|
269
457
|
4. Forwards to Z.AI with reasoning parameters and tools (when not timing out)
|
|
270
458
|
5. Attempts to convert `reasoning_content` → thinking blocks (partial or broken)
|
|
271
|
-
6. Attempts to convert OpenAI `tool_calls` → Anthropic tool_use blocks (XML garbage common)
|
|
459
|
+
6. Attempts to convert OpenAI `tool_calls` → Anthropic `tool_use` blocks (XML garbage common)
|
|
272
460
|
7. Thinking and tool calls sometimes appear in Claude Code UI (when not broken)
|
|
273
461
|
|
|
274
|
-
|
|
462
|
+
</details>
|
|
463
|
+
|
|
464
|
+
<details>
|
|
465
|
+
<summary><h3>Control Tags & Keywords</h3></summary>
|
|
466
|
+
|
|
467
|
+
<br>
|
|
275
468
|
|
|
276
469
|
**Control Tags**:
|
|
277
470
|
- `<Thinking:On|Off>` - Enable/disable reasoning blocks (default: On)
|
|
@@ -283,7 +476,12 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
283
476
|
- `think harder` - Sometimes enables reasoning (high effort)
|
|
284
477
|
- `ultrathink` - Attempts maximum reasoning depth (often breaks)
|
|
285
478
|
|
|
286
|
-
|
|
479
|
+
</details>
|
|
480
|
+
|
|
481
|
+
<details>
|
|
482
|
+
<summary><h3>Environment Variables</h3></summary>
|
|
483
|
+
|
|
484
|
+
<br>
|
|
287
485
|
|
|
288
486
|
**GLMT features** (all experimental):
|
|
289
487
|
- Forced English output enforcement (sometimes works)
|
|
@@ -294,13 +492,21 @@ Commands and skills symlinked from `~/.ccs/shared/` - no duplication across prof
|
|
|
294
492
|
- `CCS_DEBUG_LOG=1` - Enable debug file logging
|
|
295
493
|
- `CCS_CLAUDE_PATH=/path/to/claude` - Custom Claude CLI path
|
|
296
494
|
|
|
297
|
-
|
|
495
|
+
</details>
|
|
496
|
+
|
|
497
|
+
<details>
|
|
498
|
+
<summary><h3>API Key Setup</h3></summary>
|
|
499
|
+
|
|
500
|
+
<br>
|
|
298
501
|
|
|
299
502
|
```bash
|
|
300
503
|
# Edit GLMT settings
|
|
301
504
|
nano ~/.ccs/glmt.settings.json
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Set Z.AI API key (requires coding plan):
|
|
302
508
|
|
|
303
|
-
|
|
509
|
+
```json
|
|
304
510
|
{
|
|
305
511
|
"env": {
|
|
306
512
|
"ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key"
|
|
@@ -308,15 +514,28 @@ nano ~/.ccs/glmt.settings.json
|
|
|
308
514
|
}
|
|
309
515
|
```
|
|
310
516
|
|
|
311
|
-
|
|
517
|
+
</details>
|
|
312
518
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
- Content buffer: 10MB max per block (thinking/text)
|
|
316
|
-
- Content blocks: 100 max per message
|
|
317
|
-
- Request timeout: 120s (both streaming and buffered)
|
|
519
|
+
<details>
|
|
520
|
+
<summary><h3>Security Limits (DoS Protection)</h3></summary>
|
|
318
521
|
|
|
319
|
-
|
|
522
|
+
<br>
|
|
523
|
+
|
|
524
|
+
**v3.4 Protection Limits**:
|
|
525
|
+
|
|
526
|
+
| Limit | Value | Purpose |
|
|
527
|
+
|:------|:------|:--------|
|
|
528
|
+
| **SSE buffer** | 1MB max per event | Prevent buffer overflow |
|
|
529
|
+
| **Content buffer** | 10MB max per block | Limit thinking/text blocks |
|
|
530
|
+
| **Content blocks** | 100 max per message | Prevent DoS attacks |
|
|
531
|
+
| **Request timeout** | 120s | Both streaming and buffered |
|
|
532
|
+
|
|
533
|
+
</details>
|
|
534
|
+
|
|
535
|
+
<details>
|
|
536
|
+
<summary><h3>Debugging</h3></summary>
|
|
537
|
+
|
|
538
|
+
<br>
|
|
320
539
|
|
|
321
540
|
**Enable verbose logging**:
|
|
322
541
|
```bash
|
|
@@ -341,87 +560,53 @@ ccs glmt --verbose "test"
|
|
|
341
560
|
cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content'
|
|
342
561
|
```
|
|
343
562
|
|
|
344
|
-
**
|
|
345
|
-
**If
|
|
563
|
+
**Troubleshooting**:
|
|
564
|
+
- **If absent**: Z.AI API issue (verify key, account status)
|
|
565
|
+
- **If present**: Transformation issue (check `response-anthropic.json`)
|
|
346
566
|
|
|
347
|
-
|
|
567
|
+
</details>
|
|
348
568
|
|
|
349
|
-
|
|
569
|
+
<br>
|
|
350
570
|
|
|
351
|
-
|
|
352
|
-
```bash
|
|
353
|
-
ccs # Claude subscription (default)
|
|
354
|
-
ccs glm # GLM (no thinking)
|
|
355
|
-
ccs glmt # GLM with thinking
|
|
356
|
-
ccs kimi # Kimi for Coding
|
|
357
|
-
ccs --version # Show version
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### Multi-Account Setup
|
|
361
|
-
```bash
|
|
362
|
-
# Create accounts
|
|
363
|
-
ccs auth create work
|
|
364
|
-
ccs auth create personal
|
|
365
|
-
|
|
366
|
-
# Terminal 1
|
|
367
|
-
ccs work "implement feature"
|
|
571
|
+
## Uninstall
|
|
368
572
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
```
|
|
573
|
+
<details>
|
|
574
|
+
<summary><h3>Package Managers</h3></summary>
|
|
372
575
|
|
|
373
|
-
|
|
576
|
+
<br>
|
|
374
577
|
|
|
375
|
-
Non-standard installation location:
|
|
376
578
|
```bash
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
See [Troubleshooting Guide](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location)
|
|
382
|
-
|
|
383
|
-
---
|
|
579
|
+
# npm
|
|
580
|
+
npm uninstall -g @kaitranntt/ccs
|
|
384
581
|
|
|
385
|
-
|
|
582
|
+
# yarn
|
|
583
|
+
yarn global remove @kaitranntt/ccs
|
|
386
584
|
|
|
387
|
-
|
|
585
|
+
# pnpm
|
|
586
|
+
pnpm remove -g @kaitranntt/ccs
|
|
388
587
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
{
|
|
392
|
-
"profiles": {
|
|
393
|
-
"glm": "~/.ccs/glm.settings.json",
|
|
394
|
-
"glmt": "~/.ccs/glmt.settings.json",
|
|
395
|
-
"kimi": "~/.ccs/kimi.settings.json",
|
|
396
|
-
"default": "~/.claude/settings.json"
|
|
397
|
-
}
|
|
398
|
-
}
|
|
588
|
+
# bun
|
|
589
|
+
bun remove -g @kaitranntt/ccs
|
|
399
590
|
```
|
|
400
591
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
---
|
|
592
|
+
</details>
|
|
404
593
|
|
|
405
|
-
|
|
594
|
+
<details>
|
|
595
|
+
<summary><h3>Official Uninstaller</h3></summary>
|
|
406
596
|
|
|
407
|
-
|
|
408
|
-
```bash
|
|
409
|
-
npm uninstall -g @kaitranntt/ccs
|
|
410
|
-
yarn global remove @kaitranntt/ccs
|
|
411
|
-
pnpm remove -g @kaitranntt/ccs
|
|
412
|
-
bun remove -g @kaitranntt/ccs
|
|
413
|
-
```
|
|
597
|
+
<br>
|
|
414
598
|
|
|
415
|
-
**Official Uninstaller**
|
|
416
599
|
```bash
|
|
417
600
|
# macOS / Linux
|
|
418
601
|
curl -fsSL ccs.kaitran.ca/uninstall | bash
|
|
419
602
|
|
|
420
|
-
# Windows
|
|
603
|
+
# Windows PowerShell
|
|
421
604
|
irm ccs.kaitran.ca/uninstall | iex
|
|
422
605
|
```
|
|
423
606
|
|
|
424
|
-
|
|
607
|
+
</details>
|
|
608
|
+
|
|
609
|
+
<br>
|
|
425
610
|
|
|
426
611
|
## 🎯 Philosophy
|
|
427
612
|
|
|
@@ -429,8 +614,6 @@ irm ccs.kaitran.ca/uninstall | iex
|
|
|
429
614
|
- **KISS**: Simple bash, no complexity
|
|
430
615
|
- **DRY**: One source of truth (config)
|
|
431
616
|
|
|
432
|
-
---
|
|
433
|
-
|
|
434
617
|
## 📖 Documentation
|
|
435
618
|
|
|
436
619
|
**Complete documentation in [docs/](./docs/)**:
|
|
@@ -442,19 +625,23 @@ irm ccs.kaitran.ca/uninstall | iex
|
|
|
442
625
|
- [Troubleshooting](./docs/en/troubleshooting.md)
|
|
443
626
|
- [Contributing](./CONTRIBUTING.md)
|
|
444
627
|
|
|
445
|
-
---
|
|
446
|
-
|
|
447
628
|
## 🤝 Contributing
|
|
448
629
|
|
|
449
630
|
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
450
631
|
|
|
451
|
-
---
|
|
452
632
|
|
|
453
|
-
##
|
|
633
|
+
## Star History
|
|
454
634
|
|
|
455
|
-
|
|
635
|
+
<div align="center">
|
|
456
636
|
|
|
457
|
-
|
|
637
|
+
<img src="https://api.star-history.com/svg?repos=kaitranntt/ccs&type=timeline&logscale&legend=top-left" alt="Star History Chart" width="800">
|
|
638
|
+
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
## License
|
|
643
|
+
|
|
644
|
+
CCS is licensed under the [MIT License](LICENSE).
|
|
458
645
|
|
|
459
646
|
<div align="center">
|
|
460
647
|
|