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