ccman 3.2.2 → 3.3.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/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # ccman
2
2
 
3
- > Codex、Claude Code、Gemini CLI 和 MCP 的配置管理工具,一键切换 API 服务商配置和管理 MCP 服务器。
3
+ > Codex、Claude Code、Gemini CLI、OpenCode 和 MCP 的配置管理工具,一键切换 API 服务商配置和管理 MCP 服务器。
4
4
 
5
5
  ---
6
6
 
7
7
  ## ✨ 核心特性
8
8
 
9
9
  - 🔄 **一键切换**:一条命令切换服务商,自动修改配置文件
10
- - 📦 **内置预设**:提供多个预设模板(Claude: 7 个,Gemini: 3 个,Codex: 1 个,MCP: 多个),只需填写 API Key
10
+ - 📦 **内置预设**:提供常用预设(Claude: 1 个,Gemini: 2 个,Codex: 2 个,OpenCode: 1 个,MCP: 多个),只需填写 API Key
11
11
  - 🛠️ **自定义配置**:支持添加任意第三方服务商
12
12
  - 🔐 **零破坏性**:只修改管理的字段,写入前备份,失败回滚
13
- - 🎯 **多工具支持**:同时管理 Codex、Claude Code、Gemini CLI 和 MCP 服务器
13
+ - 🎯 **多工具支持**:同时管理 Codex、Claude Code、Gemini CLI、OpenCode 和 MCP 服务器
14
14
  - 📱 **双界面**:提供 CLI(命令行)和 Desktop(图形界面)
15
15
  - 🔁 **克隆功能**:快速复制配置,管理多个 API Key
16
16
  - ☁️ **WebDAV 同步**(可选):同步配置到你自己的 WebDAV 服务器(iCloud/Dropbox)
@@ -26,6 +26,7 @@ ccman 的核心功能是自动化配置文件的切换:
26
26
  - **Codex**:自动修改 `~/.codex/config.toml`
27
27
  - **Claude Code**:自动修改 `~/.claude/settings.json`
28
28
  - **Gemini CLI**:自动修改 `~/.gemini/settings.json` 和 `~/.gemini/.env`
29
+ - **OpenCode**:自动修改 `~/.config/opencode/opencode.json`
29
30
  - **MCP**:管理 MCP 服务器配置,并同步到 Claude Code 和 Gemini CLI
30
31
  - **备份机制**:写入前自动备份,失败时自动回滚
31
32
 
@@ -56,7 +57,7 @@ $ ccman --help
56
57
 
57
58
  Usage: ccman [options] [command]
58
59
 
59
- Codex/Claude Code API 服务商配置管理工具
60
+ Codex/Claude Code/Gemini/OpenCode API 服务商配置管理工具
60
61
 
61
62
  Options:
62
63
  -V, --version output the version number
@@ -66,6 +67,7 @@ Commands:
66
67
  cx 管理 Codex 服务商
67
68
  cc 管理 Claude 服务商
68
69
  gm 管理 Gemini CLI 服务商
70
+ oc 管理 OpenCode 服务商
69
71
  mcp 管理 MCP 服务器
70
72
  sync WebDAV 同步配置
71
73
  export [dir] 导出配置
@@ -89,11 +91,11 @@ $ ccman cx list
89
91
 
90
92
  📋 Codex 服务商 (2 个)
91
93
 
92
- Anthropic Official [当前]
93
- https://api.anthropic.com
94
+ OpenAI Official [当前]
95
+ https://api.openai.com/v1
94
96
 
95
- 88Code
96
- https://www.88code.org/api
97
+ GMN
98
+ https://gmn.chuangzuoli.cn/openai
97
99
  ```
98
100
 
99
101
  ```bash
@@ -101,9 +103,9 @@ $ ccman cx current
101
103
 
102
104
  📍 当前 Codex 服务商
103
105
 
104
- Anthropic Official
106
+ OpenAI Official
105
107
  ID: codex-1760178741529-hbgbad
106
- URL: https://api.anthropic.com
108
+ URL: https://api.openai.com/v1
107
109
  最后使用: 2025/10/11 18:32:25
