OpenClawSkills
GitHub
模型提供商 • 5 分钟阅读

GitHub Copilot

使用设备流程从 OpenClaw 登录 GitHub Copilot

Tutorial.step

什么是 GitHub Copilot?

GitHub Copilot 是 GitHub 的 AI 编码助手。它为你的 GitHub 账户和计划提供对 Copilot 模型的访问。OpenClaw 可以通过两种不同方式将 Copilot 用作模型提供商。

Tutorial.step

在 OpenClaw 中使用 Copilot 的两种方式

#

Tutorial.step

1) 内置 GitHub Copilot 提供商(`github-copilot`)

使用本机设备登录流程获取 GitHub 令牌,然后在 OpenClaw 运行时将其交换为 Copilot API 令牌。这是默认和最简单的方式,因为它不需要 VS Code。

#

Tutorial.step

2) Copilot Proxy 插件(`copilot-proxy`)

使用 ''Copilot Proxy'' VS Code 扩展作为本地桥接。OpenClaw 与代理的 ''/v1'' 端点通信,并使用你在那里配置的模型列表。当你已经在 VS Code 中运行 Copilot Proxy 或需要通过它路由时,请选择此项。

你必须启用插件并保持 VS Code 扩展运行。

使用 GitHub Copilot 作为模型提供商(''github-copilot'')。登录命令运行 GitHub 设备流程,保存身份验证配置文件,并更新你的配置以使用该配置文件。

Tutorial.step

CLI 设置

Bash
openclaw models auth login-github-copilot

You'll be prompted to visit a URL and enter a one-time code. Keep the terminal

open until it completes.

#

Tutorial.step

可选标志

Bash
openclaw models auth login-github-copilot --profile-id github-copilot:work
openclaw models auth login-github-copilot --yes
Tutorial.step

设置默认模型

Bash
openclaw models set github-copilot/gpt-4o

#

Tutorial.step

配置片段

Json5
{
  agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } },
}
Tutorial.step

注意事项

- 需要交互式 TTY;直接在终端中运行它。

- Copilot 模型可用性取决于你的计划;如果模型被拒绝,请尝试另一个 ID(例如 ''github-copilot/gpt-4.1'')。

- 登录在身份验证配置文件存储中存储 GitHub 令牌,并在 OpenClaw 运行时将其交换为 Copilot API 令牌。