Loading...
Loading...
Upload local images and other files (PDF, zip, log, …) to GitHub and embed them in a pull request description, an issue, or a comment — producing canonical github.com/user-attachments URLs (private-repo uploads stay private). Use when asked to "attach a screenshot to the PR", "add an image to the PR description", "put this image in the issue", "attach this PDF/log/zip to the issue", "show test results in the PR", "embed before/after screenshots", or any request to visually document or attach files to changes on GitHub. Powered by the `gh-image` gh CLI extension.
npx skill4agent add drogers0/gh-image github-image-uploaduser-attachmentsgh-imagegh[name](url)gh-imageghgh auth statusgh auth logingh-imagegh extension list | grep -q 'drogers0/gh-image' || gh extension install drogers0/gh-imagegh-imageghuser_session--token <value>GH_SESSION_TOKEN⚠️ Acookie grants full account access (it is not scoped like a PAT). Treat it like a password; in CI use a dedicated bot account.user_session
# One or more files (images or PDF/zip/log/…); --repo is optional inside a repo
# working dir (inferred from the remote).
gh image "/abs/path/screenshot.png" --repo <owner>/<repo>gh image
https://github.com/user-attachments/assets/<uuid>
[report.pdf](https://github.com/user-attachments/files/<id>/report.pdf)gh-imageMD="$(gh image "/abs/path/shot.png" --repo owner/repo)"
BODY="$(gh pr view <pr> --repo owner/repo --json body -q .body)"
printf '%s\n\n## Screenshots\n\n%s\n' "$BODY" "$MD" \
| gh pr edit <pr> --repo owner/repo --body-file -MD="$(gh image "/abs/path/shot.png" --repo owner/repo)"
printf '## Screenshots\n\n%s\n' "$MD" | gh pr comment <pr> --repo owner/repo --body-file -gh issue edit <n> --body-file -gh issue comment <n> --body-file ---body-file ---bodygh pr view <pr> --repo owner/repo --json body -q .body # confirm the URL is presentuser-attachments<img width="800" alt="screenshot" src="https://github.com/user-attachments/assets/<uuid>" />| Symptom | Cause / fix |
|---|---|
| The org requires SSO and your session isn't authorized. Open the |
| The generic no-token case. Confirm you have write access; if the repo's org uses SSO, authorize at |
No | Log into GitHub in a supported browser, or set |
| Windows + Chrome 127+ can't read cookies | Known cookie-library limitation — use another browser or |
| CI / headless run | Set |
| Install the GitHub CLI ( |