ccman 2.1.3 → 2.1.5
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 +21 -0
- package/README.md +201 -301
- package/README_en.md +294 -0
- package/dist/cli.js +213 -33
- package/dist/cli.js.map +1 -1
- package/dist/config/default-providers.d.ts +34 -0
- package/dist/config/default-providers.d.ts.map +1 -0
- package/dist/config/default-providers.js +96 -0
- package/dist/config/default-providers.js.map +1 -0
- package/dist/config/static-env.d.ts +1 -1
- package/dist/config/static-env.js +1 -1
- package/dist/core/ClaudeConfigManager.d.ts +1 -1
- package/dist/core/ClaudeConfigManager.d.ts.map +1 -1
- package/dist/core/ClaudeConfigManager.js +2 -4
- package/dist/core/ClaudeConfigManager.js.map +1 -1
- package/package.json +24 -3
- package/.editorconfig +0 -15
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.eslintrc.js +0 -28
- package/.github/workflows/release.yml +0 -99
- package/.prettierrc +0 -10
- package/CLAUDE.md +0 -279
- package/README_zh.md +0 -394
- package/dev-test.sh +0 -40
- package/docs/npm-publish-guide.md +0 -71
- package/docs/release-guide.md +0 -144
- package/docs/scripts-guide.md +0 -221
- package/docs/version-management.md +0 -64
- package/jest.config.js +0 -22
- package/release-temp/README.md +0 -394
- package/release-temp/package.json +0 -61
- package/scripts/build-env.js +0 -75
- package/scripts/modules/check-uncommitted.sh +0 -109
- package/scripts/modules/create-tag.sh +0 -279
- package/scripts/modules/monitor-release.sh +0 -296
- package/scripts/modules/version-bump.sh +0 -262
- package/scripts/publish-local.sh +0 -91
- package/scripts/quick-release.sh +0 -100
- package/scripts/release.sh +0 -430
- package/scripts/smart-release-v3.sh +0 -283
- package/scripts/smart-release.sh +0 -322
- package/src/cli.ts +0 -598
- package/src/commands/lang.ts +0 -105
- package/src/core/CCMConfigManager.ts +0 -259
- package/src/core/ClaudeConfigManager.ts +0 -141
- package/src/i18n/LanguageManager.ts +0 -169
- package/src/i18n/messages.ts +0 -233
- package/src/index.ts +0 -4
- package/src/providers/ProviderManager.ts +0 -412
- package/src/types/index.ts +0 -101
- package/src/utils/env-config.ts +0 -53
- package/src/utils/version.ts +0 -16
- package/tsconfig.json +0 -25
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 2ue
|
|
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
CHANGED
|
@@ -1,394 +1,294 @@
|
|
|
1
|
-
# CCM - Claude Code Manager
|
|
1
|
+
# CCM - Claude Code Manager
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/ccman)
|
|
6
|
+
[](https://www.npmjs.com/package/ccman)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://nodejs.org)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
**智能管理 Claude Code API 配置的 TypeScript CLI 工具**
|
|
8
11
|
|
|
9
|
-
🌍
|
|
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
|
|
12
|
+
🌍 多语言支持 · 🔧 直接配置集成 · 📁 多供应商管理 · ⚡ 零配置体验
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
**中文文档** | [English](./README_en.md)
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## ✨ 核心特性
|
|
21
|
+
|
|
22
|
+
- **🌍 智能语言支持** - 自动检测系统语言,支持中英文无缝切换
|
|
23
|
+
- **🔧 直接配置集成** - 直接修改 `~/.claude/settings.json`,无需 Shell 集成
|
|
24
|
+
- **📁 多供应商管理** - 在不同 API 供应商间快速切换(Anthropic 官方、第三方等)
|
|
25
|
+
- **🎯 交互式菜单** - 友好的命令行交互界面,支持连续操作
|
|
26
|
+
- **⚡ 零配置体验** - 开箱即用,智能默认配置
|
|
27
|
+
- **🔒 安全可靠** - 自动备份,选择性配置更新,保护用户数据
|
|
28
|
+
|
|
29
|
+
## 🚀 快速开始
|
|
30
|
+
|
|
31
|
+
### 安装方式
|
|
32
|
+
|
|
33
|
+
#### 方式 1: npm 安装 (推荐)
|
|
18
34
|
|
|
19
35
|
```bash
|
|
20
|
-
#
|
|
36
|
+
# 全局安装
|
|
21
37
|
npm install -g ccman
|
|
22
38
|
|
|
23
|
-
#
|
|
24
|
-
|
|
39
|
+
# 或使用 pnpm
|
|
40
|
+
pnpm add -g ccman
|
|
41
|
+
|
|
42
|
+
# 或使用 yarn
|
|
43
|
+
yarn global add ccman
|
|
25
44
|
```
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
#### 方式 2: npx 直接运行 (无需安装)
|
|
28
47
|
|
|
29
48
|
```bash
|
|
30
|
-
#
|
|
31
|
-
ccman
|
|
49
|
+
# 直接运行,不安装到全局
|
|
50
|
+
npx ccman
|
|
32
51
|
|
|
33
|
-
|
|
52
|
+
# 运行特定命令
|
|
53
|
+
npx ccman ls
|
|
54
|
+
npx ccman add anthropic "Anthropic Official" https://api.anthropic.com
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### 方式 3: 从源码安装
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# 克隆仓库
|
|
61
|
+
git clone https://github.com/2ue/ccman.git
|
|
62
|
+
cd ccman
|
|
34
63
|
|
|
35
|
-
|
|
36
|
-
|
|
64
|
+
# 安装依赖
|
|
65
|
+
pnpm install
|
|
37
66
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
❯ 🇨🇳 中文 (Chinese)
|
|
41
|
-
🇺🇸 English
|
|
42
|
-
🌐 Auto-detect based on system
|
|
67
|
+
# 全局链接 (开发模式)
|
|
68
|
+
npm link
|
|
43
69
|
|
|
44
|
-
|
|
45
|
-
|
|
70
|
+
# 或构建后使用
|
|
71
|
+
pnpm build
|
|
72
|
+
node dist/cli.js
|
|
46
73
|
```
|
|
47
74
|
|
|
48
|
-
|
|
75
|
+
#### 方式 4: 下载预编译版本
|
|
76
|
+
|
|
77
|
+
访问 [GitHub Releases](https://github.com/2ue/ccman/releases) 下载对应平台的预编译版本 (如果提供)
|
|
78
|
+
|
|
79
|
+
### 首次运行
|
|
49
80
|
|
|
50
81
|
```bash
|
|
51
|
-
# Interactive main menu (recommended)
|
|
52
82
|
ccman
|
|
83
|
+
```
|
|
53
84
|
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
首次运行时会自动引导你:
|
|
86
|
+
1. 选择界面语言(中文/英文/自动检测)
|
|
87
|
+
2. 创建第一个供应商配置
|
|
88
|
+
3. 自动应用到 Claude Code
|
|
56
89
|
|
|
57
|
-
|
|
58
|
-
ccman add <id> <name> <baseUrl> [apiKey]
|
|
90
|
+
## 📖 命令参考
|
|
59
91
|
|
|
60
|
-
|
|
61
|
-
ccman use <id>
|
|
92
|
+
### 核心命令
|
|
62
93
|
|
|
63
|
-
|
|
64
|
-
ccman
|
|
94
|
+
```bash
|
|
95
|
+
ccman # 交互式主菜单(推荐入口)
|
|
96
|
+
ccman ls # 列出所有供应商及系统状态
|
|
97
|
+
ccman ls --current # 显示当前供应商详情
|
|
98
|
+
ccman ls --brief # 简洁列表模式
|
|
99
|
+
ccman add <id> <name> <url> [key] # 添加新供应商
|
|
100
|
+
ccman use <id> # 切换到指定供应商
|
|
101
|
+
ccman rm <id> # 删除供应商
|
|
102
|
+
ccman clear # 清除所有配置(需确认)
|
|
65
103
|
```
|
|
66
104
|
|
|
67
|
-
|
|
105
|
+
### 语言管理
|
|
68
106
|
|
|
69
|
-
### Language Commands
|
|
70
107
|
```bash
|
|
71
|
-
ccman lang
|
|
72
|
-
ccman lang set zh
|
|
73
|
-
ccman lang set en
|
|
74
|
-
ccman lang set auto
|
|
75
|
-
ccman lang reset
|
|
108
|
+
ccman lang # 显示当前语言设置
|
|
109
|
+
ccman lang set zh # 设置为中文
|
|
110
|
+
ccman lang set en # 设置为英文
|
|
111
|
+
ccman lang set auto # 自动检测系统语言
|
|
112
|
+
ccman lang reset # 重置为首次运行状态
|
|
76
113
|
```
|
|
77
114
|
|
|
78
|
-
|
|
79
|
-
- **Chinese (zh)** - 完整中文界面
|
|
80
|
-
- **English (en)** - Full English interface
|
|
81
|
-
- **Auto-detect** - Based on system `LANG` environment variable
|
|
82
|
-
|
|
83
|
-
### Language Detection Logic
|
|
84
|
-
- English environments (`en-*`) → English interface
|
|
85
|
-
- Other environments (including `zh-*`, unset) → Chinese interface
|
|
86
|
-
- Manual override available anytime
|
|
115
|
+
## 💡 使用示例
|
|
87
116
|
|
|
88
|
-
|
|
117
|
+
### 添加并切换供应商
|
|
89
118
|
|
|
90
|
-
### Core Provider Management
|
|
91
119
|
```bash
|
|
92
|
-
|
|
93
|
-
ccman add
|
|
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
|
-
```
|
|
120
|
+
# 添加官方 Anthropic 配置
|
|
121
|
+
ccman add anthropic "Anthropic Official" https://api.anthropic.com sk-ant-xxx
|
|
101
122
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
ccman
|
|
123
|
+
# 添加第三方供应商
|
|
124
|
+
ccman add custom "My Custom API" https://api.custom.com
|
|
125
|
+
|
|
126
|
+
# 切换到自定义供应商
|
|
127
|
+
ccman use custom
|
|
128
|
+
|
|
129
|
+
# 列出所有供应商
|
|
130
|
+
ccman ls
|
|
107
131
|
```
|
|
108
132
|
|
|
109
|
-
|
|
133
|
+
### 交互式菜单操作
|
|
110
134
|
|
|
111
|
-
### Main Menu Navigation
|
|
112
135
|
```bash
|
|
113
136
|
$ ccman
|
|
114
137
|
|
|
115
|
-
?
|
|
116
|
-
❯
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
138
|
+
? 您想要执行什么操作?
|
|
139
|
+
❯ 切换供应商
|
|
140
|
+
添加新供应商
|
|
141
|
+
更新供应商
|
|
142
|
+
删除供应商
|
|
143
|
+
显示详细状态
|
|
144
|
+
退出
|
|
122
145
|
|
|
123
|
-
#
|
|
124
|
-
|
|
146
|
+
# 选择操作后,按提示完成配置
|
|
147
|
+
# 每次操作后可以选择继续或退出
|
|
125
148
|
```
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
$ ccman add
|
|
130
|
-
|
|
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
|
-
```
|
|
150
|
+
## 🔧 工作原理
|
|
142
151
|
|
|
143
|
-
|
|
152
|
+
CCM 直接管理 `~/.claude/settings.json` 文件,通过以下方式确保安全:
|
|
144
153
|
|
|
145
|
-
###
|
|
146
|
-
CCM v2.0 directly modifies your Claude Code settings file:
|
|
154
|
+
### 选择性更新
|
|
147
155
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
156
|
+
只修改 CCM 管理的配置项:
|
|
157
|
+
- `env.ANTHROPIC_AUTH_TOKEN`
|
|
158
|
+
- `env.ANTHROPIC_BASE_URL`
|
|
159
|
+
- `env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`
|
|
160
|
+
- `env.CLAUDE_CODE_MAX_OUTPUT_TOKENS`
|
|
161
|
+
- `permissions.allow` / `permissions.deny`
|
|
157
162
|
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
```
|
|
163
|
+
**保留所有其他用户配置项**(如 `mcpServers`、`model`、`customUserConfig` 等)
|
|
164
|
+
|
|
165
|
+
### 自动备份
|
|
173
166
|
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
每次切换前自动备份当前配置到 `~/.ccman/backups/`
|
|
168
|
+
|
|
169
|
+
## 📂 配置结构
|
|
176
170
|
|
|
177
171
|
```
|
|
178
172
|
~/.ccman/
|
|
179
|
-
├── config.json
|
|
180
|
-
├── providers/
|
|
181
|
-
│ ├── anthropic.json
|
|
182
|
-
│ ├──
|
|
183
|
-
│ └──
|
|
173
|
+
├── config.json # CCM 主配置
|
|
174
|
+
├── providers/ # 供应商配置目录
|
|
175
|
+
│ ├── anthropic.json # Anthropic 官方
|
|
176
|
+
│ ├── custom.json # 自定义供应商
|
|
177
|
+
│ └── ...
|
|
178
|
+
└── backups/ # 配置备份目录(自动创建)
|
|
184
179
|
```
|
|
185
180
|
|
|
186
|
-
|
|
187
|
-
CCM only updates Claude-specific keys, preserving your existing settings:
|
|
188
|
-
- ✅ Preserves: `mcpServers`, `model`, `customUserConfig`, etc.
|
|
189
|
-
- 🔄 Updates: `env.ANTHROPIC_*`, `permissions`, `apiKeyHelper`
|
|
190
|
-
|
|
191
|
-
## 📊 Provider Configuration
|
|
192
|
-
|
|
193
|
-
### Provider Structure
|
|
194
|
-
```json
|
|
195
|
-
{
|
|
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
|
|
203
|
-
},
|
|
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
|
-
```
|
|
181
|
+
## 🌐 语言支持
|
|
214
182
|
|
|
215
|
-
###
|
|
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"
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
"settings": {
|
|
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"
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
```
|
|
183
|
+
### 支持的语言
|
|
238
184
|
|
|
239
|
-
|
|
185
|
+
- **中文 (zh)** - 完整中文界面
|
|
186
|
+
- **英文 (en)** - 完整英文界面
|
|
187
|
+
- **自动检测 (auto)** - 基于系统 `LANG` 环境变量自动选择
|
|
240
188
|
|
|
241
|
-
###
|
|
242
|
-
```bash
|
|
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
|
|
255
|
-
ccman use dev
|
|
256
|
-
ccman use anthropic
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Multi-Provider Workflow
|
|
260
|
-
```bash
|
|
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
|
|
189
|
+
### 语言检测逻辑
|
|
266
190
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
# ✓ Claude Code configuration has been updated successfully!
|
|
191
|
+
- 英文环境 (`en-*`) → 自动使用英文界面
|
|
192
|
+
- 其他环境(包括 `zh-*`、未设置等) → 自动使用中文界面
|
|
193
|
+
- 用户可随时手动覆盖语言设置
|
|
271
194
|
|
|
272
|
-
|
|
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
|
|
278
|
-
```
|
|
195
|
+
## 📋 系统要求
|
|
279
196
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
|
296
|
-
```
|
|
197
|
+
- **Node.js** >= 16.0.0
|
|
198
|
+
- **Claude Code** 已安装并支持 settings.json
|
|
199
|
+
- **操作系统**: Linux, macOS, Windows (WSL)
|
|
200
|
+
- **包管理器**: npm, pnpm, yarn(推荐 pnpm)
|
|
297
201
|
|
|
298
|
-
##
|
|
202
|
+
## 🔍 故障排除
|
|
299
203
|
|
|
300
|
-
###
|
|
301
|
-
CCM supports isolated development environments:
|
|
204
|
+
### 供应商配置未生效
|
|
302
205
|
|
|
303
206
|
```bash
|
|
304
|
-
#
|
|
305
|
-
|
|
306
|
-
export CLAUDE_CONFIG_PATH="$HOME/.claude/settings-dev.json"
|
|
307
|
-
|
|
308
|
-
# Use development mode
|
|
309
|
-
npm run dev
|
|
207
|
+
# 1. 检查当前供应商信息
|
|
208
|
+
ccman ls --current
|
|
310
209
|
|
|
311
|
-
#
|
|
312
|
-
|
|
210
|
+
# 2. 重新应用配置
|
|
211
|
+
ccman use <provider-id>
|
|
313
212
|
|
|
314
|
-
#
|
|
315
|
-
|
|
213
|
+
# 3. 检查 Claude 配置文件
|
|
214
|
+
cat ~/.claude/settings.json | grep ANTHROPIC
|
|
316
215
|
```
|
|
317
216
|
|
|
318
|
-
###
|
|
217
|
+
### 语言切换问题
|
|
218
|
+
|
|
319
219
|
```bash
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
220
|
+
# 查看当前语言设置
|
|
221
|
+
ccman lang
|
|
222
|
+
|
|
223
|
+
# 强制设置为中文
|
|
224
|
+
ccman lang set zh
|
|
225
|
+
|
|
226
|
+
# 重置到首次运行状态(重新选择语言)
|
|
227
|
+
ccman lang reset
|
|
228
|
+
ccman
|
|
326
229
|
```
|
|
327
230
|
|
|
328
|
-
|
|
231
|
+
### 配置文件损坏
|
|
329
232
|
|
|
330
|
-
### Provider Issues
|
|
331
233
|
```bash
|
|
332
|
-
#
|
|
333
|
-
ccman
|
|
334
|
-
ccman use <provider-id> # Re-apply provider configuration
|
|
234
|
+
# 删除所有配置(会要求确认)
|
|
235
|
+
ccman clear
|
|
335
236
|
|
|
336
|
-
#
|
|
337
|
-
|
|
338
|
-
cat ~/.claude/settings.json | grep ANTHROPIC
|
|
237
|
+
# 重新开始配置
|
|
238
|
+
ccman
|
|
339
239
|
```
|
|
340
240
|
|
|
341
|
-
|
|
342
|
-
```bash
|
|
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
|
-
```
|
|
241
|
+
## 📚 开发文档
|
|
352
242
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
ccman # Fresh start
|
|
243
|
+
- [开发指南 (中文)](./docs/DEVELOPMENT.md)
|
|
244
|
+
- [Development Guide (English)](./docs/DEVELOPMENT_en.md)
|
|
245
|
+
- [版本发布指南](./docs/release-guide.md)
|
|
246
|
+
- [脚本使用指南](./docs/scripts-guide.md)
|
|
358
247
|
|
|
359
|
-
|
|
360
|
-
export CCM_CONFIG_DIR=".ccman-dev" # Separate dev config
|
|
361
|
-
```
|
|
248
|
+
## 🤝 贡献
|
|
362
249
|
|
|
363
|
-
|
|
250
|
+
我们欢迎各种形式的贡献!
|
|
364
251
|
|
|
365
|
-
|
|
366
|
-
- **Claude Code** installed with settings.json support
|
|
367
|
-
- **Operating Systems**: Linux, macOS, Windows (WSL)
|
|
252
|
+
### 如何贡献
|
|
368
253
|
|
|
369
|
-
|
|
254
|
+
1. Fork 本仓库
|
|
255
|
+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
|
256
|
+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
|
257
|
+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
|
258
|
+
5. 提交 Pull Request
|
|
370
259
|
|
|
371
|
-
|
|
260
|
+
### 报告问题
|
|
372
261
|
|
|
373
|
-
|
|
262
|
+
如果你发现了 bug 或有新功能建议,请在 [GitHub Issues](https://github.com/2ue/ccman/issues) 中提交。
|
|
263
|
+
|
|
264
|
+
## 📄 开源协议
|
|
265
|
+
|
|
266
|
+
本项目采用 [MIT License](LICENSE) 开源协议。
|
|
374
267
|
|
|
375
|
-
##
|
|
268
|
+
## 👤 作者
|
|
376
269
|
|
|
377
|
-
|
|
270
|
+
**2ue**
|
|
271
|
+
- 📧 Email: jie746635835@163.com
|
|
272
|
+
- 🐙 GitHub: [@2ue](https://github.com/2ue)
|
|
378
273
|
|
|
379
|
-
|
|
380
|
-
- Modified shell configuration files
|
|
381
|
-
- Used environment variables
|
|
382
|
-
- Complex shell integration
|
|
274
|
+
## 🙏 致谢
|
|
383
275
|
|
|
384
|
-
|
|
385
|
-
- Modifies `~/.claude/settings.json` directly
|
|
386
|
-
- Provider-based configuration
|
|
387
|
-
- Language support
|
|
388
|
-
- Simplified, safer approach
|
|
276
|
+
感谢所有为本项目做出贡献的开发者!
|
|
389
277
|
|
|
390
|
-
|
|
278
|
+
感谢以下开源项目:
|
|
279
|
+
- [TypeScript](https://www.typescriptlang.org/)
|
|
280
|
+
- [Commander.js](https://github.com/tj/commander.js)
|
|
281
|
+
- [Inquirer.js](https://github.com/SBoudrias/Inquirer.js)
|
|
282
|
+
- [Chalk](https://github.com/chalk/chalk)
|
|
391
283
|
|
|
392
284
|
---
|
|
393
285
|
|
|
394
|
-
|
|
286
|
+
<div align="center">
|
|
287
|
+
|
|
288
|
+
**CCM v2.x - 智能、多语言、无缝的 Claude Code 供应商管理**
|
|
289
|
+
|
|
290
|
+
Made with ❤️ by [2ue](https://github.com/2ue)
|
|
291
|
+
|
|
292
|
+
[⬆ 回到顶部](#ccm---claude-code-manager)
|
|
293
|
+
|
|
294
|
+
</div>
|