Install
openclaw skills install github-hosts-cn-n1eGitHub Hosts 更新工具(中国用户专用)。安全地更新系统hosts文件以访问GitHub,保留原有非GitHub条目,仅替换GitHub相关地址。支持备份恢复、风险提示。当用户需要解决GitHub访问问题时使用此技能。
openclaw skills install github-hosts-cn-n1e安全、智能地更新系统hosts文件,帮助中国用户正常访问GitHub。
cd /Users/claw/Documents/trae_projects/skills/github-hosts-cn
npm install
# 更新GitHub hosts
node update.js
# 查看帮助
node update.js --help
# 恢复最近的备份
node update.js --restore
# 查看当前状态
node update.js --status
# 仅获取不更新(预览模式)
node update.js --preview
| 源 | URL | 类型 | 优先级 |
|---|---|---|---|
| HelloGitHub | raw.hellogithub.com | 独立站点 | 1 |
| GitLab Mirror | gitlab.com/ineo6 | GitLab | 2 |
| Gitee Mirror | gitee.com | 国内镜像 | 3 |
| JSDelivr CDN | cdn.jsdelivr.net | CDN | 4 |
1. 显示风险提示 → 用户确认
2. 读取当前 /etc/hosts
3. 创建时间戳备份
4. 从多源获取最新GitHub hosts
5. 合并:保留非GitHub条目 + 新GitHub条目
6. 写入新的hosts文件
7. 刷新DNS缓存
8. 显示更新结果
hosts.backup.YYYY-MM-DDTHH-mm-ss~/.openclaw/backups/github-hosts/--restore 恢复最近备份--restore <backup-file> 恢复指定备份修改hosts文件存在以下风险:
建议:
--restore 恢复MIT