Copilot Auto
GitHub Copilot Auto model selection for OpenCode V2
4
近 30 天 +1
290
近 7 天 224
42.6
生态多维模型
13 天前
2026-09-22
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@opeoginni/opencode-copilot-auto@1.0.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@opeoginni/opencode-copilot-auto@1.0.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @opeoginni/opencode-copilot-autoOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Adds GitHub Copilot's Auto model to OpenCode V2. Pick github-copilot/auto and Copilot chooses which of your available models handles each prompt, the same way Auto works in VS Code.
Requires OpenCode 2.x. For OpenCode 1, use 0.1.x.
Setup
Connect GitHub Copilot in OpenCode (/connect), then add the plugin to opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["@opeoginni/opencode-copilot-auto"]
}
Restart OpenCode and select Auto under GitHub Copilot in the model picker. It only appears once Copilot is connected.
How it works
Each request to auto is sent to Copilot's routing endpoint, which picks a model from those available on your plan. The plugin then makes the real request with that model over its native protocol (Responses for GPT-5 and newer, Chat Completions otherwise), so tools, images and reasoning behave exactly as they do when you select the model directly.
Routing happens once per user prompt; tool calls within the same turn reuse the choice.
Options
{
"plugins": [
{
"package": "@opeoginni/opencode-copilot-auto",
"options": { "sticky": true, "notifications": true }
}
]
}
| Option | Default | Description |
|---|---|---|
sticky |
false |
false: Copilot picks a model for every prompt. true: the first model Copilot picks is kept for the whole session. |
notifications |
false |
Show a toast naming the model Copilot picked. Fires once per prompt, or once per session when sticky is on. Mostly useful while developing. |
OpenCode does not record which model answered on the message itself, so the toast is the only place the choice is visible.
Development
bun install
bun run check
bun test
bun run build
To try the plugin locally without publishing, copy the example config, build, and start an isolated OpenCode in this directory:
cp opencode.example.jsonc opencode.jsonc
bun run build
opencode --standalone
opencode.jsonc points at ./dist, so rebuild after changes. Running with --standalone keeps the test server separate from your regular OpenCode service.
同类生态推荐
Copilot Delegate
opencode-copilot-delegate
OpenCode plugin that delegates tasks to GitHub Copilot CLI as background subprocesses
Copilot Usage Detector
opencode-copilot-usage-detector
OpenCode plugin that tracks GitHub Copilot token usage, learns rate limits empirically, and proactively informs the user
Copilot Statusline
opencode-copilot-statusline
OpenCode TUI plugin: display GitHub Copilot quota (premium requests, with a chat fallback for Copilot Free) in the footer statusline. V2-native, zero-config, no cookies.