← Back to Skills Marketplace
ironmanc2014

Cn Dev Setup

by ironmanc2014 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
177
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install cn-dev-setup
Description
一键配置国内开发环境镜像源。解决 npm/pip/go/docker/cargo 等工具在国内下载慢、超时的问题。 支持 npm、yarn、pnpm、pip、Go (GOPROXY)、Docker、Cargo、Maven、Gradle、Homebrew 镜像源切换。 Use when: 用户说"配置镜像源"、"n...
README (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
切换后部分包仍慢 镜像同步延迟 等几小时或换备选源
恢复默认源后异常 缓存残留 清除对应工具缓存目录
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install cn-dev-setup
  3. After installation, invoke the skill by name or use /cn-dev-setup
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug cn-dev-setup
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Cn Dev Setup?

一键配置国内开发环境镜像源。解决 npm/pip/go/docker/cargo 等工具在国内下载慢、超时的问题。 支持 npm、yarn、pnpm、pip、Go (GOPROXY)、Docker、Cargo、Maven、Gradle、Homebrew 镜像源切换。 Use when: 用户说"配置镜像源"、"n... It is an AI Agent Skill for Claude Code / OpenClaw, with 177 downloads so far.

How do I install Cn Dev Setup?

Run "/install cn-dev-setup" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Cn Dev Setup free?

Yes, Cn Dev Setup is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Cn Dev Setup support?

Cn Dev Setup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Cn Dev Setup?

It is built and maintained by ironmanc2014 (@ironmanc2014); the current version is v1.0.0.

💬 Comments