github-images

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

github-images

github-images

Download image attachments from GitHub issues and pull requests, including private repos that require authentication.
从GitHub议题(Issues)和拉取请求(PRs)中下载图片附件,包括需要认证的私有仓库。

When to use

使用场景

  • User shares a GitHub issue/PR URL and you need to view screenshots or images from it
  • You need to download image attachments from a private repo
  • User asks to "grab the screenshots from that issue" or similar
  • 用户分享了GitHub Issue/PR链接,你需要查看其中的截图或图片
  • 你需要从私有仓库下载图片附件
  • 用户要求“获取那个Issue里的截图”或类似需求

Usage

使用方法

bash
undefined
bash
undefined

From a full GitHub URL

From a full GitHub URL

From a PR URL

From a PR URL

Using owner/repo and number separately

Using owner/repo and number separately

ghimg owner/repo 39
ghimg owner/repo 39

Custom output directory

Custom output directory

ghimg owner/repo 39 -o ./screenshots
ghimg owner/repo 39 -o ./screenshots

Print signed URLs only (pipe-friendly)

Print signed URLs only (pipe-friendly)

ghimg owner/repo 39 --urls-only

Default output: `/tmp/ghimg/<owner>/<repo>/<number>/`

After downloading, use `Read` to view the images (Claude Code supports image files).
ghimg owner/repo 39 --urls-only

默认输出目录:`/tmp/ghimg/<owner>/<repo>/<number>/`

下载完成后,使用`Read`命令查看图片(Claude Code支持图片文件)。

Manual fallback

手动替代方案

If
ghimg
is unavailable, use
gh api
directly:
bash
undefined
如果
ghimg
不可用,可以直接使用
gh api
bash
undefined

Fetch body_html with signed image URLs (valid ~5 min)

Fetch body_html with signed image URLs (valid ~5 min)

gh api repos/owner/repo/issues/39
-H "Accept: application/vnd.github.full+json"
--jq '.body_html'
gh api repos/owner/repo/issues/39
-H "Accept: application/vnd.github.full+json"
--jq '.body_html'

Fetch comment images too

Fetch comment images too

gh api repos/owner/repo/issues/39/comments
-H "Accept: application/vnd.github.full+json"
--paginate --jq '.[].body_html'
gh api repos/owner/repo/issues/39/comments
-H "Accept: application/vnd.github.full+json"
--paginate --jq '.[].body_html'

Download a signed URL

Download a signed URL


The key insight: `application/vnd.github.full+json` returns `body_html` containing JWT-signed URLs for private image attachments. These URLs expire after ~5 minutes.

核心原理:`application/vnd.github.full+json`会返回包含JWT签名URL的`body_html`,这些URL用于访问私有图片附件,有效期约5分钟。