Skip to content

Provide a way to upload images for PR descriptions & comments #4228

Closed

Description

@ajpaon

Describe the feature or problem you’d like to solve

Please add a way to upload images to Github's hosting platform. I would like a simple way to include images in my PR descriptions.

Proposed solution

Perhaps a new image subcommand. It should take an image file as input and output the URL for the uploaded image.

$ gh image upload screenshot.png
https://user-images.githubusercontent.com/...

Activity

  1. added
    enhancement
    on Aug 27, 2021
  2. mislav commented on Aug 30, 2021

    @mislav
    Contributor

    Thanks for the suggestion! Duplicate of #1895 (comment)

  3. vipulgupta2048 commented on Mar 26, 2026

    @vipulgupta2048

    I built gitshot to solve exactly this - posted this image using gitshot 🎉 🎉
    GitShot is a zero-config, agent-ready CLI that uploads images to GitHub issues, PRs, and comments. Announcement.

    Image
    Method Command
    Install globally npm i -g gitshot
    Install as gh CLI extension gh extension install vipulgupta2048/gitshot
    Install as agent skill npx skills add vipulgupta2048/gitshot
  4. drogers0 commented on Mar 27, 2026

    @drogers0

    banner.png

    I built gh-image as a gh CLI extension to solve this. It replicates the browser's own upload flow, so images land at github.com/user-attachments/assets/….
    The same URLs you get from drag-and-drop. Images on private repos stay private, since the URLs inherit repo visibility.

    gh extension install drogers0/gh-image
    
    IMG=$(gh image banner.png --repo cli/cli)
    # => ![banner](https://github.com/user-attachments/assets/...
    
    gh issue comment 4228 --repo cli/cli --body "$IMG
    I built gh-image as a \`gh\` CLI extension to solve this...."

    ^ That's the command I used to post this.

    It automatically pulls your browser's session cookie, no tokens or OAuth setup required.

  5. IhvanKiziev2015-source commented on Jul 9, 2026

    @IhvanKiziev2015-source
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions