@musistudio/claude-code-router 3.0.4 → 3.0.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/README.md +178 -369
- package/README_zh.md +178 -368
- package/dist/main/cli.js +2818 -343
- package/dist/main/fusion-vision-mcp.js +6 -6
- package/dist/renderer/assets/main.css +1 -1
- package/dist/renderer/assets/main.js +40 -40
- package/dist/renderer/assets/tray.js +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,375 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<td align="left">
|
|
31
|
-
<p>
|
|
32
|
-
<strong>Thanks to Kimi for sponsoring this project!</strong> Kimi K2.7 Code is an open-source, coding-focused agentic model developed by Moonshot AI, with substantial gains on real-world long-horizon coding tasks and higher end-to-end success across complex software engineering workflows. It also cuts thinking-token usage by approximately 30% compared with K2.6. Inside CCR, Kimi ships as built-in provider presets: import the pay-as-you-go API or the Kimi Code subscription in one click and route your coding agent's requests to Kimi, the subscription endpoint passes straight through natively with no protocol conversion, API endpoints are adapted automatically, and your balance and subscription usage show up right in the CCR dashboard.
|
|
33
|
-
</p>
|
|
34
|
-
<p align="center">
|
|
35
|
-
CCR already supports Kimi. Visit the Kimi Open Platform (<a href="https://platform.kimi.com?aff=ccr">中文站</a> | <a href="https://platform.kimi.ai?aff=ccr">Global</a>) to try the API, or explore the <a href="https://www.kimi.com/code?aff=ccr">cost-effective Coding Plan</a>.
|
|
36
|
-
</p>
|
|
37
|
-
</td>
|
|
38
|
-
</tr>
|
|
39
|
-
</table>
|
|
40
|
-
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
Claude Code Router Desktop is a local gateway and desktop control panel for routing agent requests from Claude Code, Codex, ZCode, and compatible clients to the model provider you actually want to use.
|
|
44
|
-
|
|
45
|
-
<p align="center">
|
|
46
|
-
<img src="blog/images/claude-code-router.png" width="720" alt="Claude Code Router Desktop screenshot" />
|
|
47
|
-
</p>
|
|
48
|
-
|
|
49
|
-
## Why Use CCR
|
|
50
|
-
|
|
51
|
-
- Use one local endpoint for multiple agent tools instead of configuring every client separately.
|
|
52
|
-
- Route requests with default routing, conditional rules, fallback targets, and request rewrites instead of editing client configuration by hand.
|
|
53
|
-
- Mix providers without changing your workflow. CCR supports OpenAI-compatible APIs, Anthropic Messages, Gemini Generate Content, OpenRouter, DeepSeek, SiliconFlow, Moonshot, Kimi Code, Mistral, Z.AI, Bailian, and custom providers.
|
|
54
|
-
- Control cost and reliability with fallback routing, API key rotation, usage statistics, and request logs.
|
|
55
|
-
|
|
56
|
-
## Features
|
|
57
|
-
|
|
58
|
-
- **Overview dashboard**: inspect system status, usage widgets, account balances, model distribution, and share cards.
|
|
59
|
-
- **Provider management**: add provider presets or custom endpoints, probe protocol support, test model connectivity, manage credentials, and monitor supported account balances where available.
|
|
60
|
-
- **Routing rules**: configure default routing, conditional and model-prefix rules, fallback handling, and request rewrites.
|
|
61
|
-
- **Agent Config**: configure Claude Code, Codex, and ZCode launch entries, models, scopes, and multi-instance app profiles.
|
|
62
|
-
- **Gateway compatibility**: translate supported client requests through the local CCR model gateway.
|
|
63
|
-
- **Proxy mode**: capture supported API traffic through a local proxy with optional system proxy integration and network capture.
|
|
64
|
-
- **Fusion models**: combine a base model with vision, web search, or MCP tools into a reusable selectable model.
|
|
65
|
-
|
|
66
|
-
## Documentation
|
|
67
|
-
|
|
68
|
-
Read the full documentation at [ccrdesk.top](https://ccrdesk.top/).
|
|
69
|
-
|
|
70
|
-
## Download And Install
|
|
71
|
-
|
|
72
|
-
1. Open the [GitHub Releases page](https://github.com/musistudio/claude-code-router/releases).
|
|
73
|
-
2. Download the package for your platform:
|
|
74
|
-
- macOS Apple Silicon: `Claude-Code-Router_<version>-mac-Apple-Silicon-arm64.dmg` or `.zip`
|
|
75
|
-
- macOS Intel: `Claude-Code-Router_<version>-mac-Intel-x64.dmg` or `.zip`
|
|
76
|
-
- Windows: `Claude Code Router_<version>.exe`
|
|
77
|
-
- Linux: `Claude Code Router_<version>.AppImage`
|
|
78
|
-
3. Install and launch **Claude Code Router**.
|
|
79
|
-
4. On first launch, CCR creates its local configuration database:
|
|
80
|
-
- macOS/Linux: `~/.claude-code-router/config.sqlite`
|
|
81
|
-
- Windows: `%APPDATA%\Claude Code Router\config.sqlite`
|
|
82
|
-
|
|
83
|
-
CCR stores runtime configuration in SQLite. A legacy `config.json` is read only once for migration when no SQLite config exists.
|
|
84
|
-
|
|
85
|
-
After the service is started from the **Server** page, CCR listens on `http://localhost:8080` by default. The **Server** page controls the gateway `Host`, `Port`, proxy mode, system proxy, network capture, and CA certificate status.
|
|
1
|
+
# Claude Code Router CLI
|
|
2
|
+
|
|
3
|
+
[中文](README_zh.md) · [Documentation](https://ccrdesk.top/en/) · [GitHub](https://github.com/musistudio/claude-code-router)
|
|
4
|
+
|
|
5
|
+
`@musistudio/claude-code-router` is the Node.js distribution of Claude Code Router. It provides the `ccr` command, the browser-based management UI, the local model gateway, and profile launch commands without requiring Electron.
|
|
6
|
+
|
|
7
|
+
Use the CLI on developer machines and headless hosts. If you want the tray, desktop notifications, automatic app updates, or desktop-only browser integrations, install the desktop application instead.
|
|
8
|
+
|
|
9
|
+
## Requirements And Installation
|
|
10
|
+
|
|
11
|
+
- Node.js 22 or newer
|
|
12
|
+
- A supported upstream model provider, or a locally logged-in agent account that CCR can import
|
|
13
|
+
- A locally installed agent executable when using profile launch commands
|
|
14
|
+
|
|
15
|
+
Install globally:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install -g @musistudio/claude-code-router
|
|
19
|
+
ccr --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Upgrade or remove it with npm:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install -g @musistudio/claude-code-router@latest
|
|
26
|
+
npm uninstall -g @musistudio/claude-code-router
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Removing the package does not delete CCR's local configuration or databases.
|
|
86
30
|
|
|
87
31
|
## Quick Start
|
|
88
32
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
<td align="center" width="220">@*说</td>
|
|
238
|
-
</tr>
|
|
239
|
-
<tr>
|
|
240
|
-
<td align="center" width="220">@*更</td>
|
|
241
|
-
<td align="center" width="220">@K*g</td>
|
|
242
|
-
<td align="center" width="220">@R*R</td>
|
|
243
|
-
<td align="center" width="220"><a href="https://github.com/bobleer">@bobleer</a></td>
|
|
244
|
-
<td align="center" width="220">@*苗</td>
|
|
245
|
-
<td align="center" width="220">@*划</td>
|
|
246
|
-
</tr>
|
|
247
|
-
<tr>
|
|
248
|
-
<td align="center" width="220"><a href="https://github.com/Clarence-pan">@Clarence-pan</a></td>
|
|
249
|
-
<td align="center" width="220"><a href="https://github.com/carter003">@carter003</a></td>
|
|
250
|
-
<td align="center" width="220">@S*r</td>
|
|
251
|
-
<td align="center" width="220">@*晖</td>
|
|
252
|
-
<td align="center" width="220">@*敏</td>
|
|
253
|
-
<td align="center" width="220">@Z*z</td>
|
|
254
|
-
</tr>
|
|
255
|
-
<tr>
|
|
256
|
-
<td align="center" width="220">@*然</td>
|
|
257
|
-
<td align="center" width="220"><a href="https://github.com/cluic">@cluic</a></td>
|
|
258
|
-
<td align="center" width="220">@*苗</td>
|
|
259
|
-
<td align="center" width="220"><a href="https://github.com/PromptExpert">@PromptExpert</a></td>
|
|
260
|
-
<td align="center" width="220">@*应</td>
|
|
261
|
-
<td align="center" width="220"><a href="https://github.com/yusnake">@yusnake</a></td>
|
|
262
|
-
</tr>
|
|
263
|
-
<tr>
|
|
264
|
-
<td align="center" width="220">@*飞</td>
|
|
265
|
-
<td align="center" width="220">@董*</td>
|
|
266
|
-
<td align="center" width="220">@*汀</td>
|
|
267
|
-
<td align="center" width="220">@*涯</td>
|
|
268
|
-
<td align="center" width="220">@*:-)</td>
|
|
269
|
-
<td align="center" width="220">@**磊</td>
|
|
270
|
-
</tr>
|
|
271
|
-
<tr>
|
|
272
|
-
<td align="center" width="220">@*琢</td>
|
|
273
|
-
<td align="center" width="220">@*成</td>
|
|
274
|
-
<td align="center" width="220">@Z*o</td>
|
|
275
|
-
<td align="center" width="220">@*琨</td>
|
|
276
|
-
<td align="center" width="220"><a href="https://github.com/congzhangzh">@congzhangzh</a></td>
|
|
277
|
-
<td align="center" width="220">@*_</td>
|
|
278
|
-
</tr>
|
|
279
|
-
<tr>
|
|
280
|
-
<td align="center" width="220">@Z*m</td>
|
|
281
|
-
<td align="center" width="220">@*鑫</td>
|
|
282
|
-
<td align="center" width="220">@c*y</td>
|
|
283
|
-
<td align="center" width="220">@*昕</td>
|
|
284
|
-
<td align="center" width="220"><a href="https://github.com/witsice">@witsice</a></td>
|
|
285
|
-
<td align="center" width="220">@b*g</td>
|
|
286
|
-
</tr>
|
|
287
|
-
<tr>
|
|
288
|
-
<td align="center" width="220">@*亿</td>
|
|
289
|
-
<td align="center" width="220">@*辉</td>
|
|
290
|
-
<td align="center" width="220">@JACK</td>
|
|
291
|
-
<td align="center" width="220">@*光</td>
|
|
292
|
-
<td align="center" width="220">@W*l</td>
|
|
293
|
-
<td align="center" width="220"><a href="https://github.com/kesku">@kesku</a></td>
|
|
294
|
-
</tr>
|
|
295
|
-
<tr>
|
|
296
|
-
<td align="center" width="220"><a href="https://github.com/biguncle">@biguncle</a></td>
|
|
297
|
-
<td align="center" width="220">@二吉吉</td>
|
|
298
|
-
<td align="center" width="220">@a*g</td>
|
|
299
|
-
<td align="center" width="220">@*林</td>
|
|
300
|
-
<td align="center" width="220">@*咸</td>
|
|
301
|
-
<td align="center" width="220">@*明</td>
|
|
302
|
-
</tr>
|
|
303
|
-
<tr>
|
|
304
|
-
<td align="center" width="220">@S*y</td>
|
|
305
|
-
<td align="center" width="220">@f*o</td>
|
|
306
|
-
<td align="center" width="220">@*智</td>
|
|
307
|
-
<td align="center" width="220">@F*t</td>
|
|
308
|
-
<td align="center" width="220">@r*c</td>
|
|
309
|
-
<td align="center" width="220"><a href="https://github.com/qierkang">@qierkang</a></td>
|
|
310
|
-
</tr>
|
|
311
|
-
<tr>
|
|
312
|
-
<td align="center" width="220">@*军</td>
|
|
313
|
-
<td align="center" width="220"><a href="https://github.com/snrise-z">@snrise-z</a></td>
|
|
314
|
-
<td align="center" width="220">@*王</td>
|
|
315
|
-
<td align="center" width="220"><a href="https://github.com/greatheart1000">@greatheart1000</a></td>
|
|
316
|
-
<td align="center" width="220">@*王</td>
|
|
317
|
-
<td align="center" width="220">@zcutlip</td>
|
|
318
|
-
</tr>
|
|
319
|
-
<tr>
|
|
320
|
-
<td align="center" width="220"><a href="https://github.com/Peng-YM">@Peng-YM</a></td>
|
|
321
|
-
<td align="center" width="220">@*更</td>
|
|
322
|
-
<td align="center" width="220">@*.</td>
|
|
323
|
-
<td align="center" width="220">@F*t</td>
|
|
324
|
-
<td align="center" width="220">@*政</td>
|
|
325
|
-
<td align="center" width="220">@*铭</td>
|
|
326
|
-
</tr>
|
|
327
|
-
<tr>
|
|
328
|
-
<td align="center" width="220">@*叶</td>
|
|
329
|
-
<td align="center" width="220">@七*o</td>
|
|
330
|
-
<td align="center" width="220">@*青</td>
|
|
331
|
-
<td align="center" width="220">@**晨</td>
|
|
332
|
-
<td align="center" width="220">@*远</td>
|
|
333
|
-
<td align="center" width="220">@*霄</td>
|
|
334
|
-
</tr>
|
|
335
|
-
<tr>
|
|
336
|
-
<td align="center" width="220">@**吉</td>
|
|
337
|
-
<td align="center" width="220">@**飞</td>
|
|
338
|
-
<td align="center" width="220">@**驰</td>
|
|
339
|
-
<td align="center" width="220">@x*g</td>
|
|
340
|
-
<td align="center" width="220">@**东</td>
|
|
341
|
-
<td align="center" width="220">@*落</td>
|
|
342
|
-
</tr>
|
|
343
|
-
<tr>
|
|
344
|
-
<td align="center" width="220">@哆*k</td>
|
|
345
|
-
<td align="center" width="220">@*涛</td>
|
|
346
|
-
<td align="center" width="220"><a href="https://github.com/WitMiao">@苗大</a></td>
|
|
347
|
-
<td align="center" width="220">@*呢</td>
|
|
348
|
-
<td align="center" width="220">@d*u</td>
|
|
349
|
-
<td align="center" width="220">@crizcraig</td>
|
|
350
|
-
</tr>
|
|
351
|
-
<tr>
|
|
352
|
-
<td align="center" width="220">s*s</td>
|
|
353
|
-
<td align="center" width="220">*火</td>
|
|
354
|
-
<td align="center" width="220">*勤</td>
|
|
355
|
-
<td align="center" width="220">**锟</td>
|
|
356
|
-
<td align="center" width="220">*涛</td>
|
|
357
|
-
<td align="center" width="220">**明</td>
|
|
358
|
-
</tr>
|
|
359
|
-
<tr>
|
|
360
|
-
<td align="center" width="220">*知</td>
|
|
361
|
-
<td align="center" width="220">*语</td>
|
|
362
|
-
<td align="center" width="220">*瓜</td>
|
|
363
|
-
<td align="center" width="220"></td>
|
|
364
|
-
<td align="center" width="220"></td>
|
|
365
|
-
<td align="center" width="220"></td>
|
|
366
|
-
</tr>
|
|
367
|
-
</table>
|
|
368
|
-
|
|
369
|
-
<sub>If your name is masked, please contact me via my homepage email to update it with your GitHub username.</sub>
|
|
370
|
-
|
|
371
|
-
</div>
|
|
33
|
+
Start the background service and open the management UI:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
ccr ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then:
|
|
40
|
+
|
|
41
|
+
1. Add an upstream provider and at least one model.
|
|
42
|
+
2. Create a CCR client key under **API Keys**.
|
|
43
|
+
3. Configure routing if the default provider/model is not sufficient.
|
|
44
|
+
4. Confirm that the gateway is running under **Server**.
|
|
45
|
+
5. Point your client at the gateway URL shown in the UI. The default gateway is `http://127.0.0.1:3456`; the management UI defaults to `http://127.0.0.1:3458`.
|
|
46
|
+
|
|
47
|
+
The management token and CCR client API keys are different credentials. The management token protects the browser UI and RPC API. CCR client keys authenticate model requests sent to the gateway.
|
|
48
|
+
|
|
49
|
+
## Service Commands
|
|
50
|
+
|
|
51
|
+
| Command | Behavior |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `ccr start` | Starts a detached background management service and gateway, then prints its authenticated management URL. |
|
|
54
|
+
| `ccr ui` | Reuses or starts the background service and opens the management UI. |
|
|
55
|
+
| `ccr stop` | Stops the detached service started by `ccr start` or `ccr ui`. |
|
|
56
|
+
| `ccr serve` | Runs the management service and gateway in the foreground. `ccr web` is an alias. |
|
|
57
|
+
| `ccr <profile>` | Opens an enabled Agent Config profile by name or ID. |
|
|
58
|
+
|
|
59
|
+
### `ccr start`
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
ccr start [--host <host>] [--port <port>] [--open|--no-open] [--gateway|--no-gateway]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- `--host <host>`: management listener, default `127.0.0.1`.
|
|
66
|
+
- `--port <port>`: preferred management port, default `3458`.
|
|
67
|
+
- `--open` / `--no-open`: enable or disable opening a browser.
|
|
68
|
+
- `--gateway`: explicitly request gateway startup; this is the default.
|
|
69
|
+
- `--no-gateway`: start only the management service.
|
|
70
|
+
|
|
71
|
+
### `ccr ui`
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
ccr ui [--host <host>] [--port <port>] [--open|--no-open] [--gateway|--no-gateway]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`ui` opens the browser by default. Use `--no-open` on SSH or other headless sessions.
|
|
78
|
+
|
|
79
|
+
### `ccr serve`
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
ccr serve [--host <host>] [--port <port>] [--open|--no-open] [--gateway|--no-gateway]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`serve` stays attached to the current terminal and handles `SIGINT`/`SIGTERM`. It is the appropriate mode for a process supervisor. `ccr stop` only manages the detached service; stop a foreground server through its terminal or supervisor.
|
|
86
|
+
|
|
87
|
+
If the preferred management port is occupied, CCR tries the next available ports and prints the actual URL. When `start` or `ui` reuses an existing service, new host, port, and `--no-gateway` choices do not reconfigure that process. Run `ccr stop` first when those settings must change.
|
|
88
|
+
|
|
89
|
+
## Agent Config Profiles
|
|
90
|
+
|
|
91
|
+
Create and enable profiles in **Agent Config**, then launch one by name or ID:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
ccr "Codex - Work"
|
|
95
|
+
ccr "Codex - Work" app
|
|
96
|
+
ccr "Claude - Review" cli -- --model sonnet
|
|
97
|
+
ccr profile-id -- --help
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The syntax is:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
ccr <profile-name-or-id> [cli|app] [-- <agent arguments>]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- `--cli` and `--app` are accepted alternatives to the positional surface.
|
|
107
|
+
- Put agent-specific arguments after `--` so they cannot be confused with CCR options.
|
|
108
|
+
- If the surface is omitted, CCR uses the first surface allowed by the profile: CLI for Claude Code, Codex, and Grok CLI; App for ZCode.
|
|
109
|
+
- Grok supports CLI only. ZCode supports App only. Claude App and ZCode App do not accept trailing agent arguments.
|
|
110
|
+
- Desktop App launches require that app to be installed and a graphical session to be available.
|
|
111
|
+
- Start the CCR service before opening most profiles. A Grok CLI profile can start a temporary shared service automatically and stops it after the last managed session exits.
|
|
112
|
+
|
|
113
|
+
The desktop application installs a related command named `ccr-app`. Commands copied from desktop Agent Config cards use `ccr-app`; the npm package documented here installs `ccr`.
|
|
114
|
+
|
|
115
|
+
## Configuration And Runtime Files
|
|
116
|
+
|
|
117
|
+
| Platform | Config directory |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| macOS / Linux | `~/.claude-code-router` |
|
|
120
|
+
| Windows | `%APPDATA%\claude-code-router` |
|
|
121
|
+
|
|
122
|
+
Important files include:
|
|
123
|
+
|
|
124
|
+
- `config.sqlite`: current application configuration.
|
|
125
|
+
- `app-data/`: API key, usage, request-log, certificate, and other runtime databases/files.
|
|
126
|
+
- `service.json`: state and private token for a detached CLI service.
|
|
127
|
+
- `gateway.config.json`: generated gateway runtime configuration.
|
|
128
|
+
- `profiles/` and `bin/`: isolated profile configuration and launch wrappers.
|
|
129
|
+
|
|
130
|
+
Do not edit or copy live SQLite files while CCR is writing to them. Use the UI export feature, or stop CCR before taking a filesystem backup.
|
|
131
|
+
|
|
132
|
+
## Environment And Security
|
|
133
|
+
|
|
134
|
+
| Variable | Description |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `CCR_WEB_HOST` | Default management listener when `--host` is omitted. |
|
|
137
|
+
| `CCR_WEB_PORT` | Default management port when `--port` is omitted. |
|
|
138
|
+
| `CCR_WEB_AUTH_TOKEN` | Fixes the management UI/RPC token instead of generating a random token for the process. |
|
|
139
|
+
|
|
140
|
+
The authenticated management URL contains `ccr_web_token` in its query string. Treat that URL like a password and avoid copying it into logs, tickets, or shell history. Bind to `127.0.0.1` unless remote access is intentional. For remote access, use a firewall or private network plus TLS at a trusted reverse proxy.
|
|
141
|
+
|
|
142
|
+
Do not expose the gateway without creating CCR client API keys. Upstream provider credentials are stored in CCR's local data directory, so protect that directory and its backups.
|
|
143
|
+
|
|
144
|
+
## Troubleshooting
|
|
145
|
+
|
|
146
|
+
### `ccr` is not found
|
|
147
|
+
|
|
148
|
+
Confirm Node.js is version 22 or later and that npm's global binary directory is on `PATH`:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
node --version
|
|
152
|
+
npm prefix -g
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Open a new shell after installation if your shell caches command paths.
|
|
156
|
+
|
|
157
|
+
### The management URL changed ports
|
|
158
|
+
|
|
159
|
+
The requested port was already occupied. Use the URL printed by CCR, or stop the conflicting process and restart CCR.
|
|
160
|
+
|
|
161
|
+
### The UI opens but the gateway is unavailable
|
|
162
|
+
|
|
163
|
+
The management service can run without a usable gateway. Add a provider and model, create a client API key, then start or restart the gateway from **Server**. Check the foreground output from `ccr serve` when diagnosing startup errors.
|
|
164
|
+
|
|
165
|
+
### A profile cannot be found
|
|
166
|
+
|
|
167
|
+
Only enabled profiles are launchable. Names are matched without case and sanitized names are accepted, but ambiguous names require the profile ID. Re-save the profile if its generated launcher is missing.
|
|
168
|
+
|
|
169
|
+
### A background service uses old options
|
|
170
|
+
|
|
171
|
+
Stop and recreate it:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
ccr stop
|
|
175
|
+
ccr start --host 127.0.0.1 --port 3458
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Docker
|
|
179
|
+
|
|
180
|
+
The repository also includes a Docker image for gateway and browser-UI deployments. It does not install the npm `ccr` command into the runtime image. See the [Docker deployment guide](https://github.com/musistudio/claude-code-router/blob/main/docker/README.md).
|
|
372
181
|
|
|
373
182
|
## License
|
|
374
183
|
|
|
375
|
-
|
|
184
|
+
[MIT](LICENSE)
|