ccman 0.1.2 → 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.
Files changed (78) hide show
  1. package/.github/workflows/release.yml +5 -5
  2. package/CLAUDE.md +246 -185
  3. package/README.md +282 -249
  4. package/README_zh.md +283 -250
  5. package/dev-test.sh +40 -0
  6. package/dist/cli.js +421 -369
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/lang.d.ts +3 -0
  9. package/dist/commands/lang.d.ts.map +1 -0
  10. package/dist/commands/lang.js +99 -0
  11. package/dist/commands/lang.js.map +1 -0
  12. package/dist/core/CCMConfigManager.d.ts +52 -0
  13. package/dist/core/CCMConfigManager.d.ts.map +1 -0
  14. package/dist/core/CCMConfigManager.js +203 -0
  15. package/dist/core/CCMConfigManager.js.map +1 -0
  16. package/dist/core/ClaudeConfigManager.d.ts +35 -0
  17. package/dist/core/ClaudeConfigManager.d.ts.map +1 -0
  18. package/dist/core/ClaudeConfigManager.js +151 -0
  19. package/dist/core/ClaudeConfigManager.js.map +1 -0
  20. package/dist/i18n/LanguageManager.d.ts +43 -0
  21. package/dist/i18n/LanguageManager.d.ts.map +1 -0
  22. package/dist/i18n/LanguageManager.js +157 -0
  23. package/dist/i18n/LanguageManager.js.map +1 -0
  24. package/dist/i18n/messages.d.ts +65 -0
  25. package/dist/i18n/messages.d.ts.map +1 -0
  26. package/dist/i18n/messages.js +144 -0
  27. package/dist/i18n/messages.js.map +1 -0
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +3 -8
  31. package/dist/index.js.map +1 -1
  32. package/dist/providers/ProviderManager.d.ts +55 -0
  33. package/dist/providers/ProviderManager.d.ts.map +1 -0
  34. package/dist/providers/ProviderManager.js +326 -0
  35. package/dist/providers/ProviderManager.js.map +1 -0
  36. package/dist/types/index.d.ts +78 -38
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/index.js +1 -0
  39. package/dist/types/index.js.map +1 -1
  40. package/dist/utils/version.d.ts +2 -64
  41. package/dist/utils/version.d.ts.map +1 -1
  42. package/dist/utils/version.js +12 -158
  43. package/dist/utils/version.js.map +1 -1
  44. package/package.json +2 -2
  45. package/release-temp/README.md +282 -249
  46. package/release-temp/package.json +2 -2
  47. package/scripts/modules/version-bump.sh +2 -2
  48. package/scripts/smart-release-v3.sh +20 -26
  49. package/src/cli.ts +458 -394
  50. package/src/commands/lang.ts +105 -0
  51. package/src/core/CCMConfigManager.ts +185 -0
  52. package/src/core/ClaudeConfigManager.ts +127 -0
  53. package/src/i18n/LanguageManager.ts +169 -0
  54. package/src/i18n/messages.ts +233 -0
  55. package/src/index.ts +4 -5
  56. package/src/providers/ProviderManager.ts +380 -0
  57. package/src/types/index.ts +80 -39
  58. package/src/utils/version.ts +11 -184
  59. package/dist/config/ConfigManager.d.ts +0 -67
  60. package/dist/config/ConfigManager.d.ts.map +0 -1
  61. package/dist/config/ConfigManager.js +0 -226
  62. package/dist/config/ConfigManager.js.map +0 -1
  63. package/dist/config/EnvironmentManager.d.ts +0 -83
  64. package/dist/config/EnvironmentManager.d.ts.map +0 -1
  65. package/dist/config/EnvironmentManager.js +0 -280
  66. package/dist/config/EnvironmentManager.js.map +0 -1
  67. package/dist/config/constants.d.ts +0 -40
  68. package/dist/config/constants.d.ts.map +0 -1
  69. package/dist/config/constants.js +0 -97
  70. package/dist/config/constants.js.map +0 -1
  71. package/dist/shell/ShellManager.d.ts +0 -81
  72. package/dist/shell/ShellManager.d.ts.map +0 -1
  73. package/dist/shell/ShellManager.js +0 -490
  74. package/dist/shell/ShellManager.js.map +0 -1
  75. package/src/config/ConfigManager.ts +0 -227
  76. package/src/config/EnvironmentManager.ts +0 -327
  77. package/src/config/constants.ts +0 -64
  78. package/src/shell/ShellManager.ts +0 -526
@@ -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 **safe shell integration** through independent configuration files.
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
- ## ✨ Features
7
+ ## ✨ New in v2.0
8
8
 
9
- **Environment Group Management** - Add, remove, switch between Claude Code environments
10
- **Safe Shell Integration** - Uses independent `~/.ccman/.ccmanrc` file to avoid modifying user configs
11
- **Interactive Source Control** - Choose manual or automatic source with risk warnings
12
- **Type Safety** - Full TypeScript implementation with strict typing
13
- **Interactive CLI** - User-friendly commands with colored output and inquirer prompts
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
- ### Basic Usage
27
+ ### First Run Experience
30
28
 
