cckit 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Claude Code Kit
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,250 @@
1
+ # cckit (Node.js Edition)
2
+
3
+ Code Kit for Claude Model Switching - Support 智谱LLM, MiniMax, Kimi, ZenMux.ai, and official Claude
4
+
5
+ A CLI tool for managing and switching between different Claude model providers and their configurations. Features support for model gateways like ZenMux.ai that provide unified access to multiple AI providers.
6
+
7
+ ## Features
8
+
9
+ - **Multiple Provider Support**: Configure and switch between 智谱LLM, MiniMax, Kimi, ZenMux.ai, and official Claude
10
+ - **Easy Configuration**: Simple command-line interface for managing API keys and settings
11
+ - **Claude Integration**: Automatically updates Claude Code configuration files
12
+ - **Export/Import**: Backup and restore your provider configurations
13
+ - **Connection Testing**: Verify provider connectivity before switching
14
+ - **Multi-Language Support**: English and Chinese localization
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ # npm
20
+ npm install -g cckit
21
+
22
+ # pnpm
23
+ pnpm add -g cckit
24
+
25
+ # yarn
26
+ yarn global add cckit
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ### Basic Commands
32
+
33
+ ```bash
34
+ # Show help
35
+ cckit --help
36
+
37
+ # List all configured providers
38
+ cckit list
39
+
40
+ # Show current active provider
41
+ cckit current
42
+
43
+ # Configure a provider
44
+ cckit configure <provider> --api-key <key> [--base-url <url>] [--model <model>] ...
45
+
46
+ # Switch to a provider
47
+ cckit switch <provider>
48
+
49
+ # Show provider configuration
50
+ cckit show <provider>
51
+
52
+ # Test provider connection
53
+ cckit test <provider>
54
+
55
+ # List models for a provider
56
+ cckit models <provider>
57
+
58
+ # Set active model for a provider
59
+ cckit set-model <provider> <model>
60
+ ```
61
+
62
+ ### Supported Providers
63
+
64
+ #### 智谱LLM (Zhipu)
65
+ ```bash
66
+ # Configure 智谱LLM with a single model
67
+ cckit configure zhipu --api-key "your-api-key" --model "GLM-4.6"
68
+
69
+ # Configure with multiple models
70
+ cckit configure zhipu --api-key "your-api-key" --model "GLM-4.6" --model "GLM-4-Plus"
71
+
72
+ # List models
73
+ cckit models zhipu
74
+
75
+ # Set active model
76
+ cckit set-model zhipu "GLM-4-Plus"
77
+
78
+ # Switch to 智谱LLM
79
+ cckit switch zhipu
80
+ ```
81
+
82
+ #### MiniMax
83
+ ```bash
84
+ # Configure MiniMax with multiple models
85
+ cckit configure minimax --api-key "your-api-key" --model "MiniMax-M2" --model "MiniMax-M4"
86
+
87
+ # List models
88
+ cckit models minimax
89
+
90
+ # Set active model
91
+ cckit set-model minimax "MiniMax-M4"
92
+
93
+ # Switch to MiniMax
94
+ cckit switch minimax
95
+ ```
96
+
97
+ #### Kimi (Moonshot)
98
+ ```bash
99
+ # Configure Kimi with multiple models
100
+ cckit configure kimi --api-key "your-api-key" --model "kimi-for-coding" --model "kimi-plus"
101
+
102
+ # List models
103
+ cckit models kimi
104
+
105
+ # Set active model
106
+ cckit set-model kimi "kimi-plus"
107
+
108
+ # Switch to Kimi
109
+ cckit switch kimi
110
+ ```
111
+
112
+ #### ZenMux.ai
113
+ ```bash
114
+ # Configure ZenMux.ai (Anthropic Compatible API Gateway) with multiple models
115
+ cckit configure zenmux --api-key "your-zenmux-api-key" --model "claude-3-5-sonnet-20241022" --model "claude-3-opus-20250219"
116
+
117
+ # List models
118
+ cckit models zenmux
119
+
120
+ # Set active model
121
+ cckit set-model zenmux "claude-3-opus-20250219"
122
+
123
+ # Switch to ZenMux.ai
124
+ cckit switch zenmux
125
+ ```
126
+
127
+ #### Claude (Official)
128
+ ```bash
129
+ # Configure Claude (official) with multiple models
130
+ cckit configure claude --api-key "sk-ant-api03-your-key" --model "claude-3-5-sonnet-20241022" --model "claude-3-opus-20250219"
131
+
132
+ # List models
133
+ cckit models claude
134
+
135
+ # Set active model
136
+ cckit set-model claude "claude-3-opus-20250219"
137
+
138
+ # Switch to Claude
139
+ cckit switch claude
140
+ ```
141
+
142
+ ### Advanced Commands
143
+
144
+ ```bash
145
+ # Export configuration to file
146
+ cckit export --output backup.json
147
+
148
+ # Import configuration from file
149
+ cckit import backup.json
150
+
151
+ # Reset to default Claude configuration
152
+ cckit reset
153
+ ```
154
+
155
+ ## Configuration
156
+
157
+ The CLI stores configurations in `~/.cckit/config.json` and updates Claude's settings in `~/.claude/settings.json`.
158
+
159
+ ### Multi-Model Support
160
+
161
+ Each provider can now be configured with multiple models. You can:
162
+ - Configure multiple models during setup: `cckit configure <provider> --model <model1> --model <model2>`
163
+ - Add models to existing providers: `cckit configure <provider> --model <new-model>`
164
+ - List available models: `cckit models <provider>`
165
+ - Switch active model: `cckit set-model <provider> <model-name>`
166
+
167
+ 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.
168
+
169
+ ### Provider Details
170
+
171
+ | Provider | Default Model | Default Base URL | Auth Method | Capabilities |
172
+ |----------|---------------|------------------|-------------|--------------:|
173
+ | 智谱LLM | GLM-4.6 | https://open.bigmodel.cn/api/anthropic | ANTHROPIC_AUTH_TOKEN | Chat, Code Generation, Chinese Support |
174
+ | MiniMax | MiniMax-M2 | https://api.minimaxi.com/anthropic | ANTHROPIC_AUTH_TOKEN | Chat, Code Generation, Multi-language |
175
+ | Kimi | kimi-for-coding | https://api.kimi.com/coding/ | ANTHROPIC_API_KEY | Chat, Long Context, Code Generation |
176
+ | ZenMux.ai | claude-3-5-sonnet-20241022 | https://zenmux.ai/api/anthropic | ANTHROPIC_API_KEY | Model Gateway, Multi-provider, Claude Compatible |
177
+ | Claude | claude-3-5-sonnet-20241022 | Official | ANTHROPIC_API_KEY | Chat, Code Generation, Analysis, Multimodal |
178
+
179
+ ## How It Works
180
+
181
+ 1. **Configuration Management**: Stores provider settings in `~/.cckit/config.json`
182
+ 2. **Claude Integration**: Updates Claude's `settings.json` with environment variables
183
+ 3. **Switching**: Changes the active provider and updates Claude's configuration
184
+ 4. **Testing**: Sends test messages to verify provider connectivity
185
+
186
+ ## Development
187
+
188
+ ```bash
189
+ # Install dependencies
190
+ pnpm install
191
+
192
+ # Run in development mode
193
+ pnpm run dev list
194
+
195
+ # Build the project
196
+ pnpm run build
197
+
198
+ # Test the CLI
199
+ node dist/index.js list
200
+ ```
201
+
202
+ ## Requirements
203
+
204
+ - Node.js 18 or higher
205
+ - pnpm (or npm/yarn)
206
+ - Claude Code installed
207
+ - Valid API keys for the providers you want to use
208
+
209
+ ## Project Structure
210
+
211
+ ```
212
+ cckit-node/
213
+ ├── src/
214
+ │ ├── index.ts # Main CLI entry point
215
+ │ ├── types.ts # TypeScript type definitions
216
+ │ ├── config.ts # Configuration management
217
+ │ ├── commands.ts # CLI command implementations
218
+ │ ├── providers.ts # Provider configurations and testing
219
+ │ └── i18n.ts # Internationalization (English & Chinese)
220
+ ├── dist/ # Compiled JavaScript output
221
+ ├── package.json # Project dependencies and scripts
222
+ ├── tsconfig.json # TypeScript configuration
223
+ └── README.md # This file
224
+ ```
225
+
226
+ ## License
227
+
228
+ This project is licensed under the MIT License - see the LICENSE file for details.
229
+
230
+ ## Contributing
231
+
232
+ 1. Fork the repository
233
+ 2. Create a feature branch
234
+ 3. Make your changes
235
+ 4. Build and test: `pnpm run build`
236
+ 5. Submit a pull request
237
+
238
+ ## Support
239
+
240
+ If you encounter any issues or have questions, please open an issue on the GitHub repository.
241
+
242
+ ## Differences from Rust Version
243
+
244
+ The Node.js version maintains feature parity with the Rust version while leveraging Node.js/TypeScript advantages:
245
+
246
+ - **TypeScript**: Full type safety and better IDE support
247
+ - **Cross-platform**: Better Windows compatibility out of the box
248
+ - **Easier distribution**: No compilation required for end users
249
+ - **Same CLI interface**: Identical command structure and behavior
250
+ - **Localization**: Same i18n system with English and Chinese support
@@ -0,0 +1,18 @@
1
+ import { ConfigManager } from './config.js';
2
+ export declare class Commands {
3
+ private configManager;
4
+ constructor(configManager: ConfigManager);
5
+ list(): void;
6
+ switch(providerId: string): void;
7
+ current(): void;
8
+ configure(providerId: string, apiKey?: string, baseUrl?: string, models?: string[]): void;
9
+ show(providerId: string): void;
10
+ test(providerId: string): Promise<void>;
11
+ models(providerId: string): void;
12
+ setModel(providerId: string, modelName: string): void;
13
+ export(output?: string): void;
14
+ import(file: string): void;
15
+ reset(): void;
16
+ private getProviderDisplayName;
17
+ }
18
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAsD,MAAM,aAAa,CAAC;AAKhG,qBAAa,QAAQ;IACP,OAAO,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAEhD,IAAI,IAAI,IAAI;IAgCZ,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAmBhC,OAAO,IAAI,IAAI;IA8Bf,SAAS,CACP,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,IAAI;IAuDP,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAuCxB,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B7C,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IA6BhC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAwBrD,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAkB7B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAa1B,KAAK,IAAI,IAAI;IASb,OAAO,CAAC,sBAAsB;CAkB/B"}
@@ -0,0 +1,250 @@
1
+ import chalk from 'chalk';
2
+ import fs from 'fs';
3
+ import { createProvider } from './config.js';
4
+ import { testProvider } from './providers.js';
5
+ import { i18n } from './i18n.js';
6
+ export class Commands {
7
+ constructor(configManager) {
8
+ this.configManager = configManager;
9
+ }
10
+ list() {
11
+ console.log(chalk.blue.bold(i18n.cli.list_title()));
12
+ console.log();
13
+ const providers = this.configManager.listProviders();
14
+ const currentProvider = this.configManager.getCurrentProvider();
15
+ for (const provider of providers) {
16
+ const isCurrent = currentProvider?.id === provider.id;
17
+ const status = isCurrent ? chalk.green.bold(i18n.status.active()) : chalk.dim(i18n.status.inactive());
18
+ const providerName = this.getProviderDisplayName(provider.provider_type, true);
19
+ console.log(` ${status} ${chalk.bold(providerName)}`);
20
+ console.log(` ${i18n.general.id_label()}: ${chalk.dim(provider.id)}`);
21
+ if (provider.models.length > 0) {
22
+ const activeModel = provider.current_model || provider.models[0] || 'none';
23
+ console.log(` ${i18n.general.model_label()}: ${provider.models.length} ${provider.models.length === 1 ? 'model' : 'models'} (${chalk.dim(activeModel)})`);
24
+ }
25
+ if (provider.api_key) {
26
+ const maskedKey = provider.api_key.substring(0, 8) + '***';
27
+ console.log(` ${i18n.general.api_key_label()}: ${chalk.dim(maskedKey)}`);
28
+ }
29
+ console.log();
30
+ }
31
+ }
32
+ switch(providerId) {
33
+ const providers = this.configManager.listProviders();
34
+ const provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
35
+ if (!provider) {
36
+ throw new Error(i18n.errors.provider_not_found(providerId));
37
+ }
38
+ console.log(chalk.yellow(i18n.general.switching()));
39
+ this.configManager.switchProvider(provider.id);
40
+ const providerName = this.getProviderDisplayName(provider.provider_type, false);
41
+ console.log(chalk.green.bold(i18n.cli.switch_success(providerName)));
42
+ console.log(chalk.dim(i18n.cli.restart_note()));
43
+ }
44
+ current() {
45
+ const currentProvider = this.configManager.getCurrentProvider();
46
+ if (!currentProvider) {
47
+ console.log(chalk.yellow(i18n.cli.no_active_provider()));
48
+ return;
49
+ }
50
+ console.log(chalk.blue.bold(i18n.cli.current_title()));
51
+ console.log();
52
+ const providerName = this.getProviderDisplayName(currentProvider.provider_type, true);
53
+ console.log(` ${chalk.bold(providerName)}`);
54
+ console.log(` ${i18n.general.id_label()}: ${chalk.dim(currentProvider.id)}`);
55
+ console.log(` ${i18n.general.type_label()}: ${chalk.dim(currentProvider.provider_type)}`);
56
+ if (currentProvider.current_model) {
57
+ console.log(` ${i18n.general.model_label()}: ${chalk.dim(currentProvider.current_model)}`);
58
+ }
59
+ if (currentProvider.base_url) {
60
+ console.log(` ${i18n.general.base_url_label()}: ${chalk.dim(currentProvider.base_url)}`);
61
+ }
62
+ if (currentProvider.api_key) {
63
+ const maskedKey = currentProvider.api_key.substring(0, 8) + '***';
64
+ console.log(` ${i18n.general.api_key_label()}: ${chalk.dim(maskedKey)}`);
65
+ }
66
+ }
67
+ configure(providerId, apiKey, baseUrl, models) {
68
+ const providers = this.configManager.listProviders();
69
+ let provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
70
+ if (!provider) {
71
+ const providerTypeMap = {
72
+ zhipu: ['zhipu', i18n.providers.get_display_name('zhipu')],
73
+ '智谱': ['zhipu', i18n.providers.get_display_name('zhipu')],
74
+ minimax: ['minimax', i18n.providers.get_display_name('minimax')],
75
+ kimi: ['kimi', i18n.providers.get_display_name('kimi')],
76
+ claude: ['claude', i18n.providers.get_display_name('claude')],
77
+ zenmux: ['zenmux', i18n.providers.get_display_name('zenmux')],
78
+ };
79
+ const [providerType, providerName] = providerTypeMap[providerId] || [null, null];
80
+ if (!providerType) {
81
+ throw new Error(i18n.errors.unknown_provider(providerId));
82
+ }
83
+ provider = createProvider(providerType, providerName, apiKey, baseUrl, models);
84
+ }
85
+ else {
86
+ if (apiKey)
87
+ provider.api_key = apiKey;
88
+ if (baseUrl)
89
+ provider.base_url = baseUrl;
90
+ if (models && models.length > 0) {
91
+ for (const model of models) {
92
+ if (!provider.models.includes(model)) {
93
+ provider.models.push(model);
94
+ }
95
+ }
96
+ }
97
+ provider.updated_at = new Date().toISOString();
98
+ }
99
+ this.configManager.saveProvider(provider);
100
+ const providerName = this.getProviderDisplayName(provider.provider_type, false);
101
+ console.log(chalk.green.bold(i18n.cli.configure_success(providerName)));
102
+ if (provider.api_key) {
103
+ const maskedKey = provider.api_key.substring(0, 8) + '***';
104
+ console.log(` ${i18n.general.api_key_label()}: ${chalk.dim(maskedKey)}`);
105
+ }
106
+ if (provider.base_url) {
107
+ console.log(` ${i18n.general.base_url_label()}: ${provider.base_url}`);
108
+ }
109
+ if (provider.models.length > 0) {
110
+ console.log(` ${i18n.general.model_label()}: ${provider.models.join(', ')}`);
111
+ }
112
+ }
113
+ show(providerId) {
114
+ const providers = this.configManager.listProviders();
115
+ const provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
116
+ if (!provider) {
117
+ throw new Error(i18n.errors.provider_not_found(providerId));
118
+ }
119
+ const providerName = this.getProviderDisplayName(provider.provider_type, false);
120
+ console.log(chalk.blue.bold(i18n.cli.show_config_title(providerName)));
121
+ console.log();
122
+ console.log(` ${i18n.general.id_label()}: ${provider.id}`);
123
+ console.log(` ${i18n.general.name_label()}: ${provider.name}`);
124
+ console.log(` ${i18n.general.type_label()}: ${provider.provider_type}`);
125
+ console.log(` ${i18n.general.created_label()}: ${new Date(provider.created_at).toLocaleString()}`);
126
+ console.log(` ${i18n.general.updated_label()}: ${new Date(provider.updated_at).toLocaleString()}`);
127
+ if (provider.api_key) {
128
+ const maskedKey = provider.api_key.substring(0, 8) + '***';
129
+ console.log(` ${i18n.general.api_key_label()}: ${maskedKey}`);
130
+ }
131
+ else {
132
+ console.log(` ${i18n.general.api_key_label()}: ${chalk.red(i18n.status.not_configured())}`);
133
+ }
134
+ if (provider.base_url) {
135
+ console.log(` ${i18n.general.base_url_label()}: ${provider.base_url}`);
136
+ }
137
+ if (provider.models.length > 0) {
138
+ console.log(` ${i18n.general.model_label()}: ${provider.models.join(', ')}`);
139
+ if (provider.current_model) {
140
+ console.log(` ${chalk.dim(`Active: ${provider.current_model}`)}`);
141
+ }
142
+ }
143
+ }
144
+ async test(providerId) {
145
+ const providers = this.configManager.listProviders();
146
+ const provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
147
+ if (!provider) {
148
+ throw new Error(i18n.errors.provider_not_found(providerId));
149
+ }
150
+ console.log(chalk.yellow(i18n.cli.test_connection(provider.name)));
151
+ if (!provider.api_key) {
152
+ throw new Error(i18n.errors.provider_not_configured());
153
+ }
154
+ const result = await testProvider(provider);
155
+ if (result.success) {
156
+ console.log(chalk.green(`✓ ${result.message}`));
157
+ if (result.model_info) {
158
+ console.log(` Model: ${result.model_info.model_name}`);
159
+ console.log(` Provider: ${result.model_info.provider_name}`);
160
+ console.log(` Response time: ${result.response_time_ms}ms`);
161
+ }
162
+ }
163
+ else {
164
+ console.log(chalk.red(`✗ ${result.message}`));
165
+ }
166
+ }
167
+ models(providerId) {
168
+ const providers = this.configManager.listProviders();
169
+ const provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
170
+ if (!provider) {
171
+ throw new Error(i18n.errors.provider_not_found(providerId));
172
+ }
173
+ console.log(chalk.blue.bold(`${i18n.general.model_label()} (${provider.models.length} models)`));
174
+ console.log();
175
+ if (provider.models.length === 0) {
176
+ console.log(` ${chalk.dim('No models configured')}`);
177
+ return;
178
+ }
179
+ const activeModel = provider.current_model || provider.models[0];
180
+ for (const model of provider.models) {
181
+ const isActive = model === activeModel;
182
+ const marker = isActive ? '✓' : ' ';
183
+ const display = isActive ? chalk.green.bold(model) : model;
184
+ console.log(` ${marker} ${display}`);
185
+ }
186
+ console.log();
187
+ }
188
+ setModel(providerId, modelName) {
189
+ const providers = this.configManager.listProviders();
190
+ const provider = providers.find((p) => p.id === providerId || p.name === providerId || p.provider_type === providerId);
191
+ if (!provider) {
192
+ throw new Error(i18n.errors.provider_not_found(providerId));
193
+ }
194
+ if (!provider.models.includes(modelName)) {
195
+ throw new Error(`Model '${modelName}' not found in provider`);
196
+ }
197
+ provider.current_model = modelName;
198
+ provider.updated_at = new Date().toISOString();
199
+ this.configManager.saveProvider(provider);
200
+ const providerName = this.getProviderDisplayName(provider.provider_type, false);
201
+ console.log(`${chalk.green(i18n.cli.switch_success(providerName))} ${chalk.dim('model set to')} ${chalk.bold(modelName)}`);
202
+ }
203
+ export(output) {
204
+ const config = this.configManager.exportConfig();
205
+ const exportData = {
206
+ ...config,
207
+ exported_at: new Date().toISOString(),
208
+ };
209
+ const jsonStr = JSON.stringify(exportData, null, 2);
210
+ if (output) {
211
+ fs.writeFileSync(output, jsonStr);
212
+ console.log(chalk.green.bold(i18n.cli.export_success(output)));
213
+ }
214
+ else {
215
+ console.log(chalk.blue.bold(i18n.general.configuration_label()));
216
+ console.log(jsonStr);
217
+ }
218
+ }
219
+ import(file) {
220
+ if (!fs.existsSync(file)) {
221
+ throw new Error(`File '${file}' not found`);
222
+ }
223
+ const content = fs.readFileSync(file, 'utf-8');
224
+ const importData = JSON.parse(content);
225
+ this.configManager.importConfig(importData);
226
+ console.log(chalk.green.bold(i18n.cli.import_success(file)));
227
+ }
228
+ reset() {
229
+ console.log(chalk.yellow(i18n.general.resetting()));
230
+ this.configManager.resetToClaudeDefault();
231
+ console.log(chalk.green(i18n.cli.reset_success()));
232
+ console.log(chalk.dim(i18n.cli.restart_note()));
233
+ }
234
+ getProviderDisplayName(providerType, withColor) {
235
+ const displayName = i18n.providers.get_display_name(providerType);
236
+ if (!withColor) {
237
+ return displayName;
238
+ }
239
+ const colorMap = {
240
+ zhipu: (s) => chalk.yellow(s),
241
+ minimax: (s) => chalk.cyan(s),
242
+ kimi: (s) => chalk.magenta(s),
243
+ claude: (s) => chalk.white(s),
244
+ zenmux: (s) => chalk.blue(s),
245
+ };
246
+ const colorFn = colorMap[providerType] || ((s) => s);
247
+ return colorFn(displayName);
248
+ }
249
+ }
250
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAiB,cAAc,EAAsC,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,OAAO,QAAQ;IACnB,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,IAAI;QACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;QACrD,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa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AAsB,CAAC,YAAoB,EAAE,SAAkB;QACrE,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAElE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,MAAM,QAAQ,GAA4C;YACxD,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7B,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC7B,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7B,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;SAC7B,CAAC;QAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ import { ModelProvider, CCKitConfig } from './types.js';
2
+ export declare class ConfigManager {
3
+ private configDir;
4
+ private configFile;
5
+ private claudeSettingsFile;
6
+ constructor();
7
+ initialize(): void;
8
+ private loadConfig;
9
+ private saveConfig;
10
+ listProviders(): ModelProvider[];
11
+ saveProvider(provider: ModelProvider): void;
12
+ getCurrentProvider(): ModelProvider | undefined;
13
+ switchProvider(providerId: string): void;
14
+ private applyProviderToClaudeSettings;
15
+ resetToClaudeDefault(): void;
16
+ exportConfig(): CCKitConfig;
17
+ importConfig(importedConfig: CCKitConfig): void;
18
+ }
19
+ export declare function getDefaultBaseUrl(providerType: string): string | undefined;
20
+ export declare function getDefaultModel(providerType: string): string | undefined;
21
+ export declare function createProvider(providerType: string, providerName: string, apiKey?: string, baseUrl?: string, models?: string[]): ModelProvider;
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkB,MAAM,YAAY,CAAC;AAiBxE,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,kBAAkB,CAAS;;IASnC,UAAU,IAAI,IAAI;IAgBlB,OAAO,CAAC,UAAU;IAuBlB,OAAO,CAAC,UAAU;IAKlB,aAAa,IAAI,aAAa,EAAE;IAKhC,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAa3C,kBAAkB,IAAI,aAAa,GAAG,SAAS;IAQ/C,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAaxC,OAAO,CAAC,6BAA6B;IAmErC,oBAAoB,IAAI,IAAI;IAmB5B,YAAY,IAAI,WAAW;IAI3B,YAAY,CAAC,cAAc,EAAE,WAAW,GAAG,IAAI;CAUhD;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,aAAa,CAcf"}