Repository navigation
Description
Describe the feature or problem you’d like to solve
gh issue comment and gh pr comment support --attach for local images and videos, but gh discussion comment does not. Someone participating in a discussion from the CLI cannot include a local screenshot in the comment with the same workflow.
For example, I wanted to post a before/after comparison in a feature discussion. The discussion comment command can submit the text, but it has no way to upload and embed the two local images.
Proposed solution
Add a repeatable --attach flag to gh discussion comment, matching gh issue comment where applicable. Support local Markdown image references in --body or --body-file, replacing them with uploaded URLs so images can be embedded in a table, along with the same attachment and alt-text behavior as issue comments.
gh discussion comment 123 --repo OWNER/REPO \
--body-file comment.md \
--attach ./before.png --attach ./after.pngAdditional context
This is a parity request for the existing CLI attachment workflow. In gh 2.103.2, gh discussion comment --help does not list --attach.
The existing CLI upload endpoint requires write access to the target repository. Please consider how this feature should work for discussion participants without write access, or document the limitation if the same endpoint must be used. GitHub's web discussion editor can attach images to a comment.
Related items
--attachrequires write access, so outside reporters cannot attach screenshots #14302 requests attachment uploads for outside contributors without repository write access. That permission limitation also affects the workflow requested here; this issue specifically requests support ingh discussion comment.- Feature: attach local images to comments, issues, and pull requests #13256 was the broader request for attaching local images to issue and pull request comments and led to the existing
--attachworkflow. - Discussion #3518 is an earlier general question about uploading and embedding attachments in comments.
Activity
cli-triage commentedon Oct 31, 2026
Thanks for the request! I'm suggesting
enhancementandgh-discussionlabels (for maintainer approval) — this is a clear, well-scoped parity request:gh discussion commentcurrently has no--attach/attachment-upload support, whilegh issue commentandgh pr commentdo.I confirmed this in the current source:
pkg/cmd/discussion/comment/comment.godefinesCommentOptionsand registers only--body,--body-file,--edit,--delete, and--yes(L132-L138) — there's noattachments.AddFlagwiring like the one used bypkg/cmd/pr/comment/comment.gofor--attach. I didn't find an existing duplicate issue tracking this specific gap forgh discussion comment. One open question worth flagging for engineering review: the existing upload endpoint used by issue/PR--attachrequires write access to the repo, which may not match how discussion participants (who can often comment without write access) would use this feature — worth considering during implementation.BagToad commentedon Oct 31, 2026
@cryptictech thanks for the issue 🙏
If this is done, assuming the write-access restriction is still in place, is this feature still useful to you? Or does your use-case require a repo which you do not have write-access?
github-actions commentedon Oct 31, 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.
cryptictech commentedon Oct 31, 2026
Hi there! This feature request came out of me trying to reply to my own discussion thread:
pingdotgg/t3code#26618
I was trying to mention that I had a branch available for a PR pending maintainer acceptance of the feature request with before/after screenshots.
I do not have upstream write access.