9router

中文文档
0.5.112发布于 2026/10/28MIT近 30 天下载 22.5万

9路特 CLI - 启动并管理9路特服务器

中文使用文档
文档目录13 节
  1. 为什么是9路特?
  2. QQ 快速启动
  3. QQ CLI 选项
  4. 连接到远程 9 路透社
  5. 模型
  6. 覆盖服务器的模型
  7. 检查当前配置
  8. 其他选择
  9. 支持的 CLI 工具
  10. 数据位置
  11. 页:1
  12. 承认
  13. 许可证

9路特 - FREE AI 路由器和托肯保护器

永不停止编码. 以RTK + 自动倒回FREE & 廉价AI模式保存20-40%的令牌.

连接所有AI代码工具(Claude Code, Cursor, Antigravity, Copilot, Codex, 双子座, OpenCode, Cline, OpenClaw...)到40+AI提供商和100+模型.

npm Downloads Docker Pulls GHCR License

decolua%2F9router | Trendshift

网站 二. 支助 完整文档


为什么是9路特?

停止浪费钱,代币和打出限制:

  • * 每月订阅配额到期
  • QQ 利率限制停止中编码
  • QQ 工具输出( git diff, grep, Is. ) 快速刻录符号
  • * 昂贵的API(每个供应商每月20-50美元)

9路特解决了这个问题:

  • ✅ RTK 托肯保护程序 - 自动压缩工具 结果, 保存 20- 40% 的令牌
  • ✅ 最大限度的订阅 - 曲目配额,在重置前使用每一分
  • ✅ 自动倒置 免费、零停机
  • ✅ 多账户 - 每家供应商账户之间的轮旋
  • ✅ 通用 - 与OpenAI/Claude兼容的CLI合作

QQ 快速启动

选项1- npm( 建议桌面):

npm install -g 9router
9router

# Or run directly with npx
npx 9router

备选案文2——多克(服务器/VPS):

docker run -d --name 9router -p 20128:20128 \
  -v "$HOME/.9router:/app/data" -e DATA_DIR=/app/data \
  decolua/9router:latest

已发布图像 : 多克枢纽 二. 支助 千兆赫 (多平台 amd64/arm64).

{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080} http://localhost:20128

2. 连接FREE供应商(不需要注册):

盘子 提供商 连接 基罗大赦国际 (自由克洛德无限)或 打开代码自由 (无授权) 完成!

3. 将以下工具用于国家领导才能工具:

Claude Code/Codex/OpenClaw/Cursor/Cline Settings:
  Endpoint: http://localhost:20128/v1
  API Key:  [copy from dashboard]
  Model:    kr/claude-sonnet-4.5

就这样! 开始用FREE AI模型编码.


QQ CLI 选项

9router                    # Start with default settings
9router --port 8080        # Custom port
9router --no-browser       # Don't open browser
9router --skip-update      # Skip auto-update check
9router --help             # Show all options

盘子数字 : http://localhost:20128/dashboard


连接到远程 9 路透社

已经在另一台机器上运行了9路透(比如在你的局域网上运行团队服务器)? 将这个机器的 CLI 工具对准它——没有开始本地服务器:

npx 9router connect http://<server-host>:20128                       # pick tools interactively
npx 9router connect http://<server-host>:20128 --tools claude,codex  # or choose up front
npx 9router connect --reset --tools claude,codex                     # undo

它使用仪表板密码( 隐藏快取) 登录、 重复使用或创建命名的 API 密钥 cli-<hostname>,并写入每个工具的配置(备份一次原作) *.bak-9router) (中文(简体) ).

支持的工具 : claude, (中文(简体) ), codex, (中文(简体) ), opencode, (中文(简体) ), droid, (中文(简体) ), crush, (中文(简体) ), kilo, (中文(简体) ), cline, (中文(简体) ), pi, (中文(简体) ), omp,或 all。 。 。 .

模型

模型来自 服务器自己的 CLI 工具配置,所以客户端得到任何 操作员已经选择在仪表板上。 没有硬码.

