Install
openclaw skills install @fbbyqsyea/github-fetchDownload files, release assets, or entire repositories (including submodules) from GitHub. Use whenever the user needs to fetch GitHub resources but direct connections are slow, timing out, rate-limited, or blocked — large release assets (ffmpeg builds, binaries, models), git clone with submodules, or single files. The skill auto-detects network problems, probes and benchmarks proxy mirrors, resumes interrupted downloads, verifies SHA-256 checksums, and extracts/installs artifacts. Make sure to use this skill whenever the user mentions downloading from GitHub, cloning a repo, fetching a release, getting a binary from GitHub, or any download that fails or stalls on GitHub — even if they don't explicitly ask for help with mirrors or proxies.
openclaw skills install @fbbyqsyea/github-fetch从 GitHub 拉取仓库 / release 资产 / 单文件,直连优先,失败自动降级代理镜像,断点续传,下载后校验 + 解压 + 安装。
核心思想:直连总是值得先试的,但绝不能无限等。GitHub 直连可能 200 但极慢(实测 114MB 文件 15 分钟+ 未完成),所以要用「带超时的测速」而不是「等失败」来判断。代理镜像也不是全都可用(实测 5 个里 3 个可用),必须逐个探测测速,选最快。
# 下载单文件 / release 资产
python3 scripts/github_fetch.py "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-linux64-gpl-7.1.tar.xz" --out /opt/ffmpeg-gpu --extract --install /opt/ffmpeg-gpu
# 按 owner/repo 查最新 release 并匹配资产
python3 scripts/github_fetch.py --release BtbN/FFmpeg-Builds --asset-pattern "n7.1.*linux64-gpl" --out /tmp/dl
# clone 仓库(含子模块)
python3 scripts/github_fetch.py --clone owner/repo --recursive --out /workspace
# 校验 sha256(已知哈希,或自动拉官方 checksums 文件)
python3 scripts/github_fetch.py <url> --sha256 0123abcd...
python3 scripts/github_fetch.py <url> --verify-url https://.../checksums.sha256
| 类型 | 模式 | 说明 |
|---|---|---|
| Release 资产 | github.com/{o}/{r}/releases/download/{tag}/{asset} | 最常见,走 releases/download |
| 仓库归档 | github.com/{o}/{r}/archive/refs/heads/{branch}.tar.gz | 单分支快照 |
| codeload | codeload.github.com/{o}/{r}/tar.gz/refs/heads/{b} | 同上 |
| Raw 文件 | raw.githubusercontent.com/{o}/{r}/{branch}/{path} | 单文件 |
| 仓库 clone | git clone https://github.com/{o}/{r}.git | 整个仓库 |
查最新 release 资产列表(脚本 --release 参数已封装):
curl -s "https://api.github.com/repos/{owner}/{repo}/releases/latest" | python3 -m json.tool
注意:BtbN 等仓库的 releases/latest 的 tag_name 是字面量 latest,资产 URL 用 releases/download/latest/{asset}。
# 测速:请求前 1MB,看速度
timeout 20 curl -sL -o /dev/null -r 0-1048575 -w "%{speed_download}" <url>
-C - 断点续传,别从头重下(GitHub 直连经常中途掉速)固定列表(顺序即优先级,逐个 range 测速):
https://ghfast.top
https://gh-proxy.com
https://ghproxy.net
https://gh.ddlc.top
https://github.moeyy.xyz
代理 URL 拼接:{proxy}/https://github.com/...(整个 github.com URL 直接挂在后面)。
for p in "https://ghfast.top" "https://gh-proxy.com" "https://ghproxy.net" "https://gh.ddlc.top" "https://github.moeyy.xyz"; do
timeout 12 curl -sL -o /dev/null -r 0-1048575 -w "$p -> %{http_code} %{speed_download}B/s\n" "$p/https://github.com/..." 2>/dev/null
done
-C - 续传下载checksums.sha256(release 资产旁边常有),本地计算比对:sha256sum <file> # 计算本地哈希
python3 -c "import hashlib;print(hashlib.sha256(open('<file>','rb').read()).hexdigest())"
--sha256 / --verify-url 参数已封装自动比对按扩展名:
tar xf file.tar.xz # 也兼容 .tar.gz/.tar.bz2/.tar.zst(先装 zstd 的话)
unzip file.zip
ffmpeg-n7.1-latest-linux64-gpl-7.1/bin/)—— 安装时找 bin/ffmpeg 这类目标,别假设路径file <bin> 看架构、readelf -l <bin> | grep interpreter 查动态链接器、直接运行试sudo mkdir -p /opt/<app>
sudo cp -r <解压目录>/bin /opt/<app>/
sudo ln -sf /opt/<app>/bin/ffmpeg /usr/local/bin/ffmpeg-gpu # 建符号链接到 PATH
/opt/ + /usr/local/bin/ 链接;用户级安装放 ~/.local/bin/-r range + -C - 组合:测速用 -r 0-1048575(1MB),下载用 -C -(续传)。代理返回 206 才支持续传。exit 124 = timeout(curl/shell 的 timeout 命令)。file 和 readelf 查(BtbN 静态构建为 glibc x86-64,ARM 机器会挂)。--depth 1 --recursive 减小体积(浅克隆 + 子模块);子模块指向内网 git 服务器时公网 clone 会失败,需单独处理(内网可达时拉取,或省略子模块)。references/url-patterns.md — GitHub URL 类型与转换细节GITHUB_PROXIES(逗号分隔)可覆盖默认列表-C - 续传,多试几次(每轮都能续上)