Add screenshots and videos to a pull request from the CLI
On GitHub.com, GitHub CLI 2.99.0 and later uploads images and videos itself with gh pr comment --attach. Use pushbag links when the review material is an HTML report, when the forge or your gh version has no attach flag, or when the pull request must point at one pinned version.
Start with gh –attach on GitHub.com
GitHub CLI 2.99.0, released on 1 September 2026, added a repeatable --attach flag to gh pr create, gh pr comment and gh pr edit. It uploads local images and videos to GitHub and adds them to the body or comment, up to 50 files per command. Text after # becomes the image alt text. gh pr comment manual · 2.99.0 release notes
gh --version
gh pr comment 42 --body "Before and after" \
--attach './before.png#Settings page before' \
--attach './after.png#Settings page after'
If that covers your pull request, you do not need pushbag for it. The manual lists GitHub.com and GitHub Enterprise Cloud as supported hosts and accepts images and videos only. The rest of this page is for the other cases: an HTML report or interactive demo, GitHub Enterprise Server, an older gh, another forge or tracker, or evidence that has to stay pinned to the exact version a reviewer approved.
Prepare the two accounts
Install pushbag with npm install -g @pushbag/cli and run pushbag auth login. Open the key page and create an Artifacts key. Store it with pushbag auth set YOUR_KEY in the shell that will publish the screenshots. Separately, check gh auth status for the account that can edit the pull request. Uploading a file and editing a PR are two different writes.
Choose a viewport that makes the change visible at GitHub’s reading width. Use the same signed-in state and synthetic records for both captures. Inspect the corners of the image for email addresses, account names and environment banners. A private repository does not make a publicly hosted screenshot private.
Add a before-and-after pair
Capture the same screen on the base branch and the proposed change. Keep the viewport, theme, and test data the same. For captures safe to share publicly, run this from the PR branch with a plan that supports image uploads, an authenticated Artifacts key, GitHub CLI, and jq.
media_dir=$(mktemp -d)
pushbag upload before.png after.png --public --json > "$media_dir/uploads.json" &&
gh pr view --json body --jq '.body' > "$media_dir/body.md" &&
jq -er 'map(select(.versionUrl)) | select(length == 2) | "\n| Before | After |\n| --- | --- |\n| ) | ) |"' "$media_dir/uploads.json" >> "$media_dir/body.md" &&
gh pr edit --body-file "$media_dir/body.md"
This keeps the existing description and pins each image to the revision reviewed. GitHub’s image proxy needs a publicly readable URL, even for a private PR. GitHub CLI body-file reference
Link a video from a poster
With FFmpeg installed and a plan that supports videos, extract a frame from the recording and upload both files.
ffmpeg -ss 1 -i demo.mp4 -frames:v 1 poster.png
pushbag upload poster.png demo.mp4 --public --json
Use [](VIDEO_VERSION_URL) in the PR body. Substitute the two returned version URLs.
Verify the evidence before asking for review
Open the PR description and check each thumbnail. Follow the poster to the recording and watch the interaction you described. A PNG capture of an error page can upload successfully, so use the visible result as the final check. If the recording is too large, trim it to the interaction or re-encode it at a lower bitrate before trying again.
The JSON response has one object per input in order. For each object, the ID identifies the artifact, the URL opens its current version and the version URL addresses the specific capture. Save these values alongside their screen names. A later fix to the After screen should not silently change an image that a reviewer already commented on.
If you choose to update the existing After artifact, send only the new After file with its ID. The error --artifact adds a version to one artifact, so it takes one file. means the command tried to apply one ID to multiple input files. Update each artifact separately, then edit the corresponding Markdown cell with the new pinned URL.
Send a review alert separately
For an ordinary PR, the description itself is the handoff. If someone is waiting on a phone, send one notification after verifying the edited body. Use a Notifications key authorized for their channel and set the click target to the PR. This avoids sending separate upload alerts for the two screenshots and the poster.
pushbag notify "Updated Before and After captures are ready" \
--title "PR media review" --channel "$REVIEW_CHANNEL_ID" \
--click "$(gh pr view --json url --jq '.url')"
The channel receives the title and review request. Opening the PR still requires the recipient’s usual GitHub access if the repository is private. For imagery that must remain private, leave the public embed out and review it through the signed-in artifact owner’s account instead.
Frequently asked questions
What if the captures contain private data?
Use redacted or synthetic captures before making a public upload. A private pushbag URL requires access that GitHub’s image proxy does not have.
Can I upload standalone PNGs on Free?
Free accepts HTML artifacts. Use a plan that accepts images for the PNG URLs in this workflow.
How do I change the After image after a fix?
Publish the new capture and replace the After URL in the PR body with its versionUrl. Readers can then see which revision the updated description refers to.
Can I keep the recording outside the repository?
Yes. The Markdown links to the uploaded recording through a separate poster image. Neither binary needs to become part of the source tree.