ccman 1.0.1 → 2.0.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/.github/workflows/release.yml +5 -5
- package/CLAUDE.md +246 -185
- package/README.md +282 -249
- package/README_zh.md +283 -250
- package/dev-test.sh +40 -0
- package/dist/cli.js +421 -369
- package/dist/cli.js.map +1 -1
- package/dist/commands/lang.d.ts +3 -0
- package/dist/commands/lang.d.ts.map +1 -0
- package/dist/commands/lang.js +99 -0
- package/dist/commands/lang.js.map +1 -0
- package/dist/core/CCMConfigManager.d.ts +52 -0
- package/dist/core/CCMConfigManager.d.ts.map +1 -0
- package/dist/core/CCMConfigManager.js +203 -0
- package/dist/core/CCMConfigManager.js.map +1 -0
- package/dist/core/ClaudeConfigManager.d.ts +35 -0
- package/dist/core/ClaudeConfigManager.d.ts.map +1 -0
- package/dist/core/ClaudeConfigManager.js +151 -0
- package/dist/core/ClaudeConfigManager.js.map +1 -0
- package/dist/i18n/LanguageManager.d.ts +43 -0
- package/dist/i18n/LanguageManager.d.ts.map +1 -0
- package/dist/i18n/LanguageManager.js +157 -0
- package/dist/i18n/LanguageManager.js.map +1 -0
- package/dist/i18n/messages.d.ts +65 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +144 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -8
- package/dist/index.js.map +1 -1
- package/dist/providers/ProviderManager.d.ts +55 -0
- package/dist/providers/ProviderManager.d.ts.map +1 -0
- package/dist/providers/ProviderManager.js +326 -0
- package/dist/providers/ProviderManager.js.map +1 -0
- package/dist/types/index.d.ts +78 -38
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/version.d.ts +2 -64
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +12 -158
- package/dist/utils/version.js.map +1 -1
- package/package.json +2 -2
- package/release-temp/README.md +282 -249
- package/release-temp/package.json +2 -2
- package/scripts/modules/create-tag.sh +53 -10
- package/scripts/modules/monitor-release.sh +40 -12
- package/scripts/modules/version-bump.sh +14 -17
- package/scripts/smart-release-v3.sh +20 -26
- package/src/cli.ts +458 -394
- package/src/commands/lang.ts +105 -0
- package/src/core/CCMConfigManager.ts +185 -0
- package/src/core/ClaudeConfigManager.ts +127 -0
- package/src/i18n/LanguageManager.ts +169 -0
- package/src/i18n/messages.ts +233 -0
- package/src/index.ts +4 -5
- package/src/providers/ProviderManager.ts +380 -0
- package/src/types/index.ts +80 -39
- package/src/utils/version.ts +11 -184
- package/dist/config/ConfigManager.d.ts +0 -67
- package/dist/config/ConfigManager.d.ts.map +0 -1
- package/dist/config/ConfigManager.js +0 -226
- package/dist/config/ConfigManager.js.map +0 -1
- package/dist/config/EnvironmentManager.d.ts +0 -83
- package/dist/config/EnvironmentManager.d.ts.map +0 -1
- package/dist/config/EnvironmentManager.js +0 -280
- package/dist/config/EnvironmentManager.js.map +0 -1
- package/dist/config/constants.d.ts +0 -40
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js +0 -97
- package/dist/config/constants.js.map +0 -1
- package/dist/shell/ShellManager.d.ts +0 -81
- package/dist/shell/ShellManager.d.ts.map +0 -1
- package/dist/shell/ShellManager.js +0 -490
- package/dist/shell/ShellManager.js.map +0 -1
- package/src/config/ConfigManager.ts +0 -227
- package/src/config/EnvironmentManager.ts +0 -327
- package/src/config/constants.ts +0 -64
- package/src/shell/ShellManager.ts +0 -526
package/release-temp/README.md
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
# CCM - Claude Code Manager
|
|
1
|
+
# CCM - Claude Code Manager v2.0
|
|
2
2
|
|
|
3
|
-
A TypeScript-based command-line tool to manage Claude Code API configurations with **
|
|
3
|
+
A TypeScript-based command-line tool to manage multiple Claude Code API provider configurations with **direct settings.json integration** and **intelligent language support**.
|
|
4
4
|
|
|
5
5
|
> **English Documentation** | [中文文档](./README_zh.md)
|
|
6
6
|
|
|
7
|
-
## ✨
|
|
7
|
+
## ✨ New in v2.0
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
✅ **Multi-Shell Support** - Works with bash, zsh, and fish
|
|
15
|
-
✅ **Complete Workflow** - From setup to usage in one seamless flow
|
|
9
|
+
🌍 **Intelligent Language Support** - Auto-detects system language or guides first-run setup
|
|
10
|
+
🔧 **Direct Claude Integration** - Modifies `~/.claude/settings.json` directly, no shell variables
|
|
11
|
+
📁 **Provider Management** - Store and switch between multiple API provider configurations
|
|
12
|
+
🎯 **Interactive Menu System** - Continuous operation support with navigation options
|
|
13
|
+
⚡ **Zero-Config Experience** - Works out of the box with smart defaults
|
|
16
14
|
|
|
17
15
|
## 🚀 Quick Start
|
|
18
16
|
|
|
@@ -26,307 +24,347 @@ npm install -g ccman
|
|
|
26
24
|
npm install && npm run build
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
###
|
|
27
|
+
### First Run Experience
|
|
30
28
|
|
|
31
29
|
```bash
|
|
32
|
-
#
|
|
33
|
-
ccman
|
|
30
|
+
# Start CCM (first time)
|
|
31
|
+
ccman
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
ccman add default https://api.anthropic.com your-api-key
|
|
33
|
+
🌍 Welcome to CCM! / 欢迎使用 CCM!
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
This is your first time running CCM.
|
|
36
|
+
这是您首次运行 CCM。
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
? Please choose your preferred language:
|
|
39
|
+
? 请选择您偏好的语言:
|
|
40
|
+
❯ 🇨🇳 中文 (Chinese)
|
|
41
|
+
🇺🇸 English
|
|
42
|
+
🌐 Auto-detect based on system
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
ccman
|
|
44
|
+
✓ Language set to Chinese
|
|
45
|
+
✓ You can change this later with: ccman lang set <zh|en|auto>
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
### Basic Usage
|
|
49
49
|
|
|
50
|
-
### Core Environment Management
|
|
51
50
|
```bash
|
|
52
|
-
|
|
53
|
-
ccman
|
|
54
|
-
ccman use <name> # Switch environment with source interaction
|
|
55
|
-
ccman list|ls # List all environments (* = current)
|
|
56
|
-
ccman current # Show current environment details
|
|
57
|
-
ccman clear|clearall # Clear ALL environments and shell integration (DESTRUCTIVE)
|
|
58
|
-
```
|
|
51
|
+
# Interactive main menu (recommended)
|
|
52
|
+
ccman
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
# List all providers
|
|
55
|
+
ccman ls
|
|
56
|
+
|
|
57
|
+
# Add provider directly
|
|
58
|
+
ccman add <id> <name> <baseUrl> [apiKey]
|
|
59
|
+
|
|
60
|
+
# Switch provider
|
|
61
|
+
ccman use <id>
|
|
62
|
+
|
|
63
|
+
# Remove provider
|
|
64
|
+
ccman rm <id>
|
|
66
65
|
```
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
## 🌐 Language Management
|
|
68
|
+
|
|
69
|
+
### Language Commands
|
|
69
70
|
```bash
|
|
70
|
-
ccman
|
|
71
|
-
ccman
|
|
72
|
-
ccman
|
|
71
|
+
ccman lang # Show current language setting
|
|
72
|
+
ccman lang set zh # Set to Chinese
|
|
73
|
+
ccman lang set en # Set to English
|
|
74
|
+
ccman lang set auto # Auto-detect based on system
|
|
75
|
+
ccman lang reset # Reset to first-run state
|
|
73
76
|
```
|
|
74
77
|
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
ccman use <name> --no-auto-write
|
|
78
|
+
### Supported Languages
|
|
79
|
+
- **Chinese (zh)** - 完整中文界面
|
|
80
|
+
- **English (en)** - Full English interface
|
|
81
|
+
- **Auto-detect** - Based on system `LANG` environment variable
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
### Language Detection Logic
|
|
84
|
+
- English environments (`en-*`) → English interface
|
|
85
|
+
- Other environments (including `zh-*`, unset) → Chinese interface
|
|
86
|
+
- Manual override available anytime
|
|
84
87
|
|
|
85
|
-
##
|
|
88
|
+
## 📖 Commands Reference
|
|
86
89
|
|
|
87
|
-
###
|
|
90
|
+
### Core Provider Management
|
|
91
|
+
```bash
|
|
92
|
+
ccman # Interactive menu (default)
|
|
93
|
+
ccman add <id> <name> <url> [key] # Add new provider
|
|
94
|
+
ccman use <id> # Switch to provider
|
|
95
|
+
ccman ls # List all providers
|
|
96
|
+
ccman ls --current # Show current provider details
|
|
97
|
+
ccman ls --brief # Brief provider list
|
|
98
|
+
ccman rm <id> # Remove provider
|
|
99
|
+
ccman clear # Remove ALL providers (destructive)
|
|
100
|
+
```
|
|
88
101
|
|
|
102
|
+
### Language Management
|
|
89
103
|
```bash
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Base URL: https://api.example.com
|
|
94
|
-
Created: 2025-08-06 11:45:30
|
|
95
|
-
|
|
96
|
-
? Set "myenv" as current environment? Yes
|
|
97
|
-
✓ Environment variables written to /home/user/.ccman/.ccmanrc
|
|
98
|
-
|
|
99
|
-
? How would you like to apply the environment variables?
|
|
100
|
-
❯ Manual - I will restart terminal or source manually (Recommended)
|
|
101
|
-
Auto-source - Try to source automatically (May not work in all environments)
|
|
102
|
-
|
|
103
|
-
> Manual
|
|
104
|
-
To apply changes, restart your terminal or run:
|
|
105
|
-
source ~/.bashrc (or ~/.zshrc)
|
|
104
|
+
ccman lang # Show current language
|
|
105
|
+
ccman lang set <zh|en|auto> # Set language preference
|
|
106
|
+
ccman lang reset # Reset to first-run state
|
|
106
107
|
```
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
## 🎯 Interactive Experience
|
|
109
110
|
|
|
111
|
+
### Main Menu Navigation
|
|
110
112
|
```bash
|
|
111
|
-
$ ccman
|
|
113
|
+
$ ccman
|
|
114
|
+
|
|
112
115
|
? What would you like to do?
|
|
113
|
-
❯ Switch
|
|
114
|
-
Add new
|
|
115
|
-
|
|
116
|
-
Remove
|
|
117
|
-
Show
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
?
|
|
122
|
-
? API Key: ****************
|
|
123
|
-
✓ Added environment "staging"
|
|
116
|
+
❯ Switch provider
|
|
117
|
+
Add new provider
|
|
118
|
+
Update provider
|
|
119
|
+
Remove provider
|
|
120
|
+
Show detailed status
|
|
121
|
+
Exit
|
|
122
|
+
|
|
123
|
+
# After each operation:
|
|
124
|
+
? Would you like to perform another operation? (Y/n)
|
|
124
125
|
```
|
|
125
126
|
|
|
126
|
-
###
|
|
127
|
-
|
|
127
|
+
### Provider Addition Flow
|
|
128
128
|
```bash
|
|
129
|
-
$ ccman
|
|
130
|
-
✓ Switched to environment "production"
|
|
131
|
-
Base URL: https://api.anthropic.com
|
|
132
|
-
✓ Environment variables written to /home/user/.ccman/.ccmanrc
|
|
133
|
-
|
|
134
|
-
? How would you like to apply the environment variables?
|
|
135
|
-
Manual - I will restart terminal or source manually (Recommended)
|
|
136
|
-
❯ Auto-source - Try to source automatically (May not work in all environments)
|
|
137
|
-
|
|
138
|
-
> Auto-source
|
|
139
|
-
⚠️ Attempting auto-source - this may not work in all terminal environments
|
|
140
|
-
✓ Shell configuration sourced successfully
|
|
141
|
-
```
|
|
129
|
+
$ ccman add
|
|
142
130
|
|
|
143
|
-
|
|
131
|
+
? Provider ID: my-provider
|
|
132
|
+
? Provider name: My Custom API
|
|
133
|
+
? Description: My custom Claude API
|
|
134
|
+
? Base URL: https://api.mycustom.com
|
|
135
|
+
? API Key: ****************
|
|
136
|
+
|
|
137
|
+
✓ Provider added successfully
|
|
138
|
+
? Set "My Custom API" as current provider? (Y/n)
|
|
139
|
+
✓ Provider switched successfully
|
|
140
|
+
Claude Code configuration has been updated successfully!
|
|
141
|
+
```
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
## 🔧 Architecture Overview
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
### Direct Claude Integration
|
|
146
|
+
CCM v2.0 directly modifies your Claude Code settings file:
|
|
148
147
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
**Before (CCM manages)**:
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"env": {
|
|
152
|
+
"ANTHROPIC_AUTH_TOKEN": "old-token",
|
|
153
|
+
"ANTHROPIC_BASE_URL": "https://old-api.com"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
158
157
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
**After (CCM updates)**:
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"env": {
|
|
162
|
+
"ANTHROPIC_AUTH_TOKEN": "new-token",
|
|
163
|
+
"ANTHROPIC_BASE_URL": "https://new-api.com",
|
|
164
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
|
|
165
|
+
},
|
|
166
|
+
"permissions": {
|
|
167
|
+
"allow": [],
|
|
168
|
+
"deny": []
|
|
169
|
+
},
|
|
170
|
+
"apiKeyHelper": "echo 'new-token'"
|
|
171
|
+
}
|
|
172
|
+
```
|
|
165
173
|
|
|
166
|
-
###
|
|
167
|
-
|
|
168
|
-
- ✅ **Safe**: User's existing shell config remains untouched
|
|
169
|
-
- ✅ **Clean**: Easy to remove completely
|
|
170
|
-
- ✅ **Isolated**: All CCM variables in separate file
|
|
174
|
+
### Provider Storage Structure
|
|
175
|
+
Providers are stored in `~/.ccman/providers/`:
|
|
171
176
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
```
|
|
178
|
+
~/.ccman/
|
|
179
|
+
├── config.json # Main CCM configuration
|
|
180
|
+
├── providers/ # Individual provider configs
|
|
181
|
+
│ ├── anthropic.json
|
|
182
|
+
│ ├── my-provider.json
|
|
183
|
+
│ └── staging.json
|
|
184
|
+
```
|
|
175
185
|
|
|
176
|
-
|
|
186
|
+
### Configuration Merging
|
|
187
|
+
CCM only updates Claude-specific keys, preserving your existing settings:
|
|
188
|
+
- ✅ Preserves: `mcpServers`, `model`, `customUserConfig`, etc.
|
|
189
|
+
- 🔄 Updates: `env.ANTHROPIC_*`, `permissions`, `apiKeyHelper`
|
|
177
190
|
|
|
178
|
-
|
|
191
|
+
## 📊 Provider Configuration
|
|
179
192
|
|
|
193
|
+
### Provider Structure
|
|
180
194
|
```json
|
|
181
195
|
{
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"lastUsed": "2025-08-06T03:50:15.000Z"
|
|
196
|
+
"name": "Anthropic Official",
|
|
197
|
+
"description": "Official Anthropic API Configuration",
|
|
198
|
+
"config": {
|
|
199
|
+
"env": {
|
|
200
|
+
"ANTHROPIC_AUTH_TOKEN": "your-token",
|
|
201
|
+
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
|
|
202
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
|
|
190
203
|
},
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
204
|
+
"permissions": { "allow": [], "deny": [] },
|
|
205
|
+
"apiKeyHelper": "echo 'your-token'"
|
|
206
|
+
},
|
|
207
|
+
"metadata": {
|
|
208
|
+
"createdAt": "2025-01-15T10:30:00.000Z",
|
|
209
|
+
"updatedAt": "2025-01-15T10:30:00.000Z",
|
|
210
|
+
"usageCount": 5
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Main Configuration
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"currentProvider": "anthropic",
|
|
219
|
+
"claudeConfigPath": "/Users/user/.claude/settings.json",
|
|
220
|
+
"providers": {
|
|
221
|
+
"anthropic": {
|
|
222
|
+
"name": "Anthropic Official",
|
|
223
|
+
"configFile": "anthropic.json",
|
|
224
|
+
"lastUsed": "2025-01-15T10:30:00.000Z"
|
|
196
225
|
}
|
|
197
226
|
},
|
|
198
227
|
"settings": {
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
|
|
228
|
+
"language": "zh",
|
|
229
|
+
"firstRun": false
|
|
230
|
+
},
|
|
231
|
+
"metadata": {
|
|
232
|
+
"version": "2.0.0",
|
|
233
|
+
"createdAt": "2025-01-15T10:00:00.000Z",
|
|
234
|
+
"updatedAt": "2025-01-15T10:30:00.000Z"
|
|
202
235
|
}
|
|
203
236
|
}
|
|
204
237
|
```
|
|
205
238
|
|
|
206
239
|
## 💡 Usage Examples
|
|
207
240
|
|
|
208
|
-
### Complete Setup
|
|
241
|
+
### Complete First-Time Setup
|
|
209
242
|
```bash
|
|
210
|
-
#
|
|
211
|
-
ccman
|
|
212
|
-
# →
|
|
213
|
-
# →
|
|
214
|
-
# →
|
|
215
|
-
|
|
216
|
-
# Add
|
|
217
|
-
ccman add staging https://staging.
|
|
218
|
-
ccman add dev https://dev.
|
|
219
|
-
|
|
220
|
-
# Switch
|
|
243
|
+
# First run - language selection
|
|
244
|
+
ccman
|
|
245
|
+
# → Language selection wizard
|
|
246
|
+
# → No providers found, guided creation
|
|
247
|
+
# → Automatic Claude settings update
|
|
248
|
+
|
|
249
|
+
# Add additional providers
|
|
250
|
+
ccman add staging "Staging API" https://staging-api.com
|
|
251
|
+
ccman add dev "Development" https://dev-api.com
|
|
252
|
+
|
|
253
|
+
# Switch between providers
|
|
254
|
+
ccman use staging
|
|
221
255
|
ccman use dev
|
|
222
|
-
|
|
223
|
-
# → Asks about sourcing method
|
|
224
|
-
# → Provides clear instructions
|
|
225
|
-
|
|
226
|
-
# Check status
|
|
227
|
-
ccman status
|
|
228
|
-
# CCM Status:
|
|
229
|
-
# Total environments: 3
|
|
230
|
-
# Current environment: dev
|
|
231
|
-
# Shell integration: Enabled
|
|
256
|
+
ccman use anthropic
|
|
232
257
|
```
|
|
233
258
|
|
|
234
|
-
###
|
|
259
|
+
### Multi-Provider Workflow
|
|
235
260
|
```bash
|
|
236
|
-
#
|
|
237
|
-
ccman
|
|
238
|
-
|
|
239
|
-
|
|
261
|
+
# List all providers with details
|
|
262
|
+
ccman ls
|
|
263
|
+
# * Anthropic Official (anthropic) - https://api.anthropic.com
|
|
264
|
+
# Staging API (staging) - https://staging-api.com
|
|
265
|
+
# Development (dev) - https://dev-api.com
|
|
266
|
+
|
|
267
|
+
# Switch to staging for testing
|
|
268
|
+
ccman use staging
|
|
269
|
+
# ✓ Provider switched successfully
|
|
270
|
+
# ✓ Claude Code configuration has been updated successfully!
|
|
271
|
+
|
|
272
|
+
# Check current provider
|
|
273
|
+
ccman ls --current
|
|
274
|
+
# Current provider: Staging API (staging)
|
|
275
|
+
# Base URL: https://staging-api.com
|
|
276
|
+
# Usage count: 3 times
|
|
277
|
+
# Last updated: 2025-01-15 10:30:15
|
|
240
278
|
```
|
|
241
279
|
|
|
242
|
-
###
|
|
280
|
+
### Language Switching
|
|
243
281
|
```bash
|
|
244
|
-
#
|
|
245
|
-
ccman
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
#
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
#
|
|
254
|
-
ccman
|
|
282
|
+
# Check current language
|
|
283
|
+
ccman lang
|
|
284
|
+
# Current language: 中文 (Chinese)
|
|
285
|
+
|
|
286
|
+
# Switch to English
|
|
287
|
+
ccman lang set en
|
|
288
|
+
# ✓ Language switched successfully
|
|
289
|
+
# Current language: English
|
|
290
|
+
|
|
291
|
+
# Set auto-detect
|
|
292
|
+
ccman lang set auto
|
|
293
|
+
# ✓ Language switched successfully
|
|
294
|
+
# Current language: Auto-detect
|
|
295
|
+
# Auto-detected: English
|
|
255
296
|
```
|
|
256
297
|
|
|
257
|
-
##
|
|
298
|
+
## 🛠️ Development Setup
|
|
299
|
+
|
|
300
|
+
### Development Environment
|
|
301
|
+
CCM supports isolated development environments:
|
|
258
302
|
|
|
259
303
|
```bash
|
|
260
|
-
#
|
|
304
|
+
# Set development paths
|
|
305
|
+
export CCM_CONFIG_DIR=".ccman-dev"
|
|
306
|
+
export CLAUDE_CONFIG_PATH="$HOME/.claude/settings-dev.json"
|
|
307
|
+
|
|
308
|
+
# Use development mode
|
|
261
309
|
npm run dev
|
|
262
310
|
|
|
263
|
-
# Build
|
|
311
|
+
# Build for production
|
|
264
312
|
npm run build
|
|
265
313
|
|
|
266
|
-
#
|
|
267
|
-
npm run clean
|
|
268
|
-
|
|
269
|
-
# Start built CLI
|
|
314
|
+
# Test built version
|
|
270
315
|
npm start
|
|
271
316
|
```
|
|
272
317
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
### Global Options
|
|
276
|
-
All commands support standard CLI conventions:
|
|
277
|
-
- `-h, --help` - Show command help
|
|
278
|
-
- `-V, --version` - Show version
|
|
279
|
-
|
|
280
|
-
### Add Command Options
|
|
318
|
+
### Development Commands
|
|
281
319
|
```bash
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
### Use Command Options
|
|
289
|
-
```bash
|
|
290
|
-
ccman use <name> [options]
|
|
291
|
-
|
|
292
|
-
Options:
|
|
293
|
-
--no-auto-write Do not automatically write to shell config
|
|
294
|
-
--auto-source Automatically source shell config (risky)
|
|
320
|
+
npm run dev # Development mode with tsx
|
|
321
|
+
npm run build # TypeScript compilation
|
|
322
|
+
npm run start # Run built CLI
|
|
323
|
+
npm run clean # Remove dist/ directory
|
|
324
|
+
npm run lint # ESLint TypeScript files
|
|
325
|
+
npm test # Run tests (passWithNoTests)
|
|
295
326
|
```
|
|
296
327
|
|
|
297
328
|
## 🔍 Troubleshooting
|
|
298
329
|
|
|
299
|
-
###
|
|
330
|
+
### Provider Issues
|
|
300
331
|
```bash
|
|
301
|
-
#
|
|
302
|
-
ls
|
|
303
|
-
|
|
304
|
-
# Check shell reference
|
|
305
|
-
grep "ccman" ~/.bashrc ~/.zshrc
|
|
332
|
+
# Provider not working?
|
|
333
|
+
ccman ls --current # Check current provider details
|
|
334
|
+
ccman use <provider-id> # Re-apply provider configuration
|
|
306
335
|
|
|
307
|
-
#
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
# Or regenerate
|
|
311
|
-
ccman use <current-env>
|
|
336
|
+
# Settings not applied?
|
|
337
|
+
# Check ~/.claude/settings.json for updates
|
|
338
|
+
cat ~/.claude/settings.json | grep ANTHROPIC
|
|
312
339
|
```
|
|
313
340
|
|
|
314
|
-
###
|
|
341
|
+
### Language Issues
|
|
315
342
|
```bash
|
|
316
|
-
#
|
|
317
|
-
ccman
|
|
343
|
+
# Language not switching?
|
|
344
|
+
ccman lang # Check current setting
|
|
345
|
+
ccman lang set zh # Force Chinese
|
|
346
|
+
ccman lang set en # Force English
|
|
347
|
+
|
|
348
|
+
# First-run issues?
|
|
349
|
+
ccman lang reset # Reset to first-run state
|
|
350
|
+
ccman # Restart for language selection
|
|
351
|
+
```
|
|
318
352
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
353
|
+
### Configuration Issues
|
|
354
|
+
```bash
|
|
355
|
+
# Corrupt configuration?
|
|
356
|
+
ccman clear # Remove all (with confirmation)
|
|
357
|
+
ccman # Fresh start
|
|
358
|
+
|
|
359
|
+
# Development isolation
|
|
360
|
+
export CCM_CONFIG_DIR=".ccman-dev" # Separate dev config
|
|
322
361
|
```
|
|
323
362
|
|
|
324
363
|
## 📋 Requirements
|
|
325
364
|
|
|
326
|
-
- Node.js >= 16.0.0
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
- Operating systems: Linux, macOS, Windows (WSL)
|
|
365
|
+
- **Node.js** >= 16.0.0
|
|
366
|
+
- **Claude Code** installed with settings.json support
|
|
367
|
+
- **Operating Systems**: Linux, macOS, Windows (WSL)
|
|
330
368
|
|
|
331
369
|
## 📄 License
|
|
332
370
|
|
|
@@ -334,28 +372,23 @@ MIT License - see LICENSE file for details.
|
|
|
334
372
|
|
|
335
373
|
---
|
|
336
374
|
|
|
337
|
-
## 🚀
|
|
375
|
+
## 🚀 Migration from v1.x
|
|
338
376
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
→ Source method choice
|
|
356
|
-
→ Clear instructions
|
|
357
|
-
|
|
358
|
-
# 4. Everything just works! ✨
|
|
359
|
-
```
|
|
377
|
+
CCM v2.0 uses a completely different architecture:
|
|
378
|
+
|
|
379
|
+
### v1.x (Shell Integration)
|
|
380
|
+
- Modified shell configuration files
|
|
381
|
+
- Used environment variables
|
|
382
|
+
- Complex shell integration
|
|
383
|
+
|
|
384
|
+
### v2.0 (Direct Integration)
|
|
385
|
+
- Modifies `~/.claude/settings.json` directly
|
|
386
|
+
- Provider-based configuration
|
|
387
|
+
- Language support
|
|
388
|
+
- Simplified, safer approach
|
|
389
|
+
|
|
390
|
+
**Migration**: v1.x and v2.x are incompatible. Start fresh with `ccman clear` if upgrading.
|
|
391
|
+
|
|
392
|
+
---
|
|
360
393
|
|
|
361
|
-
*CCM -
|
|
394
|
+
*CCM v2.0 - Intelligent, multilingual, and seamless Claude Code provider management.*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccman",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Claude Code Manager - A TypeScript tool to manage Claude Code API configurations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"packageManager": "pnpm@
|
|
6
|
+
"packageManager": "pnpm@7.33.7",
|
|
7
7
|
"bin": {
|
|
8
8
|
"ccman": "./dist/cli.js"
|
|
9
9
|
},
|