🇨🇳 China Mirror Skills
强烈推荐用agent来干安装环境的脏活, 用本skills让agent少走弯路。
安装 •
支持的工具 •
镜像源
目录
支持的工具
| 分类 | 工具 | 状态 | 镜像类型 |
|---|
| 🐍 Python (pip) | pip, uv, poetry | ✅ 可用 | Package Index |
| 📦 Node.js (npm) | npm, pnpm, yarn | ✅ 可用 | Package Index |
| 🐳 Docker Hub | Docker Hub(镜像加速) | ✅ 可用 | Registry Mirror |
| 🦀 Rust (Cargo) | Cargo | ✅ 可用 | Package Index |
| 🍺 Homebrew | Homebrew | ✅ 可用 | Git Repository |
| 🐍 Conda/Anaconda | Conda/Anaconda | ✅ 可用 | Package Index |
| 🐹 Go | Go modules | ✅ 可用 | Module Proxy |
| 📱 Flutter | Flutter SDK | ✅ 可用 | SDK Mirror |
| 🐳 Docker CE | Docker CE install | ✅ 可用 | 安装源 |
| 🐍 Python(安装本体) | python-install | ✅ 可用 | 说明 |
| 📦 Node.js(安装本体) | node-install | ✅ 可用 | 说明 |
| 🐍 Conda/Miniconda(安装本体) | conda-install | ✅ 可用 | 说明 |
| 🦀 Rust/rustup(安装本体) | rust-install | ✅ 可用 | 说明 |
| 🐹 Go(安装本体) | go-install | ✅ 可用 | 说明 |
| 🐙 GitHub Releases | GitHub Releases | ✅ 可用 | Release Asset Mirror |
| 🐙 GitHub Clone Acceleration | GitHub 仓库 clone 加速 | ✅ 可用 | Git Repository |
| 🤗 Hugging Face | Hugging Face models / datasets | ✅ 可用 | Model / Dataset Mirror |
| 🐧 Ubuntu (apt) | ubuntu | ✅ 可用 | APT Repository |
| 🏔️ Alpine Linux | alpine | ✅ 可用 | APT Repository |
核心特性
- ✅ 备份与回滚 - 修改前自动备份配置
- ✅ 代理冲突检测 - 检测代理环境变量冲突
- ✅ 幂等操作 - 重复执行安全
- ✅ 按需临时镜像 - 对 Hugging Face 下载仅在当前命令注入镜像环境变量
- ✅ 多平台支持 - Linux 为主,macOS 部分支持
- ✅ 官方来源 - 优先使用 TUNA、USTC 及厂商官方镜像
安装
本项目是一个 Claude Code Plugin,包含自包含的 china-mirror skill,提供镜像配置和网络诊断功能。
方式一:Plugin 安装(推荐)
在 Claude Code 中执行:
# 添加 marketplace
/plugin marketplace add https://github.com/loredunk/china-mirror-skills
# 安装插件
/plugin install china-mirror-skills@china-mirror-market
方式二:手动安装
# 克隆项目
git clone https://github.com/loredunk/china-mirror-skills.git
# 安装 skill 到 Claude Code 全局目录
cp -r china-mirror-skills/china-mirror ~/.claude/skills/
安装后使用
直接向 Claude Code 提问即可:
"帮我配置适合中国网络的开发环境"
"pip install 太慢了,帮我配置国内镜像"
"诊断我的开发环境网络问题"
对于其他agent
- OpenCode — 将
china-mirror/skills/china-mirror 复制到 OpenCode 的 skills 存储路径
- OpenClaw — 将
china-mirror/skills/china-mirror 复制到 ~/.openclaw/skills/china-mirror(全局)或当前工作区的 skills/china-mirror(项目级)
- Codex / 其他兼容工具 — 将
china-mirror/skills/china-mirror(包含 SKILL.md 和 scripts/)放入工具对应的 skills 目录
Skill 功能
| 功能 | 触发场景 |
|---|
| 一键配置 | "配置国内镜像"、新机器初始化、全部工具一次性配置 |
| 单工具修复 | "pip 太慢"、"npm 超时"、指定某个工具配置镜像 |
| 网络诊断 | "为什么下载慢"、"诊断网络"、检查已安装工具的镜像状态 |
| 备份还原 | 备份当前配置、还原到修改前的状态 |
| Hugging Face 下载 | "帮我下模型"、"hf 下载太慢"、临时使用镜像下载模型或数据集 |
Hugging Face
项目内置了 Hugging Face 的临时镜像下载方式,默认不会写入 shell profile,也不会长期污染环境变量。
一次性使用 huggingface-cli
HF_ENDPOINT=https://hf-mirror.com huggingface-cli download gpt2
HF_ENDPOINT=https://hf-mirror.com huggingface-cli download --repo-type dataset wget2 --local-dir ./wget2
使用内置 hfd.sh
bash china-mirror/skills/china-mirror/scripts/huggingface/download.sh gpt2 --tool hfd
bash china-mirror/skills/china-mirror/scripts/huggingface/download.sh meta-llama/Llama-2-7b --tool hfd --hf_username <your-username> --hf_token <your-token>
- 默认临时注入
HF_ENDPOINT=https://hf-mirror.com
- 若需要直连官方源,可显式传
--mirror official
hfd.sh 来源与用法参考:
https://hf-mirror.com/
https://gist.github.com/padeoe/697678ab8e528b85a2a7bddafea1fa4f
镜像源
当前镜像状态
镜像数据最后更新: 2026-05-08
健康检查时间: 2026-06-18T02:36:43.382352Z
汇总: 37/38 个镜像可用(97.37%)
有健康检查报告时,下表按每日健康检查结果动态排序;无报告时回退到静态优先级。
💡 不想安装 Skill? 每个分类下方都附了 🚀 不安装 Skill 也能用 折叠块,
展开复制里面的命令即可临时切换到推荐镜像(默认是健康检查得分最高的那一个)。
如果需要同时管理多个工具、自动备份回滚、检测代理冲突,再考虑安装本仓库 Skill。
🐍 Python (pip)
🚀 不安装 Skill 也能用:复制下面这段(推荐镜像:Alibaba Cloud PyPI Mirror)
# 一次性使用(仅当前命令)
pip install -i https://mirrors.aliyun.com/pypi/simple <package>
# 当前 shell 生效(关闭终端后失效)
export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple
# 永久写入用户配置
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
📦 Node.js (npm)