github-release-downloader
npx skills add https://github.com/qiuzhanghua/skills --skill github-release-downloader
Agent 安装分布
Skill 文档
GitHub Release Downloader / GitHub Release ä¸è½½å¨
Overview / æ¦è¿°
This is a Claude Skill for downloading the latest Release assets from GitHub repositories. Using the PyGithub library, this skill can fetch the latest release version of a repository, list all available asset files, and download specified assets to a local directory based on user needs.
è¿æ¯ä¸ä¸ªç¨äºä»GitHubä»åºä¸è½½ææ°Releaseèµäº§çClaude Skillãéè¿ä½¿ç¨PyGithubåºï¼è¯¥æè½å¯ä»¥è·åä»åºçææ°åå¸çæ¬ï¼ååºææå¯ç¨çèµäº§æä»¶ï¼å¹¶æ ¹æ®ç¨æ·éæ±ä¸è½½æå®çèµæºå°æ¬å°ç®å½ã
Features / åè½ç¹ç¹
- Automatically fetch the latest Release info from GitHub repositories / èªå¨è·åGitHubä»åºçææ°Releaseä¿¡æ¯
- Support downloading historical releases by specifying Release tags / æ¯ææå®Releaseæ ç¾ï¼Tagï¼ä¸è½½åå²çæ¬
- Automatically filter and only download executables and archives (.exe, .zip, .tar.gz, .tar.zst, .dmg, .tar.bz2, .tar.xz) / èªå¨è¿æ»¤åªä¸è½½å¯æ§è¡æä»¶åå缩å
- List all Release assets with name, size, and download URL / ååºææReleaseèµäº§çåç§°ã大å°åä¸è½½URL
- Support filtering and downloading specific assets by name / æ¯ææåç§°çéå¹¶ä¸è½½ç¹å®èµäº§
- Support downloading all assets to a specified directory / æ¯æä¸è½½ææèµäº§å°æå®ç®å½
- Provide detailed download progress and status information / æä¾è¯¦ç»çä¸è½½è¿åº¦åç¶æä¿¡æ¯
- Support custom download paths / æ¯æèªå®ä¹ä¸è½½è·¯å¾
Usage / ä½¿ç¨æ¹æ³
Basic Syntax / åºæ¬è¯æ³
Please help me download Release from [owner]/[repo]
Examples:
Please help me download Release from octocat/Hello-World
Please help me download the latest Release from microsoft/vscode to ./origin/vscode
Please help me download "react.zip" from facebook/react
请帮æä» [owner]/[repo] ä¸è½½Releaseèµæº
ä¾å¦ï¼
请帮æä» octocat/Hello-World ä¸è½½Release
请帮æä» microsoft/vscode ä¸è½½ææ°çReleaseå° ./origin/vscode ç®å½
请帮æä» facebook/react ä¸è½½å为 "react.zip" çèµæº
Parameter Description / åæ°è¯´æ
- owner: GitHub repository owner username or organization name / GitHubä»åºææè ç¨æ·åæç»ç»åç§°
- repo: GitHub repository name / GitHubä»åºåç§°
- download_path (optional): Download save directory path, defaults to “origin/{repo}” folder under current directory / ä¸è½½ä¿åçç®å½è·¯å¾ï¼é»è®¤ä¸ºå½åç®å½ä¸ç”origin/{repo}”æä»¶å¤¹
- asset_name (optional): Specific asset name to download, downloads all assets if not specified / è¦ä¸è½½çç¹å®èµäº§åç§°ï¼å¦æä¸æå®åä¸è½½ææèµäº§
- tag (optional): Specify Release tag (e.g., v1.0.0), downloads latest Release if not specified / æå®Releaseæ ç¾ï¼å¦ v1.0.0ï¼ï¼å¦æä¸æå®åä¸è½½ææ°Release
Download All Assets / ä¸è½½ææèµæº
When not specifying a specific asset name, all asset files of that Release will be downloaded:
å½ä¸æå®å ·ä½èµäº§åç§°æ¶ï¼å°ä¸è½½è¯¥Releaseçææèµäº§æä»¶ï¼
Please help me download all Release assets from owner/repo
请帮æä» owner/repo ä¸è½½ææReleaseèµæº
Download Specific Assets / ä¸è½½æå®èµæº
You can filter and download specific asset files by name:
å¯ä»¥éè¿åç§°çéä¸è½½ç¹å®çèµæºæä»¶ï¼
Please help me download "example-linux-x64.tar.gz" from owner/repo
请帮æä» owner/repo ä¸è½½å为 "example-linux-x64.tar.gz" çèµæº
Download Specific Tag Release / ä¸è½½æå®TagçRelease
You can download a specific version’s Release assets by specifying a Tag:
å¯ä»¥éè¿æå®Tagæ¥ä¸è½½ç¹å®çæ¬çReleaseèµæºï¼
Please help me download Release v1.0.0 from owner/repo
Please help me download Release v1.0.0 from owner/repo to ./history directory
请帮æä» owner/repo ä¸è½½ v1.0.0 çæ¬çRelease
请帮æä» owner/repo ä¸è½½ v1.0.0 çæ¬å° ./history ç®å½
Technical Implementation / ææ¯å®ç°
This Skill uses PyGithub library to interact with GitHub API, main features include:
该Skill使ç¨PyGithubåºä¸GitHub APIè¿è¡äº¤äºï¼ä¸»è¦åè½å æ¬ï¼
- Get Latest Release: Use
repo.get_latest_release()to get the latest release / è·åææ°Releaseï¼ä½¿ç¨repo.get_latest_release()è·åææ°åå¸çæ¬ - Get Release by Tag: Use
repo.get_release(tag)to get the release for a specified tag / è·åæå®TagçReleaseï¼ä½¿ç¨repo.get_release(tag)è·åæå®æ ç¾çRelease - Get Asset List: Use
release.get_assets()to get all downloadable assets / è·åèµäº§å表ï¼ä½¿ç¨release.get_assets()è·åææå¯ä¸è½½çèµäº§ - Download Assets: Directly download asset files through
browser_download_url/ ä¸è½½èµäº§ï¼éè¿browser_download_urlç´æ¥ä¸è½½èµäº§æä»¶
Dependencies / ä¾èµè¦æ±
- Python 3.12+ / Python 3.12+
- PyGithub library / PyGithubåº
- requests library (for file downloads) / requestsåºï¼ç¨äºæä»¶ä¸è½½ï¼
- click library (CLI) / clickåºï¼å½ä»¤è¡çé¢ï¼
Direct Run (Recommended) / ç´æ¥è¿è¡ï¼æ¨èï¼
This script supports uv auto-installing dependencies, just run directly:
è¯¥èæ¬æ¯æuvèªå¨å®è£ ä¾èµï¼ç´æ¥è¿è¡å³å¯ï¼
# Direct run, uv will auto-install dependencies
uv run scripts/download_release.py owner repo
# With parameters
uv run scripts/download_release.py owner repo --tag v1.0.0
uv run scripts/download_release.py owner repo --asset-name "linux" --save-dir ./origin/repo
# ç´æ¥è¿è¡ï¼uvä¼èªå¨å®è£
ä¾èµ
uv run scripts/download_release.py owner repo
# æå®åæ°
uv run scripts/download_release.py owner repo --tag v1.0.0
uv run scripts/download_release.py owner repo --asset-name "linux" --save-dir ./origin/repo
The script header already contains dependency declarations, uv will automatically resolve and install:
èæ¬å¤´é¨å·²å å«ä¾èµå£°æï¼uvä¼èªå¨è§£æå¹¶å®è£ ï¼
- pygithub
- requests
- click
Notes / 注æäºé¡¹
- Valid GitHub API access is required, authentication tokens may be needed in some cases / éè¦ææçGitHub API访é®ï¼é¨åæ åµä¸å¯è½éè¦é 置认è¯ä»¤ç
- Large asset files may require longer download times / 大åèµäº§æä»¶å¯è½éè¦è¾é¿çä¸è½½æ¶é´
- Please ensure sufficient disk space for saving downloaded files / è¯·ç¡®ä¿æè¶³å¤çç£ç空é´ç¨äºä¿åä¸è½½çæä»¶
- Some private repositories may require appropriate access permissions / é¨åç§æä»åºå¯è½éè¦éå½çè®¿é®æé
- Authentication Token: If not specified via
--tokenparameter, will automatically read from environment variableGITHUB_TOKEN/ 认è¯ä»¤çï¼å¦ææªéè¿--tokenåæ°æå®ï¼å°èªå¨ä»ç¯å¢åéGITHUB_TOKEN读å
Example Output / 示ä¾è¾åº
Example output when download is successful:
æåä¸è½½æ¶çè¾åºç¤ºä¾ï¼
Fetching latest Release info from owner/repo...
Release version: v1.0.0
Release title: Initial Release
Number of assets: 3
Available assets:
1. example-linux-x64.tar.gz (size: 45.2 MB)
2. example-macos-x64.tar.gz (size: 48.1 MB)
3. example-windows-x64.zip (size: 50.3 MB)
Downloading: example-linux-x64.tar.gz
Download complete: ./origin/repo/example-linux-x64.tar.gz
æ£å¨è·å owner/repo çææ°Releaseä¿¡æ¯...
Releaseçæ¬: v1.0.0
å叿 é¢: Initial Release
èµäº§æ°é: 3
å¯ç¨èµäº§ï¼
1. example-linux-x64.tar.gz (大å°: 45.2 MB)
2. example-macos-x64.tar.gz (大å°: 48.1 MB)
3. example-windows-x64.zip (大å°: 50.3 MB)
æ£å¨ä¸è½½: example-linux-x64.tar.gz
ä¸è½½å®æ: ./origin/repo/example-linux-x64.tar.gz
Error Handling / é误å¤ç
Common error situations and handling:
常è§çé误æ åµåå¤çæ¹å¼ï¼
- Repository not found: Check if owner and repo names are correct / ä»åºä¸åå¨ï¼æ£æ¥ownerårepoåç§°æ¯å¦æ£ç¡®
- No Release: The repository may not have published any Release yet / æ Releaseï¼è¯¥ä»åºå¯è½å°æªåå¸ä»»ä½Release
- Network error: Check network connection or try using a proxy / ç½ç»éè¯¯ï¼æ£æ¥ç½ç»è¿æ¥æå°è¯ä½¿ç¨ä»£ç
- Insufficient permissions: For private repositories, provide a valid access token / æéä¸è¶³ï¼å¯¹äºç§æä»åºï¼éè¦æä¾ææç访é®ä»¤ç