惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
Arctic Wolf
T
Tenable Blog
T
Troy Hunt's Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy & Cybersecurity Law Blog
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
S
Secure Thoughts
AWS News Blog
AWS News Blog
L
LINUX DO - 最新话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
M
MIT News - Artificial intelligence
T
Tor Project blog
S
Schneier on Security
PCI Perspectives
PCI Perspectives
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
Google DeepMind News
Google DeepMind News
V
Visual Studio Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
罗磊的独立博客
T
Threat Research - Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V
V2EX
C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
GRAHAM CLULEY
L
LINUX DO - 热门话题
D
Docker
J
Java Code Geeks
GbyAI
GbyAI
H
Heimdal Security Blog
The Hacker News
The Hacker News
MongoDB | Blog
MongoDB | Blog
V
Vulnerabilities – Threatpost
T
Tailwind CSS Blog
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog
Recorded Future
Recorded Future
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
The Register - Security
The Register - Security
Hacker News - Newest:
Hacker News - Newest: "LLM"

博客园 - 不是豆豆

切换 Google Play 国家地区 NuGet 命令行记录 在 UnionTech OS Server 20 Euler 64bit 上安装 docker 环境 在 Windows 7 SP1 或 Windows Server 2008 R2 SP1 系统中安装 ASP.NET Core 10.0 运行时环境 记录各版本 Microsoft Visual C++ Redistributable 官方下载地址 在 PolarDB-PG 上安装 pgvector 扩展 在 microsoft onnxruntime 中使用 arcface model 出错:Invalid input scale: NumDimensions() != 3 在 Windows 下为 PostgreSQL 安装 pgvector 插件 如果两个 Steam 库文件夹中,有相同的两份游戏,这时删除第二份会怎样? 当 linux 主机内存较小运行程序(如 yum update)被 Killed 迁移 Gitea 从 Windows 到 Linux Docker 容器中(使用 SQLite 数据库) 在 EF Core 中使用传统的 DbFirst 模式 在 SkiaSharp 中对图片进行缩放时,结果锯齿较多的处理方案 在 asp.net core web 项目中,创建项目时因选择容器化部署,未配置 IIS Express 应如何进行修改 如何重置 sftpgo 的管理员密码 微信鸿蒙版 8.0.14 查询 navigator.maxTouchPoints 为 0 导致的 bug 在安装 miniforge3(conda)环境后,每次启动终端(PowerShell)都非常缓慢的处理方案 在 .net framework 4.8 下,若因为安装或升级了 System.ValueTuple 出现问题 在 Windows 11 系统下,日常使用浏览器(Edge、Chrome)常遇到画面撕裂或浏览器在经切换窗口后显示内容不正常 关于 CVE-2025-55315 漏洞问题查验记录 在 gitea 服务器端查询 lfs 文件占用情况 编写 GKD 规则 在 Windows 下 .net 项目中,使用 ViGEm 模拟游戏手柄 为传统 .net framework 项目切换 nlog 日志 处理过大的 docker 日志 测试支持 PolarDB-X(高度兼容 MySQL) 的客户端图形工具 SteamDeck 重置系统密码教程 新版本 portainer ce 在操作容器时,报错 Forbidden - origin invalid
在本地 claude code 中使用 copilot pro 订阅
不是豆豆 · 2026-01-29 · via 博客园 - 不是豆豆

因为 claude code 所属公司的政策

首先订阅不方便,其次购买后也容易被封

正好微软提供了 Github Copilot 订阅可以访问使用 Claude 的模型

但 claude code 不直接能支持 copilot 订阅,需要在中间做一个转换

如:https://github.com/ericc-ch/copilot-api/

0、所有环境需要 nodejs 运行时

安装可以考虑使用 nvm 管理版本,但在使用时需要注意版本切换

如在 Windows 系统下使用:https://github.com/coreybutler/nvm-windows/releases

1、使用 nvm 安装管理 nodejs 环境

# 安装最新版(安装完成后会有提示使用版本命令)
nvm install latest

# 查看已安装版本
nvm ls

# 使用指定版本
nvm use latest

# 另外还需要配置下 Powershell 脚本执行策略,允许本地未签名脚本执行
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

2、安装运行 copilot-api 组件

# 如果想使用 Claude 系列模型,代理工具必不可少
$env:HTTP_PROXY="http://127.0.0.1:10908"
$env:HTTPS_PROXY = "http://127.0.0.1:10908"

# 配置启动时使用代理
npx copilot-api@latest start --proxy-env

# 添加 --claude-code 参数,可以在最后生成运行 claude code 并配置好使用 copilot-api 所需相关环境变量的语句
npx copilot-api@latest start --proxy-env --claude-code

第一次运行,需要跟着提示获得 GitHub 的授权

授权成功这块就配置完成了。

3、安装运行 claude

# 安装到 nodejs 全局
npm install -g @anthropic-ai/claude-code

# 查看是否安装成功
claude --version

# 可以先运行一次,生成一些默认配置
# 因为网络无法连接,运行后会报错退出
claude

更多安装方法:https://code.claude.com/docs/en/getting-started#installation

4、在 ~/.claude/ 或 %USERPROFILE%/.claude/ 目录下生成 settings.json 文件,在其中进行全局配置

也可以在项目的 .claude 文件夹下建立 settings.json 文件,按项目配置

示例如下:(注意!注释行仅为说明,实际使用需要将其中的注释行全部删除,否则会报错!)

{
  "env": {
    // 接口配置(根据 copilot-api 运行结果配置)
    "ANTHROPIC_BASE_URL": "http://localhost:4141",
    "ANTHROPIC_AUTH_TOKEN": "dummy",
    // 模型配置(请根据实际所用模型配置,claude opus 模型消耗较多)
    "ANTHROPIC_MODEL": "claude-opus-4.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-4.5",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5",
    // 禁用非必要模型请求
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
    // 禁用非必要其它请求(等于同时禁止:DISABLE_AUTOUPDATER、DISABLE_BUG_COMMAND、DISABLE_TELEMETRY、DISABLE_ERROR_REPORTING)
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    // 代理配置(请按实际情况配置)
    "HTTP_PROXY": "http://127.0.0.1:10908",
    "HTTPS_PROXY": "http://127.0.0.1:10908"
  },
  // 默认回复语言
  "language": "schinese",
  // 以下似乎为非官方明确有的配置,谨慎使用
  // 跳过 web 请求前的验证(参考:https://github.com/anthropics/claude-code/issues/6388)
  "skipWebFetchPreflight": true
}

更多环境变量说明:https://code.claude.com/docs/en/settings#environment-variables

5、在 ~/ 或 %USERPROFILE%/ 目录下找到 .claude.json 文件,添加或修改其中配置以跳过初始化账号步骤

在一级配置中找到 hasCompletedOnboarding 配置,没有就添加一个,值设为 true

示例:

{
  "numStartups": 1,
  "sonnet45MigrationComplete": true,
  "opus45MigrationComplete": true,
  "opusProMigrationComplete": true,
  "thinkingMigrationComplete": true,
  "cachedChromeExtensionInstalled": false,
  "lastReleaseNotesSeen": "2.1.31",
  "hasCompletedOnboarding": true
}

参考:https://www.cnblogs.com/gordonMlxg/articles/19103691

6、再次回到命令行中运行 claude 即可正常使用了。

日常可以通过以下地址查看 copilot-api 统计的用量情况:

https://ericc-ch.github.io/copilot-api/

其它错误处理记录(貌似新版没错了):

https://github.com/ericc-ch/copilot-api/issues/174