cckit 0.3.0 → 0.3.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.md CHANGED
@@ -33,6 +33,29 @@ yarn global add cckit
33
33
  cckit interactive
34
34
  ```
35
35
 
36
+ ### Interactive Switch Mode
37
+
38
+ `cckit switch` now supports interactive mode when no provider argument is given:
39
+
40
+ ```bash
41
+ # Interactive mode - shows selection list
42
+ cckit switch
43
+
44
+ # Direct mode - with provider argument
45
+ cckit switch zhipu
46
+ ```
47
+
48
+ Interactive switch example:
49
+ ```
50
+ ? 选择要切换的 Provider
51
+ 智谱 Coding Plan - glm-5
52
+ ✓ MiniMax Coding Plan - abab6.5s-chat (当前)
53
+ Kimi Coding Plan - kimi-for-coding
54
+ Claude - claude-3-opus-20250219
55
+ ZenMux.ai - claude-3-5-sonnet-20241022
56
+ ```
57
+
58
+
36
59
  ## Interactive Mode Details
37
60
 
38
61
  The interactive wizard (`cckit interactive`) provides a user-friendly, step-by-step configuration experience with arrow key selection:
@@ -56,20 +79,28 @@ Use ↑/↓ arrow keys to select from:
56
79
  ▸ Step 3: 设置模型
57
80
  ```
58
81
  - Enter the model name (default value provided based on provider)
82
+ - Multiple models can be entered, separated by commas
83
+
84
+ ```
85
+ ▸ Step 4: 配置模型类型 (可选)
86
+ ```
87
+ - Optional: Configure different models for Sonnet/Haiku/Opus model tiers
88
+ - Each tier can be skipped to use the default model
89
+ - This sets `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`
59
90
 
60
91
  ```
61
- ▸ Step 4: 保存配置
92
+ ▸ Step 5: 保存配置
62
93
  ```
63
94
  - If existing configurations found, choose to update or create new
64
95
  - Configuration saved to `~/.cckit/config.json`
65
96
 
66
97
  ```
67
- ▸ Step 5: 测试连接
98
+ ▸ Step 6: 测试连接
68
99
  ```
69
100
  - Optional: Test the connection to verify API key and endpoint
70
101
 
71
102
  ```
72
- ▸ Step 6: 切换 Provider
103
+ ▸ Step 7: 切换 Provider
73
104
  ```
74
105
  - Optional: Switch to the newly configured provider immediately
75
106
 
@@ -113,22 +144,50 @@ $ cckit interactive
113
144
 
114
145
  ▸ Step 3: 设置模型
115
146
 
116
- ? 请输入模型名称: (GLM-4.7)
147
+ ? 请输入模型名称 (多个模型用逗号分隔): glm-5, kimi-k2.5, MiniMax-M2.5
148
+
149
+ ▸ Step 4: 配置模型类型 (可选)
150
+ 提示: 可为 Sonnet/Haiku/Opus 模型类型配置不同的模型,不配置则使用默认模型
151
+
152
+ ? 是否为不同模型类型 (Sonnet/Haiku/Opus) 配置不同的默认模型? Yes
153
+
154
+ ? 选择 Sonnet 模型
155
+ ❯ 跳过 (使用默认模型)
156
+ glm-5
157
+ kimi-k2.5
158
+ MiniMax-M2.5
159
+
160
+ ? 选择 Haiku 模型
161
+ ❯ 跳过 (使用默认模型)
162
+ glm-5
163
+ kimi-k2.5
164
+ MiniMax-M2.5
165
+
166
+ ? 选择 Opus 模型
167
+ ❯ 跳过 (使用默认模型)
168
+ glm-5
169
+ kimi-k2.5
170
+ MiniMax-M2.5
171
+
172
+ 模型类型配置:
173
+ Sonnet: glm-5
174
+ Haiku: kimi-k2.5
175
+ Opus: MiniMax-M2.5
117
176
 
118
- ▸ Step 4: 保存配置
177
+ ▸ Step 5: 保存配置
119
178
 
120
179
  ✓ 配置已保存 (id: zhipu_xxx)
