@halilertekin/claude-code-router-config 1.2.2 → 1.2.3
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/NPM_README.md +165 -0
- package/package.json +5 -2
- package/postinstall.js +13 -0
package/NPM_README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Claude Code Router Config
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/@halilertekin%2Fclaude-code-router-config)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
Multi-provider configuration for Claude Code Router with intelligent intent-based routing.
|
|
7
|
+
|
|
8
|
+
## Quick Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g claude-code-router-config
|
|
12
|
+
ccr-setup
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **🤖 7 AI Providers**: OpenAI, Anthropic, Gemini, Qwen, GLM, OpenRouter, GitHub Copilot
|
|
18
|
+
- **🎯 Smart Routing**: Automatically selects the best model based on your request
|
|
19
|
+
- **💰 Cost Optimized**: Simple tasks use cheaper models
|
|
20
|
+
- **⚡ Performance**: Fast responses use optimized models
|
|
21
|
+
- **🛠️ Easy Setup**: One-command installation
|
|
22
|
+
- **📝 Environment Support**: `.env` file support
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @halilertekin/claude-code-router-config
|
|
28
|
+
ccr-setup
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Option 2: Homebrew
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
brew install claude-code-router-config
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Option 3: Manual
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/YOUR_USERNAME/claude-code-router-config.git
|
|
41
|
+
cd claude-code-router-config
|
|
42
|
+
chmod +x install.sh
|
|
43
|
+
./install.sh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Setup
|
|
47
|
+
|
|
48
|
+
After installation:
|
|
49
|
+
|
|
50
|
+
1. **Edit API keys** in `~/.env`:
|
|
51
|
+
```bash
|
|
52
|
+
nano ~/.env
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. **Add to shell** (`~/.zshrc` or `~/.bashrc`):
|
|
56
|
+
```bash
|
|
57
|
+
# Load .env variables
|
|
58
|
+
export $(cat ~/.env | xargs)
|
|
59
|
+
|
|
60
|
+
# Router connection
|
|
61
|
+
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
|
|
62
|
+
export NO_PROXY="127.0.0.1"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. **Reload shell**:
|
|
66
|
+
```bash
|
|
67
|
+
source ~/.zshrc
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
4. **Start router**:
|
|
71
|
+
```bash
|
|
72
|
+
ccr code
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## API Keys
|
|
76
|
+
|
|
77
|
+
Get your API keys:
|
|
78
|
+
|
|
79
|
+
| Provider | Link |
|
|
80
|
+
|----------|------|
|
|
81
|
+
| OpenAI | https://platform.openai.com/api-keys |
|
|
82
|
+
| Anthropic | https://console.anthropic.com/settings/keys |
|
|
83
|
+
| Gemini | https://aistudio.google.com/apikey |
|
|
84
|
+
| Qwen | https://dashscope.console.aliyun.com/apiKey |
|
|
85
|
+
| GLM | https://open.bigmodel.cn/usercenter/apikeys |
|
|
86
|
+
| OpenRouter | https://openrouter.ai/keys |
|
|
87
|
+
| GitHub Copilot | https://github.com/settings/tokens |
|
|
88
|
+
|
|
89
|
+
## Usage
|
|
90
|
+
|
|
91
|
+
### Basic Commands
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
ccr start # Start router
|
|
95
|
+
ccr code # Start with Claude Code
|
|
96
|
+
ccr status # Check status
|
|
97
|
+
ccr stop # Stop router
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Switch Models (Runtime)
|
|
101
|
+
|
|
102
|
+
Inside Claude Code:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
/model openai,gpt-4o
|
|
106
|
+
/model anthropic,claude-sonnet-4-latest
|
|
107
|
+
/model gemini,gemini-2.5-flash
|
|
108
|
+
/model qwen,qwen-plus
|
|
109
|
+
/model glm,glm-4.6
|
|
110
|
+
/model copilot,copilot
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Smart Routing Examples
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Coding → OpenAI
|
|
117
|
+
claude "Write a Python sorting function"
|
|
118
|
+
|
|
119
|
+
# Analysis → Anthropic
|
|
120
|
+
claude "Explain microservices architecture"
|
|
121
|
+
|
|
122
|
+
# Quick summary → Gemini
|
|
123
|
+
claude "Quick summary of REST APIs"
|
|
124
|
+
|
|
125
|
+
# Simple task → Qwen
|
|
126
|
+
claude "List files in directory"
|
|
127
|
+
|
|
128
|
+
# Translation → GLM
|
|
129
|
+
claude "Translate to Chinese: Hello"
|
|
130
|
+
|
|
131
|
+
# Coding help → GitHub Copilot
|
|
132
|
+
claude "Help me debug this React component"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Configuration Files
|
|
136
|
+
|
|
137
|
+
The installer creates:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
~/.claude-code-router/
|
|
141
|
+
├── config.json # Provider configuration
|
|
142
|
+
├── intent-router.js # Smart routing logic
|
|
143
|
+
└── logs/ # Log files
|
|
144
|
+
|
|
145
|
+
~/.env # API keys (created from .env.example)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
- [Complete Documentation](https://github.com/halilertekin/claude-code-router-config/docs/FULL_DOCUMENTATION_EN.md)
|
|
151
|
+
- [GitHub Repository](https://github.com/halilertekin/claude-code-router-config)
|
|
152
|
+
|
|
153
|
+
## Attribution
|
|
154
|
+
|
|
155
|
+
This package provides configuration for [@musistudio/claude-code-router](https://github.com/musistudio/claude-code-router), the original tool that enables Claude Code functionality with multiple AI providers.
|
|
156
|
+
|
|
157
|
+
The original Claude Code Router project is developed and maintained by musistudio. This package contains pre-configured routing logic and provider configurations.
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT © [Halil Ertekin](https://github.com/halilertekin)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
**Note**: This is a configuration package. Requires the original [@musistudio/claude-code-router](https://github.com/musistudio/claude-code-router) to function.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halilertekin/claude-code-router-config",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Multi-provider configuration for Claude Code Router with intent-based routing, advanced CLI tools, analytics, and smart routing. Setup OpenAI, Anthropic, Gemini, Qwen, GLM, OpenRouter, and GitHub Copilot with intelligent routing.",
|
|
5
5
|
"main": "install.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,10 +28,13 @@
|
|
|
28
28
|
"plugins/",
|
|
29
29
|
"web-dashboard/",
|
|
30
30
|
"install.sh",
|
|
31
|
+
"install.js",
|
|
32
|
+
"postinstall.js",
|
|
31
33
|
".env.example",
|
|
32
34
|
"docs/",
|
|
33
35
|
"LICENSE",
|
|
34
|
-
"README.md"
|
|
36
|
+
"README.md",
|
|
37
|
+
"NPM_README.md"
|
|
35
38
|
],
|
|
36
39
|
"keywords": [
|
|
37
40
|
"claude",
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
console.log(chalk.cyan(`
|
|
6
|
+
╔════════════════════════════════════════════╗
|
|
7
|
+
║ Claude Code Router Config - Installed! ║
|
|
8
|
+
╚════════════════════════════════════════════╝
|
|
9
|
+
|
|
10
|
+
To complete setup:
|
|
11
|
+
1. Add your API keys to ~/.env
|
|
12
|
+
2. Run: ccr-setup
|
|
13
|
+
`));
|