@kaitranntt/ccs 2.4.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 CCS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,287 @@
1
+ # CCS - Claude Code Switch
2
+
3
+ <div align="center">
4
+
5
+ ![CCS Logo](docs/assets/ccs-logo-medium.png)
6
+
7
+ **One command, zero downtime, right model for each task**
8
+
9
+ Switch between Claude Sonnet 4.5 and GLM 4.6 instantly. Stop hitting rate limits. Start optimizing costs.
10
+
11
+
12
+ [![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](LICENSE)
13
+ [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=for-the-badge)]()
14
+ [![npm](https://img.shields.io/npm/v/@kai/ccs?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@kai/ccs)
15
+ [![PoweredBy](https://img.shields.io/badge/PoweredBy-ClaudeKit-C15F3C?style=for-the-badge)](https://claudekit.cc?ref=HMNKXOHN)
16
+
17
+ **Languages**: [English](README.md) | [Tiếng Việt](README.vi.md)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## 🚀 Quick Start
24
+
25
+ ### 🔑 Prerequisites
26
+
27
+ **Before installing CCS, make sure you're logged into Claude CLI with your subscription account:**
28
+ ```bash
29
+ claude /login
30
+ ```
31
+
32
+ ### Primary Installation Methods
33
+
34
+ #### Option 1: npm Package (Recommended)
35
+
36
+ **macOS / Linux / Windows**
37
+ ```bash
38
+ npm install -g @kai/ccs
39
+ ```
40
+
41
+ Compatible with npm, yarn, pnpm, and bun package managers.
42
+
43
+ #### Option 2: Direct Install (Traditional)
44
+
45
+ **macOS / Linux**
46
+ ```bash
47
+ curl -fsSL ccs.kaitran.ca/install | bash
48
+ ```
49
+
50
+ **Windows PowerShell**
51
+ ```powershell
52
+ irm ccs.kaitran.ca/install | iex
53
+ ```
54
+
55
+ ### Your First Switch
56
+
57
+ ```bash
58
+ # Use Claude subscription (default)
59
+ ccs "Review this architecture design"
60
+
61
+ # Switch to GLM for cost-optimized tasks
62
+ ccs glm "Create a simple REST API"
63
+
64
+ # Use GLM for all subsequent commands until switched back
65
+ ccs glm
66
+ ccs "Debug this issue"
67
+ ccs "Write unit tests"
68
+ ```
69
+
70
+ #### Package Manager Options
71
+
72
+ All major package managers are supported:
73
+
74
+ ```bash
75
+ # npm (default)
76
+ npm install -g @kai/ccs
77
+
78
+ # yarn
79
+ yarn global add @kai/ccs
80
+
81
+ # pnpm (70% less disk space)
82
+ pnpm add -g @kai/ccs
83
+
84
+ # bun (30x faster)
85
+ bun add -g @kai/ccs
86
+ ```
87
+
88
+ ### Configuration (Auto-created)
89
+
90
+ **~/.ccs/config.json**:
91
+ ```json
92
+ {
93
+ "profiles": {
94
+ "glm": "~/.ccs/glm.settings.json",
95
+ "default": "~/.claude/settings.json"
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### Custom Claude CLI Path
101
+
102
+ If Claude CLI is installed in a non-standard location (D drive, custom directory), set `CCS_CLAUDE_PATH`:
103
+
104
+ ```bash
105
+ export CCS_CLAUDE_PATH="/path/to/claude" # Unix
106
+ $env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
107
+ ```
108
+
109
+ **See [Troubleshooting Guide](./docs/troubleshooting.md#claude-cli-in-non-standard-location) for detailed setup instructions.**
110
+
111
+ ---
112
+
113
+ ## The Daily Developer Pain Point
114
+
115
+ You have both Claude subscription and GLM Coding Plan. Two scenarios happen every day:
116
+
117
+ 1. **Rate Limits Hit**: Claude stops mid-project → you manually edit `~/.claude/settings.json`
118
+ 2. **Cost Waste**: Simple tasks use expensive Claude → GLM would work fine
119
+
120
+ Manual switching breaks your flow. **CCS fixes it instantly**.
121
+
122
+ ## Why CCS Instead of Manual Switching?
123
+
124
+ <div align="center">
125
+
126
+ | Feature | Benefit | Emotional Value |
127
+ |---------|---------|-----------------|
128
+ | **Instant Switching** | One command, no file editing | Confidence, control |
129
+ | **Zero Downtime** | Never interrupt your workflow | Reliability, consistency |
130
+ | **Smart Delegation** | Right model for each task automatically | Simplicity, ease |
131
+ | **Cost Control** | Use expensive models only when needed | Efficiency, savings |
132
+ | **Cross-Platform** | Works on macOS, Linux, Windows | Flexibility, portability |
133
+ | **Reliable** | Pure bash/PowerShell, zero dependencies | Trust, peace of mind |
134
+
135
+ </div>
136
+
137
+ **The Solution**:
138
+ ```bash
139
+ ccs # Use Claude subscription (default)
140
+ ccs glm # Switch to GLM fallback
141
+ # Hit rate limit? Switch instantly:
142
+ ccs glm # Continue working with GLM
143
+ ```
144
+
145
+ One command. Zero downtime. No file editing. Right model, right task.
146
+
147
+ ---
148
+
149
+ ## 🏗️ Architecture Overview
150
+
151
+ ```mermaid
152
+ graph LR
153
+ subgraph "User Command"
154
+ CMD[ccs glm]
155
+ end
156
+
157
+ subgraph "CCS Processing"
158
+ CONFIG[Read ~/.ccs/config.json]
159
+ LOOKUP[Lookup profile → settings file]
160
+ VALIDATE[Validate file exists]
161
+ end
162
+
163
+ subgraph "Claude CLI"
164
+ EXEC[claude --settings file_path]
165
+ end
166
+
167
+ subgraph "API Response"
168
+ API[Claude Sub or GLM API]
169
+ end
170
+
171
+ CMD --> CONFIG
172
+ CONFIG --> LOOKUP
173
+ LOOKUP --> VALIDATE
174
+ VALIDATE --> EXEC
175
+ EXEC --> API
176
+ ```
177
+
178
+ ---
179
+
180
+ ## ⚡ Features
181
+
182
+ ### Instant Profile Switching
183
+ - **One Command**: `ccs glm` to switch to GLM, `ccs` to use Claude subscription - no config file editing
184
+ - **Smart Detection**: Automatically uses right model for each task
185
+ - **Persistent**: Switch stays active until changed again
186
+
187
+ ### Zero Workflow Interruption
188
+ - **No Downtime**: Switching happens instantly between commands
189
+ - **Context Preservation**: Your workflow remains uninterrupted
190
+ - **Seamless Integration**: Works exactly like native Claude CLI
191
+
192
+ ### Task Delegation
193
+
194
+ > **🚧 Work in Progress**: This feature is experimental and not fully tested. Use with caution.
195
+
196
+ CCS includes intelligent task delegation via the `/ccs` meta-command:
197
+
198
+ **Install CCS commands:**
199
+ ```bash
200
+ ccs --install # Install /ccs command to Claude CLI
201
+ ```
202
+
203
+ **Use task delegation:**
204
+ ```bash
205
+ # After running ccs --install, you can use:
206
+ /ccs glm /plan "add user authentication"
207
+ /ccs glm /code "implement auth endpoints"
208
+ /ccs glm /ask "explain this error"
209
+ ```
210
+
211
+ **Remove when not needed:**
212
+ ```bash
213
+ ccs --uninstall # Remove /ccs command from Claude CLI
214
+ ```
215
+
216
+ **Benefits**:
217
+ - ✅ Save tokens by delegating simple tasks to cheaper models
218
+ - ✅ Use right model for each task automatically
219
+ - ✅ Seamless integration with existing workflows
220
+ - ✅ Clean installation and removal when needed
221
+
222
+ ---
223
+
224
+ ## 💻 Usage Examples
225
+
226
+ ```bash
227
+ ccs # Use Claude subscription (default)
228
+ ccs glm # Use GLM fallback
229
+ ccs --version # Show CCS version and install location
230
+ ccs --install # Install CCS commands and skills to ~/.claude/
231
+ ccs --uninstall # Remove CCS commands and skills from ~/.claude/
232
+ ```
233
+
234
+ ---
235
+
236
+ ### 🗑️ Uninstall
237
+
238
+ **macOS / Linux**:
239
+ ```bash
240
+ curl -fsSL ccs.kaitran.ca/uninstall | bash
241
+ ```
242
+
243
+ **Windows PowerShell**:
244
+ ```powershell
245
+ irm ccs.kaitran.ca/uninstall | iex
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 🎯 Philosophy
251
+
252
+ - **YAGNI**: No features "just in case"
253
+ - **KISS**: Simple bash, no complexity
254
+ - **DRY**: One source of truth (config)
255
+
256
+ ---
257
+
258
+ ## 📖 Documentation
259
+
260
+ **Complete documentation in [docs/](./docs/)**:
261
+ - [Installation Guide](./docs/installation.md)
262
+ - [Configuration](./docs/configuration.md)
263
+ - [Usage Examples](./docs/usage.md)
264
+ - [Troubleshooting](./docs/troubleshooting.md)
265
+ - [Contributing](./docs/contributing.md)
266
+
267
+ ---
268
+
269
+ ## 🤝 Contributing
270
+
271
+ We welcome contributions! Please see our [Contributing Guide](./docs/contributing.md) for details.
272
+
273
+ ---
274
+
275
+ ## 📄 License
276
+
277
+ CCS is licensed under the [MIT License](LICENSE).
278
+
279
+ ---
280
+
281
+ <div align="center">
282
+
283
+ **Made with ❤️ for developers who hit rate limits too often**
284
+
285
+ [⭐ Star this repo](https://github.com/kaitranntt/ccs) | [🐛 Report issues](https://github.com/kaitranntt/ccs/issues) | [📖 Read docs](./docs/)
286
+
287
+ </div>
package/README.vi.md ADDED
@@ -0,0 +1,257 @@
1
+ # CCS - Claude Code Switch
2
+
3
+ <div align="center">
4
+
5
+ ![CCS Logo](docs/assets/ccs-logo-medium.png)
6
+
7
+ **Một lệnh, không downtime, đúng model cho từng tác vụ**
8
+
9
+ Chuyển đổi giữa Claude Sonnet 4.5 và GLM 4.6 ngay lập tức. Ngừng hitting rate limits. Bắt đầu tối ưu chi phí.
10
+
11
+
12
+ [![License](https://img.shields.io/badge/license-MIT-C15F3C?style=for-the-badge)](LICENSE)
13
+ [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=for-the-badge)]()
14
+ [![PoweredBy](https://img.shields.io/badge/PoweredBy-ClaudeKit-C15F3C?style=for-the-badge)](https://claudekit.cc?ref=HMNKXOHN)
15
+
16
+ **Ngôn ngữ**: [English](README.md) | [Tiếng Việt](README.vi.md)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## 🚀 Bắt Đầu Nhanh
23
+
24
+ ### 🔑 Điều Kiện Tiên Quyết
25
+
26
+ **Trước khi cài đặt CCS, hãy đảm bảo bạn đã đăng nhập vào Claude CLI với tài khoản subscription:**
27
+ ```bash
28
+ claude /login
29
+ ```
30
+
31
+ ### Phương Pháp Cài Đặt Chính
32
+
33
+ **macOS / Linux**
34
+ ```bash
35
+ curl -fsSL ccs.kaitran.ca/install | bash
36
+ ```
37
+
38
+ **Windows PowerShell**
39
+ ```powershell
40
+ irm ccs.kaitran.ca/install | iex
41
+ ```
42
+
43
+ ### Lần Chuyển Đổi Đầu Tiên
44
+
45
+ ```bash
46
+ # Dùng Claude subscription (mặc định)
47
+ ccs "Review thiết kế kiến trúc này"
48
+
49
+ # Chuyển sang GLM cho tác vụ tối ưu chi phí
50
+ ccs glm "Tạo REST API đơn giản"
51
+
52
+ # Dùng GLM cho tất cả lệnh tiếp theo cho đến khi chuyển lại
53
+ ccs glm
54
+ ccs "Debug issue này"
55
+ ccs "Viết unit tests"
56
+ ```
57
+
58
+ ### Cấu Hình (Tự Tạo)
59
+
60
+ **~/.ccs/config.json**:
61
+ ```json
62
+ {
63
+ "profiles": {
64
+ "glm": "~/.ccs/glm.settings.json",
65
+ "default": "~/.claude/settings.json"
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Đường Dẫn Claude CLI Tùy Chỉnh
71
+
72
+ 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`:
73
+
74
+ ```bash
75
+ export CCS_CLAUDE_PATH="/path/to/claude" # Unix
76
+ $env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
77
+ ```
78
+
79
+ **Xem [Hướng dẫn Khắc phục Sự cố](./docs/vi/troubleshooting.vi.md#claude-cli-ở-vị-trí-không-chuẩn) để biết chi tiết cài đặt.**
80
+
81
+ ---
82
+
83
+ ## Điểm Đau Hàng Ngày Của Lập Trình Viên
84
+
85
+ Bạn có cả Claude subscription và GLM Coding Plan. Hai tình huống xảy ra hàng ngày:
86
+
87
+ 1. **Hết Rate Limit**: Claude dừng giữa chừng project → bạn phải tự tay sửa `~/.claude/settings.json`
88
+ 2. **Lãng Phí Chi Phí**: Tác vụ đơn giản dùng Claude đắt tiền → GLM cũng làm tốt
89
+
90
+ Chuyển đổi thủ công làm gián đoạn workflow của bạn. **CCS khắc phục ngay lập tức**.
91
+
92
+ ## Tại Sao CCS Thay Vì Chuyển Đổi Thủ Công?
93
+
94
+ <div align="center">
95
+
96
+ | Tính năng | Lợi ích | Giá trị cảm xúc |
97
+ |-----------|---------|-----------------|
98
+ | **Chuyển đổi tức thì** | Một lệnh, không sửa file | Tự tin, kiểm soát |
99
+ | **Không downtime** | Không bao giờ gián đoạn workflow | Đáng tin cậy, nhất quán |
100
+ | **Delegation thông minh** | Đúng model cho từng tác vụ tự động | Đơn giản, dễ dàng |
101
+ | **Kiểm soát chi phí** | Dùng model đắt tiền chỉ khi cần | Hiệu quả, tiết kiệm |
102
+ | **Đa nền tảng** | Hoạt động trên macOS, Linux, Windows | Linh hoạt, di động |
103
+ | **Đáng tin cậy** | Bash/PowerShell thuần, không dependencies | Tin tưởng, an tâm |
104
+
105
+ </div>
106
+
107
+ **Giải pháp**:
108
+ ```bash
109
+ ccs # Dùng Claude subscription (mặc định)
110
+ ccs glm # Chuyển sang GLM fallback
111
+ # Hết rate limit? Chuyển ngay:
112
+ ccs glm # Tiếp tục làm việc với GLM
113
+ ```
114
+
115
+ Một lệnh. Không downtime. Không phải sửa file. Đúng model, đúng việc.
116
+
117
+ ---
118
+
119
+ ## 🏗️ Tổng Quan Kiến Trúc
120
+
121
+ ```mermaid
122
+ graph LR
123
+ subgraph "Lệnh Người Dùng"
124
+ CMD[ccs glm]
125
+ end
126
+
127
+ subgraph "Xử Lý CCS"
128
+ CONFIG[Đọc ~/.ccs/config.json]
129
+ LOOKUP[Tìm profile → file settings]
130
+ VALIDATE[Kiểm tra file tồn tại]
131
+ end
132
+
133
+ subgraph "Claude CLI"
134
+ EXEC[claude --settings file_path]
135
+ end
136
+
137
+ subgraph "Phản Hồi API"
138
+ API[Claude hoặc GLM API]
139
+ end
140
+
141
+ CMD --> CONFIG
142
+ CONFIG --> LOOKUP
143
+ LOOKUP --> VALIDATE
144
+ VALIDATE --> EXEC
145
+ EXEC --> API
146
+ ```
147
+
148
+ ---
149
+
150
+ ## ⚡ Tính Năng
151
+
152
+ ### Chuyển Profile Ngay Lập Tức
153
+ - **Một Lệnh**: `ccs glm` để chuyển sang GLM, `ccs` để dùng Claude subscription - không cần sửa file config
154
+ - **Phát Hiện Thông Minh**: Tự động dùng đúng model cho từng tác vụ
155
+ - **Liên Tục**: Chuyển đổi hoạt động cho đến khi thay đổi lại
156
+
157
+ ### Không Gián Đoạn Workflow
158
+ - **Không Downtime**: Chuyển đổi xảy ra ngay lập tức giữa các lệnh
159
+ - **Bảo Toàn Context**: Workflow của bạn không bị gián đoạn
160
+ - **Tích Hợp Liền Mạch**: Hoạt động chính xác như Claude CLI native
161
+
162
+ ### Delegation Tác Vụ
163
+
164
+ > **🚧 Đang phát triển**: Tính năng này đang trong giai đoạn thử nghiệm và chưa được kiểm tra đầy đủ. Sử dụng với cẩn thận.
165
+
166
+ CCS bao gồm delegation tác vụ thông minh qua meta-command `/ccs`:
167
+
168
+ **Cài đặt lệnh CCS:**
169
+ ```bash
170
+ ccs --install # Cài đặt lệnh /ccs vào Claude CLI
171
+ ```
172
+
173
+ **Sử dụng delegation tác vụ:**
174
+ ```bash
175
+ # Sau khi chạy ccs --install, bạn có thể dùng:
176
+ /ccs glm /plan "add user authentication"
177
+ /ccs glm /code "implement auth endpoints"
178
+ /ccs glm /ask "explain this error"
179
+ ```
180
+
181
+ **Gỡ bỏ khi không cần:**
182
+ ```bash
183
+ ccs --uninstall # Gỡ bỏ lệnh /ccs khỏi Claude CLI
184
+ ```
185
+
186
+ **Lợi ích**:
187
+ - ✅ Tiết kiệm tokens bằng cách delegation tác vụ đơn giản cho model rẻ hơn
188
+ - ✅ Dùng đúng model cho từng tác vụ tự động
189
+ - ✅ Tích hợp liền mạch với workflows hiện có
190
+ - ✅ Cài đặt và gỡ bỏ sạch sẽ khi cần
191
+
192
+ ---
193
+
194
+ ## 💻 Ví Dụ Sử Dụng
195
+
196
+ ```bash
197
+ ccs # Dùng Claude subscription (mặc định)
198
+ ccs glm # Dùng GLM fallback
199
+ ccs --version # Hiển thị phiên bản CCS và vị trí cài đặt
200
+ ccs --install # Cài đặt lệnh và kỹ năng CCS vào ~/.claude/
201
+ ccs --uninstall # Gỡ bỏ lệnh và kỹ năng CCS khỏi ~/.claude/
202
+ ```
203
+
204
+ ---
205
+
206
+ ### 🗑️ Gỡ Cài Đặt
207
+
208
+ **macOS / Linux**:
209
+ ```bash
210
+ curl -fsSL ccs.kaitran.ca/uninstall | bash
211
+ ```
212
+
213
+ **Windows PowerShell**:
214
+ ```powershell
215
+ irm ccs.kaitran.ca/uninstall | iex
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 🎯 Triết Lý
221
+
222
+ - **YAGNI**: Không có tính năng "phòng hờ"
223
+ - **KISS**: Bash đơn giản, không phức tạp
224
+ - **DRY**: Một nguồn chân lý duy nhất (config)
225
+
226
+ ---
227
+
228
+ ## 📖 Tài Liệu
229
+
230
+ **Tài liệu đầy đủ trong [docs/](./docs/)**:
231
+ - [Hướng dẫn Cài đặt](./docs/vi/installation.vi.md)
232
+ - [Cấu hình](./docs/vi/configuration.vi.md)
233
+ - [Ví dụ Sử dụng](./docs/vi/usage.vi.md)
234
+ - [Khắc phục Sự cố](./docs/vi/troubleshooting.vi.md)
235
+ - [Đóng góp](./docs/vi/contributing.vi.md)
236
+
237
+ ---
238
+
239
+ ## 🤝 Đóng Góp
240
+
241
+ Chúng tôi chào mừng đóng góp! Xem [Hướng dẫn Đóng góp](./docs/contributing.md) để biết chi tiết.
242
+
243
+ ---
244
+
245
+ ## 📄 Giấy Phép
246
+
247
+ CCS được cấp phép theo [Giấy phép MIT](LICENSE).
248
+
249
+ ---
250
+
251
+ <div align="center">
252
+
253
+ **Được tạo với ❤️ cho những lập trình viên hay hết rate limit**
254
+
255
+ [⭐ Star repo này](https://github.com/kaitranntt/ccs) | [🐛 Báo cáo vấn đề](https://github.com/kaitranntt/ccs/issues) | [📖 Đọc tài liệu](./docs/)
256
+
257
+ </div>
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.4.0