121
180
  Provider: 智谱 Coding Plan
122
- Model: GLM-4.7
181
+ Model: glm-5, kimi-k2.5, MiniMax-M2.5
123
182
 
124
- ▸ Step 5: 测试连接
183
+ ▸ Step 6: 测试连接
125
184
 
126
185
  ? 是否测试连接? (Y/n)
127
186
 
128
187
  ✓ 连接成功!
129
188
  响应时间: 234ms
130
189
 
131
- ▸ Step 6: 切换 Provider
190
+ ▸ Step 7: 切换 Provider
132
191
 
133
192
  ? 是否立即切换到该 Provider? (Y/n)
134
193
 
@@ -145,9 +204,10 @@ $ cckit interactive
145
204
  The interactive wizard will guide you through:
146
205
  1. Selecting an AI provider (智谱 Coding Plan, MiniMax Coding Plan, Kimi Coding Plan, Claude, ZenMux, 快手 StreamLake Coding Plan, 火山引擎 Coding Plan, 阿里云 Coding Plan, 腾讯云 Coding Plan, 讯飞 Coding Plan, or Custom)
147
206
  2. Entering your API key
148
- 3. Setting up the model name
149
- 4. Testing the connection
150
- 5. Switching to the configured provider
207
+ 3. Setting up the model name(s)
208
+ 4. (Optional) Configuring different models for Sonnet/Haiku/Opus tiers
209
+ 5. Testing the connection
210
+ 6. Switching to the configured provider
151
211
 
152
212
  ## Usage
153
213
 
@@ -169,9 +229,12 @@ cckit configure <provider> --api-key <key> [--base-url <url>] [--model <model>]
169
229
  # Configure a custom provider (local LLM, OpenAI-compatible API, etc.)
170
230
  cckit configure my-ollama --api-key "ollama-key" --base-url "http://localhost:11434/v1" --model "llama3"
171
231
 
172
- # Switch to a provider
232
+ # Switch to a provider (direct mode with argument)
173
233
  cckit switch <provider>
174
234
 
235
+ # Switch to a provider (interactive mode without argument)
236
+ cckit switch
237
+
175
238
  # Show provider configuration
176
239
  cckit show <provider>
177
240
 
@@ -184,6 +247,11 @@ cckit models <provider>
184
247
  # Set active model for a provider
185
248
  cckit set-model <provider> <model>
186
249
 
250
+ # Set model for a specific model tier (Sonnet/Haiku/Opus)
251
+ cckit set-model <provider> <model> --type sonnet
252
+ cckit set-model <provider> <model> --type haiku
253
+ cckit set-model <provider> <model> --type opus
254
+
187
255
  # Remove a model from a provider
188
256
  cckit remove-model <provider> <model>
189
257
  ```
@@ -204,6 +272,10 @@ cckit models zhipu
204
272
  # Set active model
205
273
  cckit set-model zhipu "GLM-4-Plus"
206
274
 
275
+ # Set model for specific tier
276
+ cckit set-model zhipu "GLM-4-Plus" --type sonnet
277
+ cckit set-model zhipu "GLM-4.7" --type haiku
278
+
207
279
  # Remove a model
208
280
  cckit remove-model zhipu "GLM-4.7"
209
281
 
@@ -222,6 +294,9 @@ cckit models minimax
222
294
  # Set active model
223
295
  cckit set-model minimax "MiniMax-M4"
224
296
 
297
+ # Set model for specific tier
298
+ cckit set-model minimax "MiniMax-M4" --type sonnet
299
+
225
300
  # Remove a model
226
301
  cckit remove-model minimax "MiniMax-M2"
227
302
 
@@ -315,6 +390,11 @@ cckit models aliyun
315
390
  # Set active model
316
391
  cckit set-model aliyun "glm-5"
317
392
 
393
+ # Set model for specific tier
394
+ cckit set-model aliyun "glm-5" --type sonnet
395
+ cckit set-model aliyun "kimi-k2.5" --type haiku
396
+ cckit set-model aliyun "MiniMax-M2.5" --type opus
397
+
318
398
  # Switch to Aliyun
319
399
  cckit switch aliyun
320
400
  ```
