Repository navigation
Agent suggestions
Public previewDescription
Describe the feature or problem you’d like to solve
Please add support for attaching Markdown (.md) files through the existing --attach flag on issue, pull request, and comment commands.
The current flag supports images and videos. It would also be useful to upload a Markdown document as a downloadable file attachment, for example an implementation plan, investigation report, or review notes, without copying the entire document into the issue or comment body.
Using --body-file report.md serves a different purpose: it reads the document into the body rather than attaching the original file.
Proposed solution
Allow .md files wherever --attach is supported:
gh issue create --title "Implementation proposal" --body "Plan attached." --attach ./plan.md
gh issue edit 123 --attach ./plan.md
gh issue comment 123 --body "Investigation report attached." --attach ./report.md
gh pr create --title "Implement feature" --body "Design notes attached." --attach ./design.md
gh pr edit 456 --attach ./design.md
gh pr comment 456 --body "Review notes attached." --attach ./review.mdExpected behavior:
- Upload the original
.mdfile as a GitHub attachment and preserve its filename and contents. - Insert a normal downloadable Markdown link, such as
[report.md](<uploaded-url>), instead of an image embed or the document contents. - Follow the existing attachment behavior for rewriting local file references in the body and appending a link when no reference exists.
- Support repeated
--attachflags, including Markdown files alongside supported images or videos. - Report any API, file size, or permission limitations clearly.
Additional context
Related to #14194, which requests general file attachment upload/download support. This request specifically covers uploading .md files through the existing --attach interface; it does not request download commands or support for other document formats.
Markdown is a common format for reports and plans produced by developers and coding agents. Attaching these documents would keep issue and PR discussions concise while preserving the complete document as a separate file.
Activity
cli-triage commentedon Sep 9, 2026
This looks like a clear, well-scoped enhancement request — no duplicates found (searched
cli/clifor related "attach"/"markdown"/"document" issues; #14194 is a broader related tracking issue mentioned by the reporter, not a duplicate). I'm suggestingenhancementandgh-issue(the request also spansgh pr, but issue commands are the primary example given).Looking at the implementation,
--attachcurrently only accepts a fixed extension allowlist insupportedContentType, backed by thecontentTypestable at userasset.go#L24-L37, which lists only image and video extensions (.png,.jpg,.jpeg,.gif,.webp,.svg,.mp4,.mov,.webm)..mdisn't in that table, so a.mdpath passed to--attachfails validation today. Supporting it would need a new "document" asset kind (distinct fromimageAsset/videoAsset) that renders a plain download link (e.g.[filename.md](url)) rather than an image embed or bare player URL, plus wiring throughnewAssetand the upload/rewrite logic inattach.go. This is a reasonable, contained addition to the existing attachment path rather than the broader upload/download feature requested in #14194.github-actions commentedon Sep 9, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
flaviovs commentedon Oct 6, 2026
This seems like a pretty artificial limitation, and I look forward to see this implemented.
In fact I suggest adding not only Markdown, but all file types listed in https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files#additional-file-types so that the CLI matches what can already be done in the web UI.