108
110
  ```
109
111
 
@@ -121,13 +123,10 @@ ccman cc list # 查看所有服务商
121
123
  ```bash
122
124
  $ ccman cc list
123
125
 
124
- 📋 Claude Code 服务商 (2 个)
125
-
126
- ○ AnyRouter
127
- https://anyrouter.top
126
+ 📋 Claude Code 服务商 (1 个)
128
127
 
129
- PackyCode [当前]
130
- https://api.packycode.com
128
+ Anthropic Official [当前]
129
+ https://api.anthropic.com
131
130
  ```
132
131
 
133
132
  ```bash
@@ -135,9 +134,9 @@ $ ccman cc current
135
134
 
136
135
  📍 当前 Claude Code 服务商
137
136
 
138
- PackyCode
137
+ Anthropic Official
139
138
  ID: claude-1760182672751-unh2bp
140
- URL: https://api.packycode.com
139
+ URL: https://api.anthropic.com
141
140
  最后使用: 2025/10/11 20:14:08
142
141
  ```
143
142
 
@@ -150,6 +149,15 @@ ccman gm use # 切换服务商
150
149
  ccman gm list # 查看所有服务商
151
150
  ```
152
151
 
152
+ ### 管理 OpenCode 服务商
153
+
154
+ ```bash
155
+ ccman oc # 进入交互式菜单
156
+ ccman oc add # 添加服务商
157
+ ccman oc use # 切换服务商
158
+ ccman oc list # 查看所有服务商
159
+ ```
160
+
153
161
  ### 管理 MCP 服务器
154
162
 
155
163
  ```bash
@@ -165,7 +173,7 @@ ccman mcp remove # 删除 MCP 服务器
165
173
 
166
174
  | 命令 | 说明 |
167
175
  |------|------|
168
- | `ccman` | 主菜单(选择 Codex、Claude Code 或 Gemini CLI) |
176
+ | `ccman` | 主菜单(选择 Codex、Claude Code、Gemini CLI OpenCode) |
169
177
  | **Codex 管理** | |
170
178
  | `ccman cx` | Codex 交互式菜单 |
171
179
  | `ccman cx add` | 添加 Codex 服务商(支持预设模板和自定义) |
@@ -193,6 +201,15 @@ ccman mcp remove # 删除 MCP 服务器
193
201
  | `ccman gm edit [name]` | 编辑 Gemini CLI 服务商 |
194
202
  | `ccman gm remove [name]` | 删除 Gemini CLI 服务商 |
195
203
  | `ccman gm clone [source]` | 克隆 Gemini CLI 服务商 |
204
+ | **OpenCode 管理** | |
205
+ | `ccman oc` | OpenCode 交互式菜单 |
206
+ | `ccman oc add` | 添加 OpenCode 服务商 |
207
+ | `ccman oc list` | 列出所有 OpenCode 服务商 |
208
+ | `ccman oc use [name]` | 切换 OpenCode 服务商 |
209
+ | `ccman oc current` | 查看当前 OpenCode 服务商 |
210
+ | `ccman oc edit [name]` | 编辑 OpenCode 服务商 |
211
+ | `ccman oc remove [name]` | 删除 OpenCode 服务商 |
212
+ | `ccman oc clone [source]` | 克隆 OpenCode 服务商 |
196
213
  | **MCP 服务器管理** | |
197
214
  | `ccman mcp add` | 添加 MCP 服务器 |
198
215
  | `ccman mcp list` | 列出所有 MCP 服务器 |
@@ -209,31 +226,31 @@ ccman mcp remove # 删除 MCP 服务器
209
226
 
210
227
  添加服务商时可以选择"使用预设模板",只需填写 API Key:
211
228
 
212
- ### Claude Code 预设(7 个)
229
+ ### Claude Code 预设(1 个)
213
230
 
214
231
  | 预设名称 | Base URL |
215
232
  |---------|----------|
216
233
  | Anthropic Official | `https://api.anthropic.com` |
217
- | AnyRouter | `https://anyrouter.top` |
218
- | PackyCode | `https://api.packycode.com` |
219
- | 88Code | `https://www.88code.org/api` |
220
- | KKYYXX | `https://api.kkyyxx.cc` |
221
- | BigModel | `https://open.bigmodel.cn/api/anthropic` |
222
- | ModelScope | `https://api-inference.modelscope.cn/v1/chat/completions` |
223
234
 
