← 返回
开发者工具

china-mirror-skills

Main entry point for configuring and diagnosing all development tools in China's network environment. Detects installed tools (pip/uv/poetry, npm/yarn/pnpm,...
用于在中国网络环境下配置和诊断所有开发工具的主入口。检测已安装的工具(pip/uv/poetry、npm/yarn/pnpm……)
loredunk
开发者工具 clawhub v1.0.0 1 版本 99809.2 Key: 无需
★ 0
Stars
📥 523
下载
💾 12
安装
1
版本
#latest

概述

Bootstrap China Network Environment

One-stop configuration and diagnostics for all development tools in China. Diagnose first, then apply fixes.

All setup scripts are bundled under this skill's scripts/ directory as resources — they are not loaded into context but invoked via bash.

Steps

1. Determine SKILL_DIR

All script paths are relative to this skill's directory:

SKILL_DIR="<absolute path to skills/bootstrap-china-network>"

Use the directory where this SKILL.md resides.

2. Diagnose (if user wants diagnostics or troubleshooting)

If the user wants to diagnose their environment, check what's configured, or understand why things are slow:

bash "$SKILL_DIR/scripts/diagnose.sh"

This will:

  • Collect system info and detect proxy conflicts
  • Scan installed development tools and their mirror configurations
  • Test connectivity to official sources and Chinese mirrors (with timing)
  • Output structured recommendations (HIGH/MEDIUM/LOW priority)

After diagnostics, review the recommendations and offer to apply fixes for unconfigured tools.

3. Quick environment scan (for direct configuration)

# Detect installed tools
for tool in pip uv npm yarn pnpm docker cargo go conda flutter brew; do
  which $tool 2>/dev/null && echo "✓ $tool" || true
done

# Check proxy conflicts
[[ -n "$HTTP_PROXY$HTTPS_PROXY$http_proxy$https_proxy" ]] && echo "⚠️ Proxy detected"

4. Check for proxy conflicts

If HTTP_PROXY or HTTPS_PROXY is set, warn the user:

> Proxy environment variables are set. In China, using a VPN/proxy alongside mirrors can cause conflicts. Consider: unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY

5. Apply mirror configurations

For each detected tool, run the corresponding script. Ask the user for preferences or use sensible defaults:

ToolScript (relative to SKILL_DIR)Default Mirror
----------------------
pip/uv/poetryscripts/python/setup.shtuna
npm/yarn/pnpmscripts/node/setup.shnpmmirror
APT (Ubuntu/Debian)sudo scripts/apt/setup.shtuna
Docker CE + Hubsudo scripts/docker/setup.shtuna
Homebrewscripts/homebrew/setup.shtuna
Conda/Anacondascripts/conda/setup.shtuna
Cargo/Rustscripts/rust/setup.shustc
Go modulesscripts/go/setup.shgoproxy
Flutter/Dartscripts/flutter/setup.shtuna
GitHub Releases/Clonescripts/github/setup.shtuna (支持 --proxy-clone 全局加速 clone)

All scripts support these flags:

  • -m / --mirror — choose mirror source
  • -f / --force — force overwrite
  • -d / --dry-run — preview changes without applying
  • -y / --yes — skip confirmation prompts

Run scripts for detected tools. Each script is idempotent — safe to run multiple times.

Example:

bash "$SKILL_DIR/scripts/python/setup.sh" --mirror tuna
bash "$SKILL_DIR/scripts/node/setup.sh" --mirror npmmirror
sudo bash "$SKILL_DIR/scripts/apt/setup.sh" --mirror tuna

6. Verify configurations

After applying, run a quick verification for each configured tool:

pip config get global.index-url 2>/dev/null
npm config get registry 2>/dev/null
go env GOPROXY 2>/dev/null
cat ~/.cargo/config.toml 2>/dev/null | grep index

7. Provide summary

Report:

  • What was configured (tool -> mirror URL)
  • Any warnings (proxy conflicts, permission issues, tool not found)
  • How to restore: bash "$SKILL_DIR/scripts/restore_config.sh" --tool --latest

Dry Run

If the user wants to preview changes first, add --dry-run to each script:

bash "$SKILL_DIR/scripts/python/setup.sh" --dry-run
bash "$SKILL_DIR/scripts/node/setup.sh" --dry-run

Backup & Restore

Backups are stored in ~/.china-mirror-backup/.

# Backup all tool configs
bash "$SKILL_DIR/scripts/backup_config.sh" --all

# Backup specific tool
bash "$SKILL_DIR/scripts/backup_config.sh" --tool pip

# Restore latest backup for a tool
bash "$SKILL_DIR/scripts/restore_config.sh" --tool pip --latest

# List all backups
bash "$SKILL_DIR/scripts/restore_config.sh" --list

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 20:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,239
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,237
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,808