31
29
  ```bash
32
- # Interactive setup (recommended)
33
- ccman config
30
+ # Start CCM (first time)
31
+ ccman
34
32
 
35
- # Or add environment directly
36
- ccman add default https://api.anthropic.com your-api-key
33
+ 🌍 Welcome to CCM! / 欢迎使用 CCM!
37
34
 
38
- # List all environments
39
- ccman ls
35
+ This is your first time running CCM.
36
+ 这是您首次运行 CCM。
40
37
 
41
- # Switch to an environment with source options
42
- ccman use default
38
+ ? Please choose your preferred language:
39
+ ? 请选择您偏好的语言:
40
+ ❯ 🇨🇳 中文 (Chinese)
41
+ 🇺🇸 English
42
+ 🌐 Auto-detect based on system
43
43
 
44
- # Show current environment
45
- ccman current
44
+ Language set to Chinese
45
+ ✓ You can change this later with: ccman lang set <zh|en|auto>
46
46
  ```
47
47
 
48
- ## 📖 Commands Reference
48
+ ### Basic Usage
49
49
 
50
- ### Core Environment Management
51
50
  ```bash
52
- ccman add <name> <baseUrl> [apiKey] # Add environment (interactive API key if not provided)
53
- ccman remove <name> # Remove environment group
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
- ### Interactive Configuration
61
- ```bash
62
- ccman config # Full interactive configuration wizard
63
- # - Add/switch/edit/remove environments
64
- # - No existing environments? Guided setup
65
- # - Complete menu-driven interface
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
- ### Advanced Operations
67
+ ## 🌐 Language Management
68
+
69
+ ### Language Commands
69
70
  ```bash
70
- ccman status # Show detailed CCM statistics
71
- ccman test [name] # Test environment configuration
72
- ccman env # Generate shell export script
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
- ### Shell Integration Options
76
- ```bash
77
- # Disable automatic shell writing
78
- ccman add <name> <url> --no-auto-write
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
- # Force automatic source (risky)
82
- ccman use <name> --auto-source
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
- ## 🔧 Interactive Workflows
88
+ ## 📖 Commands Reference
86
89
 
87
- ### 1. Adding Environment with Smart Use Flow
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
- $ ccman add myenv https://api.example.com
91
- ? Enter API Key: ****************
92
- Added environment group "myenv"
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
- ### 2. Interactive Configuration Menu
109
+ ## 🎯 Interactive Experience
109
110
 
111
+ ### Main Menu Navigation
110
112
  ```bash
111
- $ ccman config
113
+ $ ccman
114
+
112
115
  ? What would you like to do?
113
- ❯ Switch environment
114
- Add new environment
115
- Edit environment
116
- Remove environment
117
- Show current status
118
-
119
- > Add new environment
120
- ? Environment name: staging
121
- ? Base URL: https://staging-api.example.com
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
- ### 3. Environment Switching with Source Control
127
-
127
+ ### Provider Addition Flow
128
128
  ```bash
129
- $ ccman use production
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
- ## 🛡️ Safe Shell Integration Architecture
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
- ### How It Works
143
+ ## 🔧 Architecture Overview
146
144
 
147
- CCM uses a **two-tier architecture** for safe shell integration:
145
+ ### Direct Claude Integration
146
+ CCM v2.0 directly modifies your Claude Code settings file:
148
147
 
149
- 1. **Independent Configuration File**: `~/.ccman/.ccmanrc`
150
- ```bash
151
- # CCM (Claude Code Manager) Environment Variables - Auto Generated
152
- # Generated at: 2025-08-06 11:45:30
153
- # Environment: production
154
- export ANTHROPIC_BASE_URL="https://api.anthropic.com"
155
- export ANTHROPIC_AUTH_TOKEN="your-api-key"
156
- # End CCM Environment Variables
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
- 2. **Minimal Shell Reference**: One line added to `.bashrc`/`.zshrc`
160
- ```bash
161
- # CCM (Claude Code Manager) - Auto Generated Reference
162
- [ -f "/home/user/.ccman/.ccmanrc" ] && source "/home/user/.ccman/.ccmanrc"
163
- # End CCM Reference
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
- ### Benefits
167
- - **Non-invasive**: Only adds one reference line to shell config
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
- ### Environment Variables Managed
173
- - `ANTHROPIC_BASE_URL` - API base URL
174
- - `ANTHROPIC_AUTH_TOKEN` - API authentication token
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
- ## 📊 Configuration Structure
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
- CCM stores configuration in `~/.ccman/config.json`:
191
+ ## 📊 Provider Configuration
179
192
 
