Skip to content

Support --attach on gh discussion comment #14881

Open

Description

@cryptictech

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.png

Additional 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

Activity

  1. cli-triage commented on Oct 31, 2026

    @cli-triage

    Thanks for the request! I'm suggesting enhancement and gh-discussion labels (for maintainer approval) — this is a clear, well-scoped parity request: gh discussion comment currently has no --attach/attachment-upload support, while gh issue comment and gh pr comment do.

    I confirmed this in the current source: pkg/cmd/discussion/comment/comment.go defines CommentOptions and registers only --body, --body-file, --edit, --delete, and --yes (L132-L138) — there's no attachments.AddFlag wiring like the one used by pkg/cmd/pr/comment/comment.go for --attach. I didn't find an existing duplicate issue tracking this specific gap for gh discussion comment. One open question worth flagging for engineering review: the existing upload endpoint used by issue/PR --attach requires 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.

    Generated by Issue Triage (skills-driven) for #14881 · copilot · auto · 35.9 AIC · ⊞ 4.5K · ◷

  2. BagToad commented on Oct 31, 2026

    @BagToad
    Member

    @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?

  3. added
    more-info-needed
    enhancement
    gh-discussion
    on Oct 31, 2026
  4. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor

    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 wanted Contributions 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.

  5. removed
    needs-triage
    on Oct 31, 2026
  6. cryptictech commented on Oct 31, 2026

    @cryptictech
    Author

    @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?

    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.

  7. removed
    more-info-needed
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgh-discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions