← 返回 Skills 市场
ironmanc2014

Cn Dev Setup

作者 ironmanc2014 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
177
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cn-dev-setup
功能描述
一键配置国内开发环境镜像源。解决 npm/pip/go/docker/cargo 等工具在国内下载慢、超时的问题。 支持 npm、yarn、pnpm、pip、Go (GOPROXY)、Docker、Cargo、Maven、Gradle、Homebrew 镜像源切换。 Use when: 用户说"配置镜像源"、"n...
使用说明 (SKILL.md)

CN Dev Setup — 国内开发环境镜像源配置

解决国内开发者最大的痛点:下载慢、超时、连不上。一键切换到国内镜像源。

支持的工具

工具 镜像源 命令
npm/yarn/pnpm 淘宝 npmmirror npm config set registry https://registry.npmmirror.com
pip 清华 TUNA / 阿里云 pip config set global.index-url
Go (GOPROXY) 七牛 goproxy.cn go env -w GOPROXY=https://goproxy.cn,direct
Docker 多个可选(阿里云/中科大/Docker proxy) 修改 daemon.json
Cargo (Rust) 清华 TUNA / 中科大 修改 ~/.cargo/config.toml
Maven 阿里云 maven 修改 settings.xml
Gradle 阿里云 maven 修改 build.gradle
Homebrew 清华 TUNA 环境变量设置
Git 代理配置 git config --global http.proxy

Quick Start

自动配置(推荐)

python \x3Cskill-dir>/scripts/setup_mirrors.py --all

一键配置所有已安装工具的镜像源。

按工具配置

python \x3Cskill-dir>/scripts/setup_mirrors.py npm pip go docker

只配置指定的工具。

查看当前状态

python \x3Cskill-dir>/scripts/setup_mirrors.py --status

检查每个工具当前使用的源,标注哪些还是国外源。

恢复默认源

python \x3Cskill-dir>/scripts/setup_mirrors.py --reset npm pip

恢复到官方默认源。

使用指南

交互模式

当用户说"配置镜像源"或"npm太慢"时:

  1. 运行 --status 检查当前源配置
  2. 列出需要切换的工具
  3. 确认后执行切换
  4. 验证切换结果

Git 代理配置

如果用户有 HTTP 代理(如 clash/v2ray):

# 全局代理
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

# 仅 GitHub 代理(推荐)
git config --global http.https://github.com.proxy http://127.0.0.1:7890

Docker 镜像源

Docker daemon.json 位置:

  • Linux: /etc/docker/daemon.json
  • macOS: ~/.docker/daemon.json
  • Windows: %USERPROFILE%\.docker\daemon.json 或 Docker Desktop 设置

镜像源详情

references/mirrors.md 获取完整的镜像源列表、备选源和测速方法。

故障排查

问题 原因 解决方案
npm install 仍然慢 缓存了旧源地址 npm cache clean --force 后重试
pip 提示证书错误 公司网络 MITM --trusted-host pypi.tuna.tsinghua.edu.cn
docker pull 超时 daemon.json 格式错误 检查 JSON 格式,重启 Docker 服务
go mod download 失败 GONOSUMDB 未设置 go env -w GONOSUMDB=* 跳过校验
Cargo 编译慢 crates.io 索引大 用 sparse 协议:sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/
Maven 仍用中央仓库 settings.xml 位置不对 确认文件在 ~/.m2/settings.xml
切换后部分包仍慢 镜像同步延迟 等几小时或换备选源
恢复默认源后异常 缓存残留 清除对应工具缓存目录
安全使用建议
This skill is coherent with its purpose, but exercise normal caution before running scripts that change tool config: 1) Inspect or back up config files you care about (e.g., ~/.cargo/config.toml, ~/.m2/settings.xml, shell rc files). 2) Run the script with --status first to see current settings. 3) Prefer running per-tool changes rather than --all if you want finer control. 4) The script will invoke local commands (npm, pip, go, etc.); ensure those CLIs are what you expect and not malicious wrappers. 5) Docker changes require root and are intentionally left manual — do not run random scripts with sudo. 6) Understand that switching to third-party mirrors can expose you to different trust/certificate behaviors (pip's trusted-host weakens TLS checks), so only use mirrors you trust. If you want greater assurance, run the script in a controlled environment or review its source (scripts/setup_mirrors.py) before executing.
功能分析
Type: OpenClaw Skill Name: cn-dev-setup Version: 1.0.0 The skill is a legitimate utility designed to configure Chinese mirror sources for various development tools (npm, pip, Go, Cargo, Docker, etc.) to improve download speeds. The primary logic in `scripts/setup_mirrors.py` uses standard configuration commands and modifies local configuration files (like `~/.cargo/config.toml`) in a transparent manner. It uses reputable mirrors such as Tsinghua TUNA and Aliyun, and it explicitly avoids automated modifications requiring root privileges (e.g., Docker) by prompting for manual intervention. No evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description (switching dev tool mirrors for China) aligns with included files and behavior. The SKILL.md and scripts only reference package registry mirrors (npm, pip, Go, Cargo, etc.) and commands needed to change them; nothing requests unrelated access such as cloud credentials or unrelated system services.
Instruction Scope
Runtime instructions and the Python script operate within the expected scope: they check and change tool config (npm/pip/go/git/cargo, edit ~/.cargo/config.toml, run 'npm config'/'pip config'/'go env -w', etc.). The script prints a message for Docker and does not attempt to modify /etc/docker/daemon.json itself (SKILL.md explains Docker needs manual/root changes). Note: the script uses subprocess to run commands and writes to user config files (~/.cargo) — that's expected for configuration tasks but users should be aware it will modify local config files.
Install Mechanism
No install spec; this is instruction-only plus a small included Python script. Nothing is downloaded or executed from external arbitrary URLs during install. The script is included in the bundle and runs locally.
Credentials
The skill requests no environment variables or credentials. The operations performed (changing registries, setting trusted-host for pip, writing to dotfiles) are proportionate to the stated purpose.
Persistence & Privilege
The skill is not always-enabled and does not request persistent elevated privileges. It modifies only user-level config files (and instructs manual Docker daemon edits that require admin). It does not alter other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cn-dev-setup
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cn-dev-setup 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: One-click setup for China-friendly mirrors across major dev tools. - Supports mirror/proxy switching for npm, yarn, pnpm, pip, Go, Docker, Cargo, Maven, Gradle, Homebrew, and Git. - Provides quick commands for automatic or per-tool configuration. - Includes status check and reset to default source features. - Troubleshooting section for common issues. - Step-by-step interactive guidance for mirror setup requests.
元数据
Slug cn-dev-setup
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Cn Dev Setup 是什么?

一键配置国内开发环境镜像源。解决 npm/pip/go/docker/cargo 等工具在国内下载慢、超时的问题。 支持 npm、yarn、pnpm、pip、Go (GOPROXY)、Docker、Cargo、Maven、Gradle、Homebrew 镜像源切换。 Use when: 用户说"配置镜像源"、"n... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 177 次。

如何安装 Cn Dev Setup?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cn-dev-setup」即可一键安装,无需额外配置。

Cn Dev Setup 是免费的吗?

是的,Cn Dev Setup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cn Dev Setup 支持哪些平台?

Cn Dev Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cn Dev Setup?

由 ironmanc2014(@ironmanc2014)开发并维护,当前版本 v1.0.0。

💬 留言讨论