@@ -411,6 +491,65 @@ Each provider can now be configured with multiple models. You can:
411
491
 
412
492
  The active model is used when Claude Code switches to that provider. If no explicit active model is set, the first configured model is used.
413
493
 
494
+ ### Model Tier Configuration
495
+
496
+ Claude Code supports different model tiers (Sonnet, Haiku, Opus) for different use cases. You can configure different models for each tier:
497
+
498
+ #### Command Line
499
+
500
+ ```bash
501
+ # Set default model (ANTHROPIC_MODEL)
502
+ cckit set-model aliyun "glm-5"
503
+
504
+ # Set Sonnet model (ANTHROPIC_DEFAULT_SONNET_MODEL)
505
+ cckit set-model aliyun "glm-5" --type sonnet
506
+
507
+ # Set Haiku model (ANTHROPIC_DEFAULT_HAIKU_MODEL)
508
+ cckit set-model aliyun "kimi-k2.5" --type haiku
509
+
510
+ # Set Opus model (ANTHROPIC_DEFAULT_OPUS_MODEL)
511
+ cckit set-model aliyun "MiniMax-M2.5" --type opus
512
+ ```
513
+
514
+ #### Interactive Mode
515
+
516
+ In interactive mode (`cckit interactive`), after entering model names, you'll be asked:
517
+ ```
518
+ ? 是否为不同模型类型 (Sonnet/Haiku/Opus) 配置不同的默认模型?
519
+ ```
520
+
521
+ Select "Yes" to configure each model tier. You can choose "跳过 (使用默认模型)" for any tier you don't want to customize.
522
+
523
+ #### View Configuration
524
+
525
+ ```bash
526
+ # Show provider configuration including model tier settings
527
+ cckit show aliyun
528
+ ```
529
+
530
+ Output:
531
+ ```
532
+ Configuration: 阿里云 Coding Plan
533
+
534
+ ID: bf76bc20-87f1-4bd4-b091-20b9d1eabdb9
535
+ Name: Aliyun Coding Plan
536
+ Type: aliyun
537
+ ...
538
+ Models: qwen3.5-plus, kimi-k2.5, glm-5, MiniMax-M2.5
539
+ Active: glm-5
540
+ Sonnet: glm-5
541
+ Haiku: kimi-k2.5
542
+ Opus: MiniMax-M2.5
543
+ ```
544
+
545
+ #### Validation
546
+
547
+ The model must be in the provider's model list. If you try to set a model that doesn't exist:
548
+ ```bash
549
+ $ cckit set-model aliyun "non-existent-model" --type sonnet
550
+ Error: Model 'non-existent-model' not found in provider. Available models: qwen3.5-plus, kimi-k2.5, glm-5, MiniMax-M2.5
551
+ ```
552
+
414
553
  ### Provider Details
415
554
 
416
555
  | Provider | Default Model | Auth Method | Capabilities | Default Base URL |
@@ -7,18 +7,19 @@ export declare class Commands {
7
7
  */
8
8
  interactive(): Promise<void>;
9
9
  list(): void;
10
- switch(providerId: string): void;
10
+ switch(providerId?: string): Promise<void>;
11
11
  current(): void;
12
12
  configure(providerId: string, apiKey?: string, baseUrl?: string, models?: string[]): void;
13
13
  show(providerId: string): void;
14
14
  test(providerId: string): Promise<void>;
15
15
  models(providerId: string): void;
16
- setModel(providerId: string, modelName: string): Promise<void>;
16
+ setModel(providerId: string, modelName: string, modelType?: 'default' | 'sonnet' | 'haiku' | 'opus'): Promise<void>;
17
17
  removeModel(providerId: string, modelName: string): void;
18
18
  export(output?: string): void;
19
19
  import(file: string): void;
20
20
  reset(): void;
21
21
  private getProviderDisplayName;
22
22
  private askForSwitch;
23
+ private getModelTypeLabel;
23
24
  }
24
25
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAsD,MAAM,aAAa,CAA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