coding-helper 配置助手

qiniu-coding-helper 是一个用于统一配置 AI 编程助手的 CLI 工具。它可以通过交互式向导配置语言、接入线路、API Key、目标工具和模型,并把配置写入对应工具的本地配置文件。

在 Modelink 文档中,它作为“自动配置方式”使用:如果你的团队需要批量配置 Claude Code、Codex、CodeBuddy、WorkBuddy 或 Hermes Agent,优先使用该工具;如果目标工具暂未覆盖,再参考各工具页面手动配置。

适用场景

  • 首次在本机配置编程助手接入 Modelink。
  • 团队希望统一接入点、模型和工具配置方式。
  • 需要快速切换或重写 Claude Code、Codex、CodeBuddy、WorkBuddy、Hermes Agent 的配置。
  • 排查工具是否正确使用 Modelink Base URL、API Key 和模型。

前置要求

  • 已安装 Node.js 18 或更高版本。
  • 已在 Modelink 控制台获取 API Key。
  • 已安装需要配置的目标工具,例如 Claude Code、Codex、CodeBuddy、WorkBuddy 或 Hermes Agent。
  • 明确要选择的 Modelink 线路和模型 ID:中国大陆业务选择 https://api.qnaigc.com,海外部署或跨境访问选择 https://api.modelink.ai

警告

qiniu-coding-helper 会写入本机工具配置文件,其中可能包含 API Key。请把这些配置文件按敏感凭证处理,不要提交到仓库、截图或公开工单。

快速开始

无需全局安装,直接运行:

npx qiniu-coding-helper

按向导完成:

  1. 选择界面语言。
  2. 选择线路:中国大陆业务选择 https://api.qnaigc.com,海外部署或跨境访问选择 https://api.modelink.ai
  3. 输入并验证 Modelink API Key。
  4. 选择要配置的编程助手。
  5. 选择或输入模型。
  6. 重启目标工具,使配置生效。

支持的工具

工具类型写入的配置
Claude CodeCLI~/.claude/settings.json~/.claude.json
CodexCLI~/.codex/config.toml~/.codex/auth.json
CodeBuddyCLI~/.codebuddy/models.json
WorkBuddy桌面应用~/.workbuddy/models.json
Hermes AgentCLI~/.hermes/config.yaml

常用命令

# 运行交互式配置向导
npx qiniu-coding-helper

# 强制重新初始化
npx qiniu-coding-helper init

# 交互式管理 API Key
npx qiniu-coding-helper auth

# 删除本地保存的 API Key
npx qiniu-coding-helper auth revoke

# 检查配置、网络、API Key 和工具安装状态
npx qiniu-coding-helper doctor

# 进入某个工具的配置菜单
npx qiniu-coding-helper enter codex

# 重新写入某个工具配置
npx qiniu-coding-helper auth reload codex

工具配置入口

不同工具的重载命令如下:

npx qiniu-coding-helper auth reload claude
npx qiniu-coding-helper auth reload codex
npx qiniu-coding-helper auth reload codebuddy
npx qiniu-coding-helper auth reload workbuddy
npx qiniu-coding-helper auth reload hermes

如果只想进入某个工具的配置菜单,可以使用:

npx qiniu-coding-helper enter claude-code
npx qiniu-coding-helper enter codex
npx qiniu-coding-helper enter codebuddy
npx qiniu-coding-helper enter workbuddy
npx qiniu-coding-helper enter hermes

配置文件说明

文件说明
~/.coding-helper/config.yaml保存语言、线路、API Key 和模型等工具自身配置
~/.claude/settings.jsonClaude Code 的环境变量和接入点配置
~/.codex/config.tomlCodex 的 provider 与 profile 配置
~/.codex/auth.jsonCodex 的 API Key 认证缓存
~/.codebuddy/models.jsonCodeBuddy 模型列表与能力信息
~/.workbuddy/models.jsonWorkBuddy 模型列表与能力信息
~/.hermes/config.yamlHermes Agent 的 custom provider 和默认模型配置

信息

修改配置后需要完整重启目标工具。仅重新打开项目或刷新页面不一定能重新读取本地配置。

与手动配置的关系

qiniu-coding-helper 适合自动写入已支持工具的本地配置。手动配置仍然适用于以下情况:

  • 目标工具不在支持列表中。
  • 你需要自定义 provider、profile、模型别名或安全策略。
  • 团队有自己的配置管理、密钥管理或设备管理流程。
  • 需要在 CI/CD、容器或远程开发环境中以非交互方式注入配置。

排障建议

  • 先运行 npx qiniu-coding-helper doctor,确认 Node.js、网络、API Key 和目标工具安装状态。
  • 修改 API Key 后运行 auth reload <tool> 重新写入目标工具配置。
  • 工具仍未生效时,完整重启对应 CLI、桌面应用或终端会话。
  • 如果 shell 中存在旧的环境变量,可能覆盖工具配置;需要清理后重新启动。
  • 如果模型列表为空,先确认 API Key 可用、线路选择正确,并在 Modelink 控制台确认目标模型可用。
  • 如果配置文件包含 API Key,请按密码文件处理,避免复制到日志、工单或公开仓库。

参考