GitHub Copilot
GitHub Copilot
Section titled “GitHub Copilot”什么是 GitHub Copilot?
Section titled “什么是 GitHub Copilot?”GitHub Copilot 是 GitHub 的 AI 编程助手。它根据您的 GitHub 账户和计划提供对 Copilot 模型的访问权限。OpenClaw 可以通过两种不同方式将 Copilot 用作模型提供商。
在 OpenClaw 中使用 Copilot 的两种方式
Section titled “在 OpenClaw 中使用 Copilot 的两种方式”1) 内置 GitHub Copilot 提供商 (github-copilot)
Section titled “1) 内置 GitHub Copilot 提供商 (github-copilot)”使用原生的设备登录流程获取 GitHub 令牌,然后在 OpenClaw 运行时将其交换为 Copilot API 令牌。这是默认且最简单的路径,因为它不需要 VS Code。
2) Copilot Proxy 插件 (copilot-proxy)
Section titled “2) Copilot Proxy 插件 (copilot-proxy)”将 Copilot Proxy VS Code 扩展用作本地桥接。OpenClaw 与代理的 /v1 端点通信,并使用您在此处配置的模型列表。当您已经在 VS Code 中运行 Copilot Proxy 或需要通过它进行路由时,请选择此项。
您必须启用该插件并保持 VS Code 扩展运行。
使用 GitHub Copilot 作为模型提供商 (github-copilot)。登录命令运行
GitHub 设备流程,保存身份验证配置文件,并更新您的配置以使用该
配置文件。
CLI 设置
Section titled “CLI 设置”openclaw models auth login-github-copilot系统将提示您访问 URL 并输入一次性代码。在完成之前请保持终端打开状态。
openclaw models auth login-github-copilot --profile-id github-copilot:workopenclaw models auth login-github-copilot --yes设置默认模型
Section titled “设置默认模型”openclaw models set github-copilot/gpt-4o{ agents: { defaults: { model: { primary: "github-copilot/gpt-4o" } } },}- 需要交互式 TTY;请直接在终端中运行它。
- Copilot 模型的可用性取决于您的计划;如果某个模型被拒绝,请尝试
另一个 ID(例如
github-copilot/gpt-4.1)。 - 登录会在配置文件存储中保存一个 GitHub 令牌,并在 API 运行时将其交换为 Copilot OpenClaw 令牌。