@kaitranntt/ccs 2.5.1 → 3.0.1
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 +325 -0
- package/README.md +149 -102
- package/README.vi.md +147 -94
- package/VERSION +1 -1
- package/bin/auth-commands.js +405 -0
- package/bin/ccs.js +113 -35
- package/bin/config-manager.js +36 -7
- package/bin/doctor.js +365 -0
- package/bin/error-manager.js +159 -0
- package/bin/instance-manager.js +218 -0
- package/bin/profile-detector.js +199 -0
- package/bin/profile-registry.js +226 -0
- package/bin/recovery-manager.js +135 -0
- package/lib/ccs +856 -301
- package/lib/ccs.ps1 +792 -122
- package/package.json +1 -1
- package/scripts/postinstall.js +111 -12
package/README.ja.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# CCS - Claude Code Switch
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**1コマンド、ダウンタイムなし、複数アカウント**
|
|
8
|
+
|
|
9
|
+
複数のClaudeアカウント、GLM、Kimiを瞬時に切り替え。<br>
|
|
10
|
+
レート制限を回避し、継続的に作業。
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[]()
|
|
15
|
+
[](https://www.npmjs.com/package/@kaitranntt/ccs)
|
|
16
|
+
[](https://claudekit.cc?ref=HMNKXOHN)
|
|
17
|
+
|
|
18
|
+
**Languages**: [English](README.md) | [Tiếng Việt](README.vi.md) | [日本語](README.ja.md)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🚀 クイックスタート
|
|
25
|
+
|
|
26
|
+
### 🔑 前提条件
|
|
27
|
+
|
|
28
|
+
**CCSをインストールする前に、サブスクリプションアカウントでClaude CLIにログインしていることを確認してください:**
|
|
29
|
+
```bash
|
|
30
|
+
claude /login
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 主なインストール方法
|
|
34
|
+
|
|
35
|
+
#### オプション1: npmパッケージ(推奨)
|
|
36
|
+
|
|
37
|
+
**macOS / Linux / Windows**
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g @kaitranntt/ccs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
主要なパッケージマネージャーすべてに対応:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# yarn
|
|
46
|
+
yarn global add @kaitranntt/ccs
|
|
47
|
+
|
|
48
|
+
# pnpm(ディスク使用量70%削減)
|
|
49
|
+
pnpm add -g @kaitranntt/ccs
|
|
50
|
+
|
|
51
|
+
# bun(30倍高速)
|
|
52
|
+
bun add -g @kaitranntt/ccs
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### オプション2: 直接インストール(従来型)
|
|
56
|
+
|
|
57
|
+
**macOS / Linux**
|
|
58
|
+
```bash
|
|
59
|
+
curl -fsSL ccs.kaitran.ca/install | bash
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Windows PowerShell**
|
|
63
|
+
```powershell
|
|
64
|
+
irm ccs.kaitran.ca/install | iex
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
> **💡 パフォーマンス**: 従来型インストールはNode.jsルーティングをバイパスし起動が高速ですが、デプロイ自動化が容易なためnpm更新を優先します。
|
|
68
|
+
|
|
69
|
+
### 設定(自動作成)
|
|
70
|
+
|
|
71
|
+
**CCSはインストール時に自動的に設定を作成します**(npm postinstallスクリプト経由)。
|
|
72
|
+
|
|
73
|
+
**~/.ccs/config.json**:
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"profiles": {
|
|
77
|
+
"glm": "~/.ccs/glm.settings.json",
|
|
78
|
+
"kimi": "~/.ccs/kimi.settings.json",
|
|
79
|
+
"default": "~/.claude/settings.json"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### カスタムClaude CLIパス
|
|
85
|
+
|
|
86
|
+
Claude CLIが標準以外の場所(Dドライブ、カスタムディレクトリ)にインストールされている場合は、`CCS_CLAUDE_PATH`を設定してください:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
export CCS_CLAUDE_PATH="/path/to/claude" # Unix
|
|
90
|
+
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**詳細な設定手順については、[トラブルシューティングガイド](./docs/en/troubleshooting.md#claude-cli-in-non-standard-location)を参照してください。**
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### 最初の切り替え
|
|
98
|
+
|
|
99
|
+
> **⚠️ 重要**: GLMまたはKimiプロファイルを使用する前に、対応する設定ファイルでAPIキーを更新する必要があります:
|
|
100
|
+
> - **GLM**: `~/.ccs/glm.settings.json`を編集してGLM APIキーを追加
|
|
101
|
+
> - **Kimi**: `~/.ccs/kimi.settings.json`を編集してKimi APIキーを追加
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Claudeサブスクリプションを使用(デフォルト)で高レベルの計画
|
|
105
|
+
ccs "マイクロサービスアーキテクチャの実装計画を立てて"
|
|
106
|
+
|
|
107
|
+
# GLMに切り替えてコスト最適化されたタスクを実行
|
|
108
|
+
ccs glm "シンプルなREST APIを作成して"
|
|
109
|
+
|
|
110
|
+
# Kimiに切り替えて思考能力を活用
|
|
111
|
+
ccs kimi "適切なエラーハンドリングで統合テストを書いて"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 日常の開発者の課題
|
|
117
|
+
|
|
118
|
+
開発者は日々多くのサブスクリプションシナリオに直面します:
|
|
119
|
+
|
|
120
|
+
1. **アカウント分離**: 会社のClaudeアカウントと個人のClaude → 業務と個人のコンテキストを手動で切り替える必要
|
|
121
|
+
2. **レート制限**: Claudeがプロジェクト途中で停止 → 手動で`~/.claude/settings.json`を編集
|
|
122
|
+
3. **コスト管理**: 2-3つのProサブスクリプション(月$20) vs Claude Maxの5倍コスト(月$100)→ Pro階層が実用的な上限
|
|
123
|
+
4. **モデル選択**: タスクごとに異なるモデルの強みを活用 → 手動切り替え
|
|
124
|
+
|
|
125
|
+
手動コンテキスト切り替えはワークフローを中断します。**CCSがシームレスに管理します**。
|
|
126
|
+
|
|
127
|
+
## 手動切り替えではなくCCSを使う理由は?
|
|
128
|
+
|
|
129
|
+
<div align="center">
|
|
130
|
+
|
|
131
|
+
| 機能 | メリット |
|
|
132
|
+
|---------|---------|
|
|
133
|
+
| **アカウント分離** | 業務と個人を分離 |
|
|
134
|
+
| **コスト最適化** | 2-3つのProアカウント vs Max 5倍コスト |
|
|
135
|
+
| **即座の切り替え** | 1コマンド、ファイル編集不要 |
|
|
136
|
+
| **ゼロダウンタイム** | ワークフロー中断なし |
|
|
137
|
+
| **レート制限管理** | 制限時にアカウント切り替え |
|
|
138
|
+
| **クロスプラットフォーム** | macOS、Linux、Windows |
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
**ソリューション**:
|
|
143
|
+
```bash
|
|
144
|
+
ccs work # 会社のClaudeアカウントを使用
|
|
145
|
+
ccs personal # 個人Claudeアカウントに切り替え
|
|
146
|
+
ccs glm # コスト効率の良いタスク用にGLMに切り替え
|
|
147
|
+
ccs kimi # 代替オプション用にKimiに切り替え
|
|
148
|
+
# レート制限に達した?即座に切り替え:
|
|
149
|
+
ccs glm # GLMで作業を続行
|
|
150
|
+
# 別の会社アカウントが必要?
|
|
151
|
+
ccs work-2 # 2番目の会社アカウントに切り替え
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 🏗️ アーキテクチャ概要
|
|
157
|
+
|
|
158
|
+
**v3.0 Login-Per-Profileモデル**: 各プロファイルは独立したClaudeインスタンスで、ユーザーが直接ログインします。資格情報のコピーやvault暗号化は不要です。
|
|
159
|
+
|
|
160
|
+
```mermaid
|
|
161
|
+
flowchart TD
|
|
162
|
+
subgraph "ユーザー入力"
|
|
163
|
+
USER["ユーザー実行: ccs <profile> [args...]"]
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
subgraph "プロファイル検出エンジン"
|
|
167
|
+
DETECT[ProfileDetector]
|
|
168
|
+
PROFILE_CHECK{プロファイル存在?}
|
|
169
|
+
|
|
170
|
+
subgraph "プロファイルタイプ"
|
|
171
|
+
SETTINGS["Settings-based<br/>glm, kimi, default"]
|
|
172
|
+
ACCOUNT["Account-based<br/>work, personal, team"]
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
subgraph "CCSコア処理"
|
|
177
|
+
CONFIG["config.jsonと<br/>profiles.jsonを読み込み"]
|
|
178
|
+
|
|
179
|
+
subgraph "プロファイルハンドラー"
|
|
180
|
+
SETTINGS_MGR["SettingsManager<br/>→ --settings flag"]
|
|
181
|
+
INSTANCE_MGR["InstanceManager<br/>→ CLAUDE_CONFIG_DIR"]
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
subgraph "Claude CLI実行"
|
|
186
|
+
CLAUDE_DETECT["Claude CLI検出<br/>CCS_CLAUDE_PATHサポート"]
|
|
187
|
+
|
|
188
|
+
subgraph "実行方法"
|
|
189
|
+
SETTINGS_EXEC["claude --settings <path>"]
|
|
190
|
+
INSTANCE_EXEC["CLAUDE_CONFIG_DIR=<instance> claude"]
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
subgraph "APIレイヤー"
|
|
195
|
+
API["API Response<br/>Claude Sonnet 4.5<br/>GLM 4.6<br/>Kimi K2 Thinking"]
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
%% Flow connections
|
|
199
|
+
USER --> DETECT
|
|
200
|
+
DETECT --> PROFILE_CHECK
|
|
201
|
+
PROFILE_CHECK -->|はい| SETTINGS
|
|
202
|
+
PROFILE_CHECK -->|はい| ACCOUNT
|
|
203
|
+
|
|
204
|
+
SETTINGS --> CONFIG
|
|
205
|
+
ACCOUNT --> CONFIG
|
|
206
|
+
|
|
207
|
+
CONFIG --> SETTINGS_MGR
|
|
208
|
+
CONFIG --> INSTANCE_MGR
|
|
209
|
+
|
|
210
|
+
SETTINGS_MGR --> SETTINGS_EXEC
|
|
211
|
+
INSTANCE_MGR --> INSTANCE_EXEC
|
|
212
|
+
|
|
213
|
+
SETTINGS_EXEC --> CLAUDE_DETECT
|
|
214
|
+
INSTANCE_EXEC --> CLAUDE_DETECT
|
|
215
|
+
|
|
216
|
+
CLAUDE_DETECT --> API
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## ⚡ 機能
|
|
222
|
+
|
|
223
|
+
- **即座の切り替え** - `ccs glm`でGLMに切り替え、設定編集不要
|
|
224
|
+
- **同時セッション** - 複数のプロファイルを異なるターミナルで同時実行
|
|
225
|
+
- **独立したインスタンス** - 各プロファイルが独自の設定を保持 (`~/.ccs/instances/<profile>/`)
|
|
226
|
+
- **クロスプラットフォーム** - macOS、Linux、Windows - 同一動作
|
|
227
|
+
- **ダウンタイムなし** - 即座に切り替え、ワークフロー中断なし
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 💻 使用例
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
ccs # Claudeサブスクリプションを使用(デフォルト)
|
|
236
|
+
ccs glm # GLMフォールバックを使用
|
|
237
|
+
ccs kimi # Kimi for Codingを使用
|
|
238
|
+
ccs --version # CCSバージョンとインストール場所を表示
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 同時セッション (Multi-Account)
|
|
242
|
+
```bash
|
|
243
|
+
# 複数のClaudeアカウントを作成
|
|
244
|
+
ccs auth create work # 業務用アカウント
|
|
245
|
+
ccs auth create personal # 個人用アカウント
|
|
246
|
+
ccs auth create team # チーム用アカウント
|
|
247
|
+
|
|
248
|
+
# ターミナル1 - 業務用アカウント
|
|
249
|
+
ccs work "implement feature"
|
|
250
|
+
|
|
251
|
+
# ターミナル2 - 個人用アカウント(同時実行)
|
|
252
|
+
ccs personal "review code"
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### 🗑️ アンインストール
|
|
258
|
+
|
|
259
|
+
**パッケージマネージャー**
|
|
260
|
+
```bash
|
|
261
|
+
# npm
|
|
262
|
+
npm uninstall -g @kaitranntt/ccs
|
|
263
|
+
|
|
264
|
+
# yarn
|
|
265
|
+
yarn global remove @kaitranntt/ccs
|
|
266
|
+
|
|
267
|
+
# pnpm
|
|
268
|
+
pnpm remove -g @kaitranntt/ccs
|
|
269
|
+
|
|
270
|
+
# bun
|
|
271
|
+
bun remove -g @kaitranntt/ccs
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**公式アンインストーラー**
|
|
275
|
+
|
|
276
|
+
**macOS / Linux**
|
|
277
|
+
```bash
|
|
278
|
+
curl -fsSL ccs.kaitran.ca/uninstall | bash
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Windows PowerShell**
|
|
282
|
+
```powershell
|
|
283
|
+
irm ccs.kaitran.ca/uninstall | iex
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 🎯 哲学
|
|
289
|
+
|
|
290
|
+
- **YAGNI**: 「念のため」の機能は追加しない
|
|
291
|
+
- **KISS**: シンプルなbash、複雑さなし
|
|
292
|
+
- **DRY**: 単一の情報源(設定)
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## 📖 ドキュメント
|
|
297
|
+
|
|
298
|
+
**[docs/](./docs/)の完全なドキュメント**:
|
|
299
|
+
- [インストールガイド](./docs/en/installation.md)
|
|
300
|
+
- [設定](./docs/en/configuration.md)
|
|
301
|
+
- [使用例](./docs/en/usage.md)
|
|
302
|
+
- [トラブルシューティング](./docs/en/troubleshooting.md)
|
|
303
|
+
- [コントリビューション](./CONTRIBUTING.md)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## 🤝 コントリビューション
|
|
308
|
+
|
|
309
|
+
コントリビューションを歓迎します!詳細については[コントリビューションガイド](./CONTRIBUTING.md)をご覧ください。
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## 📄 ライセンス
|
|
314
|
+
|
|
315
|
+
CCSは[MITライセンス](LICENSE)の下でライセンスされています。
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
<div align="center">
|
|
320
|
+
|
|
321
|
+
**レート制限に頻繁に遭遇する開発者のために ❤️ を込めて作成**
|
|
322
|
+
|
|
323
|
+
[⭐ このリポジトリにスター](https://github.com/kaitranntt/ccs) | [🐛 問題を報告](https://github.com/kaitranntt/ccs/issues) | [📖 ドキュメントを読む](./docs/en/)
|
|
324
|
+
|
|
325
|
+
</div>
|
package/README.md
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
**One command, zero downtime,
|
|
7
|
+
**One command, zero downtime, multiple accounts**
|
|
8
8
|
|
|
9
|
-
Switch between Claude
|
|
9
|
+
Switch between multiple Claude accounts, GLM, and Kimi instantly.<br>
|
|
10
|
+
Stop hitting rate limits. Keep working continuously.
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
[](LICENSE)
|
|
@@ -14,7 +15,7 @@ Switch between Claude Sonnet 4.5, GLM 4.6, and Kimi for Coding instantly. Stop h
|
|
|
14
15
|
[](https://www.npmjs.com/package/@kaitranntt/ccs)
|
|
15
16
|
[](https://claudekit.cc?ref=HMNKXOHN)
|
|
16
17
|
|
|
17
|
-
**Languages**: [English](README.md) | [Tiếng Việt](README.vi.md)
|
|
18
|
+
**Languages**: [English](README.md) | [Tiếng Việt](README.vi.md) | [日本語](README.ja.md)
|
|
18
19
|
|
|
19
20
|
</div>
|
|
20
21
|
|
|
@@ -38,7 +39,18 @@ claude /login
|
|
|
38
39
|
npm install -g @kaitranntt/ccs
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
All major package managers are supported:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# yarn
|
|
46
|
+
yarn global add @kaitranntt/ccs
|
|
47
|
+
|
|
48
|
+
# pnpm (70% less disk space)
|
|
49
|
+
pnpm add -g @kaitranntt/ccs
|
|
50
|
+
|
|
51
|
+
# bun (30x faster)
|
|
52
|
+
bun add -g @kaitranntt/ccs
|
|
53
|
+
```
|
|
42
54
|
|
|
43
55
|
#### Option 2: Direct Install (Traditional)
|
|
44
56
|
|
|
@@ -52,41 +64,7 @@ curl -fsSL ccs.kaitran.ca/install | bash
|
|
|
52
64
|
irm ccs.kaitran.ca/install | iex
|
|
53
65
|
```
|
|
54
66
|
|
|
55
|
-
|
|
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
|
-
# Switch to Kimi for alternative option
|
|
65
|
-
ccs kimi "Write integration tests"
|
|
66
|
-
|
|
67
|
-
# Use GLM for all subsequent commands until switched back
|
|
68
|
-
ccs glm
|
|
69
|
-
ccs "Debug this issue"
|
|
70
|
-
ccs "Write unit tests"
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
#### Package Manager Options
|
|
74
|
-
|
|
75
|
-
All major package managers are supported:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# npm (default)
|
|
79
|
-
npm install -g @kaitranntt/ccs
|
|
80
|
-
|
|
81
|
-
# yarn
|
|
82
|
-
yarn global add @kaitranntt/ccs
|
|
83
|
-
|
|
84
|
-
# pnpm (70% less disk space)
|
|
85
|
-
pnpm add -g @kaitranntt/ccs
|
|
86
|
-
|
|
87
|
-
# bun (30x faster)
|
|
88
|
-
bun add -g @kaitranntt/ccs
|
|
89
|
-
```
|
|
67
|
+
> **💡 Performance Tip**: Traditional installs bypass Node.js routing for faster startup, but I prioritize npm updates due to easier deployment automation.
|
|
90
68
|
|
|
91
69
|
### Configuration (Auto-created)
|
|
92
70
|
|
|
@@ -116,94 +94,144 @@ $env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
|
|
|
116
94
|
|
|
117
95
|
---
|
|
118
96
|
|
|
97
|
+
### Your First Switch
|
|
98
|
+
|
|
99
|
+
> **⚠️ Important**: Before using GLM or Kimi profiles, you need to update your API keys in their respective settings files:
|
|
100
|
+
> - **GLM**: Edit `~/.ccs/glm.settings.json` and add your GLM API key
|
|
101
|
+
> - **Kimi**: Edit `~/.ccs/kimi.settings.json` and add your Kimi API key
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Use Claude subscription (default) for high-level planning
|
|
105
|
+
ccs "Plan the implementation of a microservices architecture"
|
|
106
|
+
|
|
107
|
+
# Switch to GLM for cost-optimized tasks
|
|
108
|
+
ccs glm "Create a simple REST API"
|
|
109
|
+
|
|
110
|
+
# Switch to Kimi for its thinking capabilities
|
|
111
|
+
ccs kimi "Write integration tests with proper error handling"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
119
116
|
## The Daily Developer Pain Point
|
|
120
117
|
|
|
121
|
-
|
|
118
|
+
Developers face multiple subscription scenarios daily:
|
|
122
119
|
|
|
123
|
-
1. **
|
|
124
|
-
2. **
|
|
125
|
-
3. **
|
|
120
|
+
1. **Account Separation**: Company Claude account vs personal Claude → you must manually switch contexts to keep work and personal separate
|
|
121
|
+
2. **Rate Limits Hit**: Claude stops mid-project → you manually edit `~/.claude/settings.json`
|
|
122
|
+
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
|
|
123
|
+
4. **Model Choice**: Different tasks benefit from different model strengths → manual switching
|
|
126
124
|
|
|
127
|
-
Manual switching breaks your
|
|
125
|
+
Manual context switching breaks your workflow. **CCS manages it seamlessly**.
|
|
128
126
|
|
|
129
127
|
## Why CCS Instead of Manual Switching?
|
|
130
128
|
|
|
131
129
|
<div align="center">
|
|
132
130
|
|
|
133
|
-
| Feature | Benefit |
|
|
134
|
-
|
|
135
|
-
| **
|
|
136
|
-
| **
|
|
137
|
-
| **
|
|
138
|
-
| **
|
|
139
|
-
| **
|
|
140
|
-
| **
|
|
131
|
+
| Feature | Benefit |
|
|
132
|
+
|---------|---------|
|
|
133
|
+
| **Account Isolation** | Keep work separate from personal |
|
|
134
|
+
| **Cost Optimization** | 2-3 Pro accounts vs Max at 5x cost |
|
|
135
|
+
| **Instant Switching** | One command, no file editing |
|
|
136
|
+
| **Zero Downtime** | Never interrupt workflow |
|
|
137
|
+
| **Rate Limit Management** | Switch accounts when limits hit |
|
|
138
|
+
| **Cross-Platform** | macOS, Linux, Windows |
|
|
141
139
|
|
|
142
140
|
</div>
|
|
143
141
|
|
|
144
142
|
**The Solution**:
|
|
145
143
|
```bash
|
|
146
|
-
ccs
|
|
147
|
-
ccs
|
|
148
|
-
ccs
|
|
144
|
+
ccs work # Use company Claude account
|
|
145
|
+
ccs personal # Switch to personal Claude account
|
|
146
|
+
ccs glm # Switch to GLM for cost-effective tasks
|
|
147
|
+
ccs kimi # Switch to Kimi for alternative option
|
|
149
148
|
# Hit rate limit? Switch instantly:
|
|
150
|
-
ccs glm
|
|
151
|
-
#
|
|
152
|
-
ccs
|
|
149
|
+
ccs glm # Continue working with GLM
|
|
150
|
+
# Need different company account?
|
|
151
|
+
ccs work-2 # Switch to second company account
|
|
153
152
|
```
|
|
154
153
|
|
|
155
|
-
One command. Zero downtime. No file editing. Right model, right task.
|
|
156
|
-
|
|
157
154
|
---
|
|
158
155
|
|
|
159
156
|
## 🏗️ Architecture Overview
|
|
160
157
|
|
|
158
|
+
**v3.0 Login-Per-Profile Model**: Each profile is an isolated Claude instance where users login directly. No credential copying or vault encryption.
|
|
159
|
+
|
|
161
160
|
```mermaid
|
|
162
|
-
|
|
163
|
-
subgraph "User
|
|
164
|
-
|
|
161
|
+
flowchart TD
|
|
162
|
+
subgraph "User Input"
|
|
163
|
+
USER["User runs: ccs <profile> [args...]"]
|
|
165
164
|
end
|
|
166
165
|
|
|
167
|
-
subgraph "
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
subgraph "Profile Detection Engine"
|
|
167
|
+
DETECT[ProfileDetector]
|
|
168
|
+
PROFILE_CHECK{Profile exists?}
|
|
169
|
+
|
|
170
|
+
subgraph "Profile Types"
|
|
171
|
+
SETTINGS["Settings-based<br/>glm, kimi, default"]
|
|
172
|
+
ACCOUNT["Account-based<br/>work, personal, team"]
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
subgraph "CCS Core Processing"
|
|
177
|
+
CONFIG["Read config.json<br/>and profiles.json"]
|
|
178
|
+
|
|
179
|
+
subgraph "Profile Handlers"
|
|
180
|
+
SETTINGS_MGR["SettingsManager<br/>→ --settings flag"]
|
|
181
|
+
INSTANCE_MGR["InstanceManager<br/>→ CLAUDE_CONFIG_DIR"]
|
|
182
|
+
end
|
|
171
183
|
end
|
|
172
184
|
|
|
173
|
-
subgraph "Claude CLI"
|
|
174
|
-
|
|
185
|
+
subgraph "Claude CLI Execution"
|
|
186
|
+
CLAUDE_DETECT["Claude CLI Detection<br/>CCS_CLAUDE_PATH support"]
|
|
187
|
+
|
|
188
|
+
subgraph "Execution Methods"
|
|
189
|
+
SETTINGS_EXEC["claude --settings <path>"]
|
|
190
|
+
INSTANCE_EXEC["CLAUDE_CONFIG_DIR=<instance> claude"]
|
|
191
|
+
end
|
|
175
192
|
end
|
|
176
193
|
|
|
177
|
-
subgraph "API
|
|
178
|
-
API[Claude
|
|
194
|
+
subgraph "API Layer"
|
|
195
|
+
API["API Response<br/>Claude Sonnet 4.5<br/>GLM 4.6<br/>Kimi K2 Thinking"]
|
|
179
196
|
end
|
|
180
197
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
198
|
+
%% Flow connections
|
|
199
|
+
USER --> DETECT
|
|
200
|
+
DETECT --> PROFILE_CHECK
|
|
201
|
+
PROFILE_CHECK -->|Yes| SETTINGS
|
|
202
|
+
PROFILE_CHECK -->|Yes| ACCOUNT
|
|
203
|
+
|
|
204
|
+
SETTINGS --> CONFIG
|
|
205
|
+
ACCOUNT --> CONFIG
|
|
206
|
+
|
|
207
|
+
CONFIG --> SETTINGS_MGR
|
|
208
|
+
CONFIG --> INSTANCE_MGR
|
|
209
|
+
|
|
210
|
+
SETTINGS_MGR --> SETTINGS_EXEC
|
|
211
|
+
INSTANCE_MGR --> INSTANCE_EXEC
|
|
212
|
+
|
|
213
|
+
SETTINGS_EXEC --> CLAUDE_DETECT
|
|
214
|
+
INSTANCE_EXEC --> CLAUDE_DETECT
|
|
215
|
+
|
|
216
|
+
CLAUDE_DETECT --> API
|
|
186
217
|
```
|
|
187
218
|
|
|
188
219
|
---
|
|
189
220
|
|
|
190
221
|
## ⚡ Features
|
|
191
222
|
|
|
192
|
-
|
|
193
|
-
- **
|
|
194
|
-
- **
|
|
195
|
-
- **
|
|
196
|
-
|
|
197
|
-
### Zero Workflow Interruption
|
|
198
|
-
- **No Downtime**: Switching happens instantly between commands
|
|
199
|
-
- **Context Preservation**: Your workflow remains uninterrupted
|
|
200
|
-
- **Seamless Integration**: Works exactly like native Claude CLI
|
|
223
|
+
- **Instant Switching** - `ccs glm` switches to GLM, no config editing
|
|
224
|
+
- **Concurrent Sessions** - Run multiple profiles simultaneously in different terminals
|
|
225
|
+
- **Isolated Instances** - Each profile gets own config (`~/.ccs/instances/<profile>/`)
|
|
226
|
+
- **Cross-Platform** - macOS, Linux, Windows - identical behavior
|
|
227
|
+
- **Zero Downtime** - Switch instantly, no workflow interruption
|
|
201
228
|
|
|
202
229
|
|
|
203
230
|
---
|
|
204
231
|
|
|
205
232
|
## 💻 Usage Examples
|
|
206
233
|
|
|
234
|
+
### Basic Profile Switching
|
|
207
235
|
```bash
|
|
208
236
|
ccs # Use Claude subscription (default)
|
|
209
237
|
ccs glm # Use GLM fallback
|
|
@@ -211,32 +239,51 @@ ccs kimi # Use Kimi for Coding
|
|
|
211
239
|
ccs --version # Show CCS version and install location
|
|
212
240
|
```
|
|
213
241
|
|
|
242
|
+
### Concurrent Sessions (Multi-Account)
|
|
243
|
+
```bash
|
|
244
|
+
# Create multiple Claude accounts
|
|
245
|
+
ccs auth create work # Company account
|
|
246
|
+
ccs auth create personal # Personal account
|
|
247
|
+
ccs auth create team # Team account
|
|
248
|
+
|
|
249
|
+
# Terminal 1 - Work account
|
|
250
|
+
ccs work "implement feature"
|
|
251
|
+
|
|
252
|
+
# Terminal 2 - Personal account (runs concurrently)
|
|
253
|
+
ccs personal "review code"
|
|
254
|
+
```
|
|
255
|
+
|
|
214
256
|
---
|
|
215
257
|
|
|
216
|
-
### 🗑️
|
|
258
|
+
### 🗑️ Uninstall
|
|
217
259
|
|
|
218
|
-
**
|
|
260
|
+
**Package Managers**
|
|
261
|
+
```bash
|
|
262
|
+
# npm
|
|
263
|
+
npm uninstall -g @kaitranntt/ccs
|
|
264
|
+
|
|
265
|
+
# yarn
|
|
266
|
+
yarn global remove @kaitranntt/ccs
|
|
219
267
|
|
|
220
|
-
|
|
268
|
+
# pnpm
|
|
269
|
+
pnpm remove -g @kaitranntt/ccs
|
|
270
|
+
|
|
271
|
+
# bun
|
|
272
|
+
bun remove -g @kaitranntt/ccs
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Official Uninstaller**
|
|
276
|
+
|
|
277
|
+
**macOS / Linux**
|
|
221
278
|
```bash
|
|
222
279
|
curl -fsSL ccs.kaitran.ca/uninstall | bash
|
|
223
280
|
```
|
|
224
281
|
|
|
225
|
-
**Windows PowerShell
|
|
282
|
+
**Windows PowerShell**
|
|
226
283
|
```powershell
|
|
227
284
|
irm ccs.kaitran.ca/uninstall | iex
|
|
228
285
|
```
|
|
229
286
|
|
|
230
|
-
> 💡 **Why use the official uninstaller?**
|
|
231
|
-
> - Removes all CCS files and configurations
|
|
232
|
-
> - Cleans up PATH modifications
|
|
233
|
-
> - Removes Claude CLI commands/skills
|
|
234
|
-
> - Handles edge cases we've tested
|
|
235
|
-
|
|
236
|
-
**Alternative methods** (if official uninstaller fails):
|
|
237
|
-
- **npm**: `npm uninstall -g @kaitranntt/ccs`
|
|
238
|
-
- **Manual**: See [troubleshooting guide](./docs/en/troubleshooting.md#manual-uninstall)
|
|
239
|
-
|
|
240
287
|
---
|
|
241
288
|
|
|
242
289
|
## 🎯 Philosophy
|
|
@@ -254,13 +301,13 @@ irm ccs.kaitran.ca/uninstall | iex
|
|
|
254
301
|
- [Configuration](./docs/en/configuration.md)
|
|
255
302
|
- [Usage Examples](./docs/en/usage.md)
|
|
256
303
|
- [Troubleshooting](./docs/en/troubleshooting.md)
|
|
257
|
-
- [Contributing](./
|
|
304
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
258
305
|
|
|
259
306
|
---
|
|
260
307
|
|
|
261
308
|
## 🤝 Contributing
|
|
262
309
|
|
|
263
|
-
We welcome contributions! Please see our [Contributing Guide](./
|
|
310
|
+
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
264
311
|
|
|
265
312
|
---
|
|
266
313
|
|
|
@@ -276,4 +323,4 @@ CCS is licensed under the [MIT License](LICENSE).
|
|
|
276
323
|
|
|
277
324
|
[⭐ Star this repo](https://github.com/kaitranntt/ccs) | [🐛 Report issues](https://github.com/kaitranntt/ccs/issues) | [📖 Read docs](./docs/en/)
|
|
278
325
|
|
|
279
|
-
</div>
|
|
326
|
+
</div>
|