Aider 是终端里的 AI 结对编程工具,把代码库当作上下文来编辑并自动生成 git 提交。它能连接任何 OpenAI 兼容端点,适合喜欢用命令行、并且看重 git 历史与仓库地图的工程师。
网关 base_url(国内站)https://api.shinloo.com/v1填到各工具的
base_url / OPENAI_BASE_URL / apiBase 之类设置里。OpenAI 线路填 /v1;Anthropic / Gemini 线路填网关根 https://api.shinloo.com。OpenAI 兼容调用路径https://api.shinloo.com/v1/chat/completionsOpenAI 线路的客户端用这个地址(
GET /v1/models 可查你的 Key 可用模型)。推荐模型(国内站已开通)deepseek-v4.1-flashdeepseek-v4-proqwen3.8-max以上为本站公示的模型名,实际可用清单以你的 Key 调
GET /v1/models 返回为准。省事版 — 一键接入
脚本从 Aider 的官方来源安装,把网关配置写进工具自己的配置文件
(写之前先备份原文件),再发一次真请求验证。会提示你粘贴网关 Key(也可用 --key 传入);
--uninstall 只还原它写进去的内容。
curl -fsSL https://api.shinloo.com/agents/aider/setup | bash
1 · 安装
从 Aider 自己的官方来源安装。
curl -LsSf https://aider.chat/install.sh | sh # macOS/Linux;Windows: powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex";也可 python -m pip install aider-chat
2 · 配置 — 指向国内站网关
网关 base URL https://api.shinloo.com/v1;Key 在 控制台创建。
export OPENAI_API_BASE=https://api.shinloo.com/v1 export OPENAI_API_KEY=YOUR_API_KEY aider --model openai/<model-id>
3 · 验证
发一次请求,能返回就说明走的是国内站网关。
aider --model openai/<model-id> --message "reply with OK"
4 · 常见坑
- 模型名必须带 openai/ 前缀,否则不会走 OpenAI 兼容路由。
- 使用模型名前 aider 会警告它不认识的模型——这是正常的,功能不受影响。
- 国内站只支持 OpenAI 格式,不要用 Anthropic/Gemini 相关的 aider 配置。
- 环境变量可在命令行用 --openai-api-base/--openai-api-key 覆盖,或写进
~/.aider.conf.yml持久化。
工具侧步骤的官方来源: aider.chat/docs/llms/openai-compat.html aider.chat/docs/install.html aider.chat/docs/config/options.html aider.chat/docs/config/aider_conf.html