@musistudio/claude-code-router 1.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/.dockerignore +2 -0
- package/README.md +47 -0
- package/config.json +7 -0
- package/dist/cli.js +36506 -0
- package/docker-compose.yml +13 -0
- package/dockerfile +12 -0
- package/package.json +33 -0
- package/plugins/deepseek.js +139 -0
- package/plugins/gemini.js +23 -0
- package/tsconfig.json +20 -0
package/.dockerignore
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Claude Code Router
|
|
2
|
+
|
|
3
|
+
> This is a repository for testing routing Claude Code requests to different models.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Install Claude Code
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm install -g @anthropic-ai/claude-code
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Install Claude Code Router
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npm install -g @musistudio/claude-code-router
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. Start Claude Code by claude-code-router
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
ccr code
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Plugin
|
|
27
|
+
|
|
28
|
+
The plugin allows users to rewrite Claude Code prompt and custom router. The plugin path is in `$HOME/.claude-code-router/plugins`. Currently, there are two demos available:
|
|
29
|
+
1. [custom router](https://github.com/musistudio/claude-code-router/blob/dev/custom-prompt/plugins/deepseek.js)
|
|
30
|
+
2. [rewrite prompt](https://github.com/musistudio/claude-code-router/blob/dev/custom-prompt/plugins/gemini.js)
|
|
31
|
+
|
|
32
|
+
You need to move them to the `$HOME/.claude-code-router/plugins` directory and configure 'usePlugin' in `$HOME/.claude-code-router/config.json`,like this:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"usePlugin": "gemini",
|
|
37
|
+
"LOG": true,
|
|
38
|
+
"OPENAI_API_KEY": "",
|
|
39
|
+
"OPENAI_BASE_URL": "",
|
|
40
|
+
"OPENAI_MODEL": ""
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
- [x] Plugins
|
|
46
|
+
- [ ] Support change models
|
|
47
|
+
- [ ] Suport scheduled tasks
|