@dedenlabs/claude-code-router-cli 2.0.1 → 2.0.2
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 +30 -26
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
[](https://github.com/dedenlabs/claude-code-router-cli)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
@@ -93,7 +93,11 @@ npm install @dedenlabs/claude-code-router-cli
|
|
|
93
93
|
|
|
94
94
|
**启动路由服务:**
|
|
95
95
|
```bash
|
|
96
|
+
# 前台运行
|
|
96
97
|
ccr start
|
|
98
|
+
# 或
|
|
99
|
+
# 后台运行
|
|
100
|
+
ccr start -b
|
|
97
101
|
```
|
|
98
102
|
|
|
99
103
|
**配置 Claude 环境变量:**
|
|
@@ -183,8 +187,8 @@ ccr stop # 停止服务
|
|
|
183
187
|
```javascript
|
|
184
188
|
// external-rules/user-preference.js
|
|
185
189
|
const userPreferences = {
|
|
186
|
-
'premium@company.com': { provider: 'opus
|
|
187
|
-
'standard@company.com': { provider: 'sonnet
|
|
190
|
+
'premium@company.com': { provider: 'opus', model: 'glm-4.6' },
|
|
191
|
+
'standard@company.com': { provider: 'sonnet', model: 'glm-4.5-air' }
|
|
188
192
|
};
|
|
189
193
|
|
|
190
194
|
function checkUserPreference(context) {
|
|
@@ -444,6 +448,8 @@ lsof -i :3456
|
|
|
444
448
|
|
|
445
449
|
# 更换端口
|
|
446
450
|
ccr start --port 3457
|
|
451
|
+
# 后台运行
|
|
452
|
+
ccr start -b
|
|
447
453
|
```
|
|
448
454
|
|
|
449
455
|
**Q: 路由不生效,模型没有切换**
|
|
@@ -510,10 +516,7 @@ npm install
|
|
|
510
516
|
|
|
511
517
|
# 构建项目
|
|
512
518
|
npm run build
|
|
513
|
-
|
|
514
|
-
# 运行测试
|
|
515
|
-
npm test
|
|
516
|
-
|
|
519
|
+
|
|
517
520
|
# 开发模式
|
|
518
521
|
npm run dev
|
|
519
522
|
```
|
|
@@ -562,21 +565,27 @@ export class MyTransformer extends BaseTransformer {
|
|
|
562
565
|
- 将最常用的规则放在前面(高优先级)
|
|
563
566
|
- 避免复杂的条件判断
|
|
564
567
|
- 合理设置缓存TTL
|
|
568
|
+
|
|
565
569
|
|
|
566
|
-
|
|
570
|
+
## 📈 版本历史
|
|
567
571
|
|
|
568
|
-
|
|
569
|
-
# 查看性能统计
|
|
570
|
-
ccr stats
|
|
572
|
+
### v2.0.2 (2025-12-14)
|
|
571
573
|
|
|
572
|
-
|
|
573
|
-
ccr monitor --memory
|
|
574
|
+
**📚 文档修复**
|
|
574
575
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
**✅ README文档更新**
|
|
577
|
+
- 修复版本徽章显示错误(从2.0.0更新为2.0.2)
|
|
578
|
+
- 更新版本历史记录,添加v2.0.1和v2.0.2的详细说明
|
|
579
|
+
- 完善命令行使用示例和文档描述
|
|
578
580
|
|
|
579
|
-
|
|
581
|
+
### v2.0.1 (2025-12-14)
|
|
582
|
+
|
|
583
|
+
**🎯 用户体验优化**
|
|
584
|
+
|
|
585
|
+
**✅ 前台模式默认运行**
|
|
586
|
+
- `ccr start` 默认在前台运行,显示详细运行信息
|
|
587
|
+
- 可通过 `--background` / `-b` 参数切换到后台模式
|
|
588
|
+
- 更新命令行帮助文档和使用示例
|
|
580
589
|
|
|
581
590
|
### v2.0.0 (2025-12-14)
|
|
582
591
|
|
|
@@ -612,7 +621,7 @@ ccr stats --rules
|
|
|
612
621
|
- 确保路由决策的准确性和稳定性
|
|
613
622
|
- 提供模拟测试和性能监控工具
|
|
614
623
|
|
|
615
|
-
### v1.x (
|
|
624
|
+
### v1.x (原版本)
|
|
616
625
|
- 基础路由功能
|
|
617
626
|
- 固定规则配置
|
|
618
627
|
|
|
@@ -625,8 +634,7 @@ ccr stats --rules
|
|
|
625
634
|
| **日志系统** | 基础输出 | ✅ 可视化智能日志 |
|
|
626
635
|
| **配置迁移** | 手动 | ✅ 自动迁移工具 |
|
|
627
636
|
| **思考模式** | 无 | ✅ GLM思考转换器 |
|
|
628
|
-
| **包名** | @musistudio/... | @dedenlabs/... |
|
|
629
|
-
| **文档** | 基础 | ✅ 完整示例和指南 |
|
|
637
|
+
| **包名** | @musistudio/... | @dedenlabs/... |
|
|
630
638
|
|
|
631
639
|
## 📄 许可证
|
|
632
640
|
|
|
@@ -634,16 +642,12 @@ MIT License - 与原版保持一致
|
|
|
634
642
|
|
|
635
643
|
## 🙏 致谢
|
|
636
644
|
|
|
637
|
-
- **musistudio** - 原版项目作者
|
|
638
|
-
- **社区贡献者** - 测试和反馈
|
|
639
|
-
- **GLM团队** - 提供优质模型支持
|
|
645
|
+
- **musistudio** - 原版项目作者
|
|
640
646
|
|
|
641
647
|
---
|
|
642
648
|
|
|
643
649
|
<div align="center">
|
|
644
|
-
|
|
645
|
-
**[⬆ 回到顶部](#claude-code-router-cli-v20)**
|
|
646
|
-
|
|
650
|
+
|
|
647
651
|
[🐛 报告问题](https://github.com/dedenlabs/claude-code-router-cli/issues) •
|
|
648
652
|
[💡 功能建议](https://github.com/dedenlabs/claude-code-router-cli/issues) •
|
|
649
653
|
[📖 完整文档](./docs/UNIFIED_ROUTER_GUIDE.md)
|
package/dist/cli.js
CHANGED
|
@@ -58274,7 +58274,7 @@ var require_package3 = __commonJS({
|
|
|
58274
58274
|
"package.json"(exports2, module2) {
|
|
58275
58275
|
module2.exports = {
|
|
58276
58276
|
name: "@dedenlabs/claude-code-router-cli",
|
|
58277
|
-
version: "2.0.
|
|
58277
|
+
version: "2.0.2",
|
|
58278
58278
|
description: "\u57FA\u4E8E@musistudio/claude-code-router\u7684\u589E\u5F3A\u7248CLI\u8DEF\u7531\u5DE5\u5177 - \u652F\u6301\u7EDF\u4E00\u8DEF\u7531\u5F15\u64CE\u3001\u5916\u90E8\u89C4\u5219\u52A0\u8F7D\u3001\u667A\u80FD\u65E5\u5FD7\u7CFB\u7EDF\u3001\u81EA\u52A8\u914D\u7F6E\u8FC1\u79FB\u548CGLM\u601D\u8003\u6A21\u5F0F",
|
|
58279
58279
|
bin: {
|
|
58280
58280
|
ccr: "dist/cli.js"
|