gh-attach

Upload images and videos to GitHub issues and pull requests using the gh CLI --attach flag.

4|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/staticaland/skills --skill gh-attach-staticaland
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-attach
Source: https://github.com/staticaland/skills/tree/main/plugins/pull-requests/skills/gh-attach
Command: npx skills add https://github.com/staticaland/skills --skill gh-attach-staticaland

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Attaching screenshots, screen recordings, or diagrams to GitHub issues and pull requests normally requires manual drag-and-drop in the web UI. This Skill teaches the correct use of the GitHub CLI's --attach flag so uploads, inline placement, alt text, and video embedding all work predictably from the command line. ## Core Features & Use Cases - Attachment Uploads: Attach images (png, jpg, gif, webp, svg) and videos (mp4, mov, webm) to issues, pull requests, and comments via gh issue and gh pr commands. - Inline Placement Control: Reference local file paths inside the markdown body so gh rewrites them to uploaded CDN URLs exactly where you want the asset to render. - Edge-Case Handling: Covers alt text syntax, video embedding rules, flag conflicts, partial upload failures, and permission or host restrictions. - Use Case: You are filing a bug report from the terminal and want a screenshot embedded mid-body with alt text: run gh issue create with the path referenced in the body and passed to --attach, and the image renders inline for all readers. ## Quick Start Attach the screenshot error.png to GitHub issue 12 in the current repository with a comment explaining the bug.

Frequently Asked Questions about gh-attach

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I attach an image to a GitHub issue from the command line?▼

Use the gh CLI with the --attach flag, for example: gh issue create --attach ./screenshot.png, or gh issue comment 12 --attach ./screenshot.png. The file uploads to GitHub's user-attachments CDN and renders inline in the body.

How do I embed a screenshot inside a GitHub PR body instead of appending it?▼

Reference the local file path in the markdown body, such as ![alt](./before.png), and pass the same path to --attach. The gh CLI rewrites that reference to the uploaded asset URL instead of appending the file at the end.

Does gh --attach work with GitHub Enterprise Server?▼

No. The --attach flag works on github.com and GitHub Enterprise Cloud, including ghe.com data-residency tenants, but GitHub Enterprise Server hosts are refused. You also need write, maintain, or admin permission on the repository.

Why does my video not play inline in a GitHub issue?▼

GitHub only renders video from a bare URL that is the entire content of a paragraph. If the video embed appears mid-sentence or as a reference-style image, gh degrades it to a plain link or reports an error.

What file types and sizes does gh --attach support?▼

Images up to 10 MB are accepted in png, jpg, jpeg, gif, webp, and svg formats. Videos up to 100 MB are accepted in mp4, mov, and webm formats, though the account plan may impose a lower real video ceiling.

What happens when a gh attachment upload partially fails?▼

gh stops at the first failed file but still writes the body pointing at the files that uploaded successfully. Check the issue or PR to see what posted, then re-attach only the missing files, since uploads cannot be undone or deleted.