← 返回
未分类

China Mirror

国内镜像源加速。生成下载/安装命令时自动添加大厂/高校背书的可信镜像参数。
国内镜像加速。生成下载/安装命令时自动加入可信镜像参数。
xiaomiba0904 xiaomiba0904 来源
未分类 clawhub v3.0.0 1 版本 99693.3 Key: 无需
★ 0
Stars
📥 325
下载
💾 1
安装
1
版本
#latest

概述

China Mirror — 国内镜像源

核心规则

  1. 任何可能触发网络下载的命令,自动添加国内镜像参数
  2. 只使用以下镜像源,禁止使用无背书的不明镜像

示例:

  • 用户:"安装 lodash" → 生成:npm install lodash --registry=https://registry.npmmirror.com
  • 用户:"pip 安装 requests" → 生成:pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple

可信镜像源(大厂/高校背书)

命令行参数

工具参数镜像背书方
--------------------------
npm/pnpm/yarn/bun--registry=https://registry.npmmirror.com淘宝阿里巴巴 ✅
pip/pip3/uv/poetry-i https://pypi.tuna.tsinghua.edu.cn/simple清华清华大学 ✅
conda/mamba-c https://mirrors.tuna.tsinghua.edu.cn/anaconda清华清华大学 ✅
gem/bundle--source https://mirrors.tuna.tsinghua.edu.cn/rubygems/清华清华大学 ✅
flutter pub/dart pub--server=https://pub.flutter-io.cnFlutter CN社区 ✅
composer--repository-url=https://mirrors.aliyun.com/composer/阿里云阿里云 ✅
nuget/dotnet--source https://repo.huaweicloud.com/repository/nuget/v3/index.json华为云华为云 ✅

环境变量配置

工具环境变量
---------------------
cargoCARGO_REGISTRY配置 ~/.cargo/config.toml
rustupRUSTUP_DIST_SERVERhttps://mirrors.ustc.edu.cn/rust-static
goGOPROXYhttps://goproxy.cn,direct
dockerregistry-mirrors配置 daemon.json
brewHOMEBREW_*清华镜像环境变量
pyenvPYTHON_BUILD_MIRROR_URLhttps://mirrors.tuna.tsinghua.edu.cn/python-build/
nvmNVM_NODEJS_ORG_MIRRORhttps://npmmirror.com/mirrors/node/
fnm/volta*_MIRRORhttps://npmmirror.com/mirrors/node/
rbenvRUBY_BUILD_MIRROR_URLhttps://mirrors.tuna.tsinghua.edu.cn/ruby-build/
gvmGO_BINARY_BASE_URLhttps://mirrors.ustc.edu.cn/golang/
sdkmansdkman_candidates_mirrorhttps://mirrors.tuna.tsinghua.edu.cn/sdkman/
tfenvTFENV_TERRAFORM_MIRRORhttps://mirrors.tuna.tsinghua.edu.cn/terraform/
asdfASDF_*_MIRROR参考上述各语言镜像
juliaJULIA_PKG_SERVERhttps://mirrors.ustc.edu.cn/julia/
Roptions(repos)https://mirrors.tuna.tsinghua.edu.cn/CRAN/
maven/gradle配置文件https://maven.aliyun.com/repository/public
helmhelm repo addhttps://mirror.azure.cn/kubernetes/charts/

系统包管理器

系统镜像源背书方
----------------------
Ubuntu/Debianmirrors.aliyun.com阿里云 ✅
CentOS/RHELmirrors.aliyun.com阿里云 ✅
Alpinemirrors.aliyun.com/alpine/阿里云 ✅
Archmirrors.tuna.tsinghua.edu.cn/archlinux/清华 ✅

备选镜像

工具备选背书方
--------------------
npmhttps://repo.huaweicloud.com/repository/npm/华为云 ✅
piphttps://mirrors.aliyun.com/pypi/simple/阿里云 ✅
piphttps://pypi.mirrors.ustc.edu.cn/simple/中科大 ✅
cargohttps://rsproxy.cn/字节跳动 ✅
gohttps://mirrors.aliyun.com/goproxy/阿里云 ✅
dockerhttps://mirror.ccs.tencentyun.com腾讯云 ✅

判断逻辑

AI 生成命令时,自动判断:

1. 是否涉及网络下载?

直接下载命令:

  • 包安装:npm install, pip install, gem install, composer require...
  • 版本安装:pyenv install, nvm install, rustup toolchain install...
  • 镜像拉取:docker pull, docker build...
  • 仓库克隆:git clone(GitHub 可提示使用代理)
  • 系统更新:apt install, brew install, apk add...

间接触发下载的命令:

  • npm run / yarn run / pnpm run — 依赖缺失时自动下载
  • npm test / npm start / npm build — 同上
  • npx — 临时下载执行
  • uv run — 自动安装依赖
  • cargo build / cargo run — 首次构建下载依赖
  • go build / go run — 下载模块依赖

判断原则:

  • 如果命令可能触发网络请求,且环境未配置镜像 → 提示配置镜像
  • 如果用户已配置镜像环境变量 → 正常执行

2. 如何添加镜像?

支持命令行参数:

npm install pkg --registry=https://registry.npmmirror.com
pip install pkg -i https://pypi.tuna.tsinghua.edu.cn/simple

不支持命令行参数:

  • 提示用户配置环境变量(如 GOPROXY, NVM_NODEJS_ORG_MIRROR
  • 或在命令前临时设置:NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/ nvm install 20

3. 跳过情况

  • 命令中已有镜像参数 → 跳过
  • 用户明确指定其他源 → 跳过
  • 纯本地命令(无网络请求)→ 跳过

安全声明

背书方:

  • 大厂:阿里巴巴、华为云、腾讯云、字节跳动、网易、七牛云
  • 高校:清华大学、中国科学技术大学

禁止使用无背书的不明镜像源。

版本历史

共 1 个版本

  • v3.0.0 当前
    2026-05-07 06:13 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,542
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,379 📥 320,577
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 811,250