github-hosts-update
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "github-hosts-update" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4bd697c541fdf36012800533fbe19bcc138b6234bcd8e52fc1eb007beac3ffc0. Verify the upstream source and version against https://skillhub.cn/skills/user_92a9438a/github-hosts-update before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Updates GitHub acceleration domain mappings in the system hosts file: downloads the latest hosts from https://raw.hellogithub.com/hosts and writes to C:\Windows\System32\Drivers\etc\hosts (requires administrator privileges, will auto-elevate). Use when the user requests updating/refreshing/fixing GitHub hosts or reports slow or inaccessible github.com.
Introduction source: third_party · user_92a9438a · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: github-hosts-update
description: 更新系统 hosts 文件中的 GitHub 加速域名映射。从 https://raw.hellogithub.com/hosts 下载最新 hosts 并写入 C:\Windows\System32\Drivers\etc\hosts(需管理员权限,会自动提权)。当用户要求更新/刷新/修复 GitHub hosts、GitHub 访问慢、或 github.com 无法访问时调用。
allowed-tools: Bash, PowerShell, ReadGitHub Hosts 更新技能
你负责把 GitHub 相关域名的加速 IP 映射更新到 Windows 系统 hosts 文件中。
关键事实
- 远程来源:
https://raw.hellogithub.com/hosts(GitHub520 社区维护的 hosts 片段) - 系统 hosts 路径:
C:\Windows\System32\Drivers\etc\hosts - 写入需要管理员权限。该文件受系统保护,普通进程无法直接写入。
工作流程
-
确认用户在 Windows 环境(路径为
C:\Windows\...)。本技能仅适用于 Windows。 -
运行随附的自提权脚本,它会自动下载最新 hosts、替换托管分区、刷新 DNS:
powershell -NoProfile -ExecutionPolicy Bypass -File "${CODEBUDDY_SKILL_DIR}/scripts/update-hosts.ps1" -
脚本逻辑说明(无需重复实现,直接运行即可):
- 若当前不是管理员,会用
Start-Process -Verb RunAs重新以管理员身份启动(会弹出 UAC 提权窗口,请提示用户点击"是")。 - 下载远程 hosts 片段,失败时最多重试 3 次;全部失败则不修改系统文件并退出。
- 读取现有 hosts,仅移除并替换由标记
# >>> github-hosts-update start ... >>>与# <<< github-hosts-update end <<<包裹的托管分区,完整保留用户原有的其他条目(只新增/替换 GitHub hosts 相关内容)。 - 写入前会先备份:把当前 hosts 复制到同目录的
hosts.bak(滚动最新)与带时间戳的hosts.backup.<yyyyMMdd-HHmmss>.bak(历史,仅保留最近 5 个),便于回滚。 - 写入后在系统默认编码下保存,并执行
ipconfig /flushdns刷新 DNS。
- 若当前不是管理员,会用
-
将脚本的输出来呈现给用户:成功则说明已更新并刷新 DNS;若用户拒绝了 UAC 提权,则说明需要管理员权限才能完成。
注意事项
- 不要直接用
Write/Edit工具去改系统 hosts 文件——普通权限下会失败,且容易破坏用户原有内容。务必通过上面的脚本(它会做安全的分区替换与提权,并在修改前自动备份)。 - 如果用户只是想查看当前 hosts,用
Read工具读取即可,不要运行更新脚本。 - 若用户要求自定义来源地址,可在脚本后追加
-Url "<地址>"参数。 - 回滚:若更新后出现问题,可将
C:\Windows\System32\Drivers\etc\hosts.bak(或某个hosts.backup.*.bak)复制回hosts即可恢复。也可用参数-NoBackup跳过备份、-BackupDir "<目录>"指定备份位置。
输出示例
成功时:
已从 https://raw.hellogithub.com/hosts 获取最新 GitHub hosts 并写入系统 hosts 文件,已刷新 DNS 缓存。原有条目已保留。
提权被拒绝时:
更新系统 hosts 需要管理员权限,脚本已尝试弹出 UAC 提权窗口但被取消。请右键以管理员身份运行 CodeBuddy,或用
/github-hosts-update重试并同意提权。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 GitHub 访问慢/无法访问的实际痛点,实用性强
- 适用于 Windows 用户,场景明确
Highlights
- 触发词覆盖合理,边界清晰,用户意图匹配度高
Highlights
- Phase/步骤清晰,有出口条件,含端到端示例
- frontmatter 完整,文档结构良好
Highlights
- 工具来源明确,参数正确,覆盖主要异常
- 不可逆操作有确认机制和备份机制,安全性高
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Invoke commands or scripts
Read the script and arguments first. Use ordinary privileges and a scoped directory; confirm installation or execution in your host tool.
Mentioned in main document · lines 25 -
Administrator or elevated privileges
Elevate only when necessary. Keep protection and certificate validation enabled and avoid broad system access.
Mentioned in main document · lines 3, 15, 20, 22, 25
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- raw.hellogithub.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.