工具模式取自( 第一次比赛获胜)
claude分级旗 (--opus • 服务器的克洛德级 未设置 (Claude Code自己默认)
其他人员--model ~ 该工具在服务器上的自有模型 ~ 服务器的OpenCode模型 ~ 工具跳过

kilo 服务器上没有可读模型, 因此它总是使用 --model 或 OpenCode 模型. omp (Oh My Pi)不需要模型:它使用代理发现,所以每个服务器模型都出现在下面 9router 内 /model。服务器没有设置的 Claude 级从您的配置中删除, 而不是从早先的运行中删除 。 跳过的工具使命令退出 1。 。 。 .

覆盖服务器的模型

# One Claude tier; the other tiers still come from the server
npx 9router connect http://<server-host>:20128 --tools claude --sonnet cc/claude-sonnet-5-5

# Every Claude tier
npx 9router connect http://<server-host>:20128 --tools claude \
  --fable cc/claude-fable-5-1 --opus cc/claude-opus-5-5 \
  --sonnet cc/claude-sonnet-5-5 --haiku cc/claude-haiku-4-5-20251001

# All non-Claude tools at once
npx 9router connect http://<server-host>:20128 --tools codex,opencode,kilo --model ocg/deepseek-flash

# Claude and other tools in one run
npx 9router connect http://<server-host>:20128 --tools claude,codex --opus cc/claude-opus-5-5 --model gpt-6

# A different model per tool: --model covers every non-Claude tool in a run, so run once per tool
npx 9router connect http://<server-host>:20128 --tools codex --model gpt-6
npx 9router connect http://<server-host>:20128 --tools opencode --model ocg/glm-5.3

服务器未列出的模型仍然被写入,其中有一个 not listed by server 警告 警告他们 看它所服务的ID: curl http://<server-host>:20128/v1/models -H "Authorization: Bearer <your key>"。 。 。 .

检查当前配置

9router show 打印此机上每个 CLI 工具目前设定的 URL 、 遮盖的 API 密钥和模型 。 它只读取本地文件,从来不接触服务器.

npx 9router show                 # every supported tool
npx 9router show claude          # one tool
npx 9router show claude codex    # several
npx 9router show claude --json   # machine-readable (key still masked)
✅ Claude Code
   File:     ~/.claude/settings.json
   Base URL: http://<server-host>:20128/v1
   API key:  sk-a1b…9f3c
   Models:
     fable   cc/claude-fable-5-1
     opus    cc/claude-opus-5-5
     sonnet  cc/claude-sonnet-5-5

未指向9路特的工具列为 not configured。对于 Codex 、 OpenCode 和 Cline , 当一个 9router 条目存在时, 它也会发出警告, 但另一个提供者是活动者 .

其他选择

选项目的
--password <pw>密码(或 NINE_ROUTER_PASSWORD; 如果省略, 提示 —— 首选, 使其远离外壳历史
--save成功登录后, 请保存此服务器的密码到 ~/.9router/connect.env (plain text, mode 600) 所以以后会跳过提示 。 删除文件以忘记它
--api-key <key>使用此密钥并跳过登录 。 服务器的模型没有登录就无法读取,所以通过模型旗
--key-name <name>重新使用/创建的 API 密钥名( 默认) cli-<hostname>(中文(简体) )
--print-env还打印 OPENAI_BASE_URL 编号 : OPENAI_API_KEY 其他 cLI 指标
--reset从选中的工具中删除 9router 设置

见 9router connect --help 完整名单.

过平地 http:// 密码和 API 密钥是不加密发送的 —— 使用一个可信赖的局域网/ VPN 或将 HTTPS 放在前面 。 API密钥被存储在每个工具的配置文件中.


支持的 CLI 工具

Claude-Code • OpenClaw • Codex • OpenCode • Cursor • Antigravity • Cline • 继续 机器人 • Roo • 副驾驶 • Kilo 代码 • 双子座 CLI • Quen 代码 • iFlow • Crusher • Aider

任何支持OpenAI/Claude-compatiable API作品的工具.


数据位置

  • macOS/ 在线数字 : ~/.9router/db/data.sqlite
  • 窗口数字 : %APPDATA%/9router/db/data.sqlite
  • 夹克数字 : /app/data/db/data.sqlite (数目) $HOME/.9router (将持续)

页:1

完整的文档、高级设置、视频教程和开发指南 :


承认

许可证

麻省理工学院执照 - 看 自由主义 详细情况.

版本与发布记录

9router 共发布 238 个版本,首次发布于 2026/01/03;过去 12 个月发布了 238 个版本。

版本发布日期距今
0.5.112latest2026/10/288 天前
0.5.1112026/10/2610 天前
0.5.1092026/10/2313 天前
0.5.1042026/10/1521 天前
0.5.992026/10/0828 天前
0.5.952026/10/011 个月前

关于 9router 的常见问题

9router 是什么?

9路特 CLI - 启动并管理9路特服务器

如何安装 9router?

在项目目录运行 npm install 9router,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 9router,可以用 npx 9router 直接运行。

9router 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/9router 是否存在。

9router 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

9router 可以商用吗?

9router 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

9router 的下载量有多少?

根据 npm 官方下载统计,9router 在 2026/10/04 – 2026/11/02 这 30 天内被下载 224,601 次,日均约 7,487 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

9router 还在维护吗?

最新版本 0.5.112 发布于 2026/10/28(8 天前);至今共发布 238 个版本,其中过去 12 个月发布了 238 个;首次发布于 2026/01/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。