193
+ ### Provider Structure
180
194
  ```json
181
195
  {
182
- "current": "production",
183
- "environments": {
184
- "production": {
185
- "name": "production",
186
- "baseUrl": "https://api.anthropic.com",
187
- "apiKey": "your-key",
188
- "createdAt": "2025-08-06T03:45:30.000Z",
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
- "staging": {
192
- "name": "staging",
193
- "baseUrl": "https://staging-api.example.com",
194
- "apiKey": "staging-key",
195
- "createdAt": "2025-08-06T03:46:00.000Z"
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
- "autoWriteShell": true,
200
- "preferredShell": "auto",
201
- "shellConfigPath": null
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 Workflow
241
+ ### Complete First-Time Setup
209
242
  ```bash
210
- # Start with interactive setup
211
- ccman config
212
- # → Guided through adding first environment
213
- # → Automatically prompted to set as current
214
- # → Choose source method (manual/auto)
215
-
216
- # Add more environments
217
- ccman add staging https://staging.example.com
218
- ccman add dev https://dev.example.com
219
-
220
- # Switch with full interaction
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
- # Writes to ~/.ccman/.ccmanrc
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
- ### Manual Environment Variable Setup
259
+ ### Multi-Provider Workflow
235
260
  ```bash
236
- # If you prefer manual control
237
- ccman use prod --no-auto-write
238
- ccman env # Shows export script
239
- source <(ccman env) # Apply manually
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
- ### Advanced Usage
280
+ ### Language Switching
243
281
  ```bash
244
- # Test environment connectivity
245
- ccman test production
246
-
247
- # Force auto-source (with risk warning)
248
- ccman use staging --auto-source
249
-
250
- # Edit existing environment
251
- ccman config # Edit environment → Select → Update values
252
-
253
- # Complete reset (removes EVERYTHING - environments, shell config)
254
- ccman clear # Interactive confirmation required
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
- ## ⚙️ Development
298
+ ## 🛠️ Development Setup
299
+
300
+ ### Development Environment
301
+ CCM supports isolated development environments:
258
302
 
259
303
  ```bash
260
- # Development mode (with file watching)
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 TypeScript
311
+ # Build for production
264
312
  npm run build
265
313
 
266
- # Clean build artifacts
267
- npm run clean
268
-
269
- # Start built CLI
314
+ # Test built version
270
315
  npm start
271
316
  ```
272
317
 
273
- ## 🎯 Command Line Options
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
- ccman add <name> <baseUrl> [apiKey] [options]
283
-
284
- Options:
285
- --no-auto-write Do not automatically write to shell config
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
- ### Environment Variables Not Applied
330
+ ### Provider Issues
300
331
  ```bash
301
- # Check if .ccmanrc exists
302
- ls -la ~/.ccman/.ccmanrc
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
- # Manual application
308
- source ~/.ccman/.ccmanrc
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
- ### Shell Integration Issues
341
+ ### Language Issues
315
342
  ```bash
316
- # Check shell type detection
317
- ccman status
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
- # Force manual setup
320
- ccman use <env> --no-auto-write
321
- source <(ccman env)
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
- - TypeScript 5.0+
328
- - Supported shells: bash, zsh, fish
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
- ## 🚀 From Setup to Usage - Complete Flow
375
+ ## 🚀 Migration from v1.x
338
376
 
339
- ```bash
340
- # 1. Interactive first-time setup
341
- ccman config
342
- No environments? Guided creation
343
- Set as current? Yes
344
- Source method? Manual/Auto
345
-
346
- # 2. Add more environments
347
- ccman add dev https://dev.api.com
348
- Interactive API key input
349
- Set as current? Yes/No
350
- Full source interaction if Yes
351
-
352
- # 3. Switch anytime with full control
353
- ccman use production
354
- → Safe .ccmanrc update
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 - Making Claude Code API configuration management safe, interactive, and user-friendly.*
394
+ *CCM v2.0 - Intelligent, multilingual, and seamless Claude Code provider management.*
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "ccman",
3
- "version": "0.1.2",
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@8.15.1",
6
+ "packageManager": "pnpm@7.33.7",
7
7
  "bin": {
8
8
  "ccman": "./dist/cli.js"
9
9
  },
@@ -66,9 +66,9 @@ version_bump() {
66
66
  local version_type=${1:-""}
67
67
 
68
68
  # 安静模式检测:如果被其他脚本调用,则静默运行
69
- if [ "$0" != "${BASH_SOURCE[0]}" ] || [ "$version_type" = "test" ]; then
69
+ if [ "$0" != "${BASH_SOURCE[0]}" ] || [ "$version_type" = "test" ] || [ "$version_type" = "--quiet" ]; then
70
70
  # 静默模式:只返回结果,不显示菜单
71
- if [ -n "$version_type" ] && [ "$version_type" != "test" ]; then
71
+ if [ -n "$version_type" ] && [ "$version_type" != "test" ] && [ "$version_type" != "--quiet" ]; then
72
72
  execute_version_bump_quiet "$version_type" "$current_version"
73
73
  return $?
74
74
  else