SuperAPI AI 工具集

github-images

设计与创作

查看项目

更新于 10-15 20:27

技能介绍

用途:从 GitHub issue 和 pull request 中下载图片附件,包括需要认证的私有仓库。当用户分享 issue/PR 链接并需要查看其中的截图或图片,或需要从私有仓库下载图片附件时使用。

主要能力:提供 ghimg 命令,支持从完整 GitHub URL、PR URL 或 owner/repo 加编号下载图片;可指定输出目录;可用 --urls-only 仅打印签名 URL 便于管道处理。默认输出到 /tmp/ghimg/<owner>/<repo>/<number>/。下载后可用 Read 查看图片(Claude Code 支持图片文件)。

用法示例: ghimg https://github.com/owner/repo/issues/39 ghimg https://github.com/owner/repo/pull/42 ghimg owner/repo 39 ghimg owner/repo 39 -o ./screenshots ghimg owner/repo 39 --urls-only

手动回退:若 ghimg 不可用,可直接用 gh api 获取 body_html(含签名图片 URL,约 5 分钟有效): gh api repos/owner/repo/issues/39 -H "Accept: application/vnd.github.full+json" --jq '.body_html' 获取评论图片: gh api repos/owner/repo/issues/39/comments -H "Accept: application/vnd.github.full+json" --paginate --jq '.[].body_html' 下载签名 URL: curl -sL -o image.png "https://private-user-images.githubusercontent.com/..."

关键点:application/vnd.github.full+json 返回的 body_html 包含私有图片附件的 JWT 签名 URL,这些 URL 约 5 分钟后过期。

限制:签名 URL 有效期短,需及时下载;依赖 gh 命令行工具及认证;具体安装方式与更多参数暂未提供。