224
- ### Gemini CLI 预设(3 个)
235
+ ### Gemini CLI 预设(2 个)
236
+
237
+ | 预设名称 | Base URL |
238
+ |---------|----------|
239
+ | Google Gemini (API Key) | 官方默认 |
240
+ | GMN | `https://gmn.chuangzuoli.cn/openai` |
241
+
242
+ ### Codex 预设(2 个)
225
243
 
226
244
  | 预设名称 | Base URL |
227
245
  |---------|----------|
228
- | Google Gemini | `https://generativelanguage.googleapis.com` |
229
- | PackyAPI | `https://api.packyapi.com` |
230
- | LiteLLM Proxy | `http://localhost:4000` |
246
+ | OpenAI Official | `https://api.openai.com/v1` |
247
+ | GMN | `https://gmn.chuangzuoli.cn/openai` |
231
248
 
232
- ### Codex 预设(1 个)
249
+ ### OpenCode 预设(1 个)
233
250
 
234
251
  | 预设名称 | Base URL |
235
252
  |---------|----------|
236
- | 88Code | `https://www.88code.org/api` |
253
+ | GMN | `https://gmn.chuangzuoli.cn/openai` |
237
254
 
238
255
  ### MCP 预设(多个)
239
256
 
@@ -253,30 +270,30 @@ $ ccman cx list
253
270
 
254
271
  📋 Codex 服务商 (1 个)
255
272
 
256
- Anthropic Official [当前]
257
- https://api.anthropic.com
273
+ OpenAI Official [当前]
274
+ https://api.openai.com/v1
258
275
 
259
- # 2. 添加 PackyCode(交互式)
276
+ # 2. 添加 GMN(交互式)
260
277
  $ ccman cx add
261
278
  ? 选择配置方式 › 使用预设模板
262
- ? 选择预设 › PackyCode
263
- ? 服务商名称 › PackyCode
279
+ ? 选择预设 › GMN
280
+ ? 服务商名称 › GMN
264
281
  ? API Key › ••••••••••••••••••••
265
282
  ✅ 添加成功!
266
- 💡 切换到此服务商: ccman cx use PackyCode
283
+ 💡 切换到此服务商: ccman cx use GMN
267
284
 
268
- # 3. 切换到 PackyCode
269
- $ ccman cx use PackyCode
270
- ✅ 已切换到: PackyCode
285
+ # 3. 切换到 GMN
286
+ $ ccman cx use GMN
287
+ ✅ 已切换到: GMN
271
288
 
272
289
  # 4. 确认当前服务商
273
290
  $ ccman cx current
274
291
 
275
292
  📍 当前 Codex 服务商
276
293
 
277
- PackyCode
294
+ GMN
278
295
  ID: codex-1760178741529-abc123
279
- URL: https://api.packycode.com
296
+ URL: https://gmn.chuangzuoli.cn/openai
280
297
  最后使用: 2025/10/11 18:32:25
281
298
  ```
282
299
 
@@ -323,12 +340,14 @@ $ ccman cc use "Claude Test"
323
340
  - `~/.ccman/codex.json` - Codex 服务商配置
324
341
  - `~/.ccman/claude.json` - Claude Code 服务商配置
325
342
  - `~/.ccman/gemini.json` - Gemini CLI 服务商配置
343
+ - `~/.ccman/opencode.json` - OpenCode 服务商配置
326
344
  - `~/.ccman/mcp.json` - MCP 服务器配置
327
345
 
328
346
  **工具配置**(ccman 会自动修改):
329
347
  - **Codex**: `~/.codex/config.toml`
330
348
  - **Claude Code**: `~/.claude/settings.json`
331
349
  - **Gemini CLI**: `~/.gemini/settings.json` 和 `~/.gemini/.env`
350
+ - **OpenCode**: `~/.config/opencode/opencode.json`
332
351
 
333
352
  **零破坏性承诺**:
334
353
  - 只修改管理的字段,保留其他所有配置