Have an AI agent capture the webpage to a local image file, then use GitHub CLI to attach that file to an issue comment. The capture and upload are separate steps: browser automation produces the screenshot, while GitHub authentication and repository permissions determine whether the image can be attached.
How the screenshot-to-issue handoff works
- Capture: Ask an agent with browser automation, such as a Playwright MCP client, to open the page and save a screenshot in a workspace accessible to the GitHub CLI.
- Attach: Run
gh issue commentwith the issue number and the local screenshot path. - Verify: Check the posted comment to confirm the image appears and its description makes sense.
Playwright’s documented screenshot tool supports viewport, element, and full-page captures, with PNG, JPEG, and WebP output. Its full-page mode cannot be combined with an element target; see Playwright’s screenshot tool documentation.
Capture the page with an AI agent
Choose what the screenshot should show
- Viewport: Capture what is currently visible, useful when the issue concerns the page’s current layout or a particular screen state.
- Element: Capture a specific control or region when the issue is localized. Use the element-target option available in your Playwright MCP client.
- Full page: Capture the full scrollable document when the issue involves content beyond the initial viewport. Do not combine full-page mode with an element target.
Give the agent a specific capture instruction
In your agent client, ask it to open the target URL, wait until the relevant state is visible, and save a PNG such as page.png in the project workspace. Specify the capture scope and any interactions needed to reach the state you want to report. For example:
Open the checkout page at the URL I provide. Reproduce the error state shown after submitting the form, then save a viewport screenshot as
page.pngin the repository workspace. Do not include unrelated account details or secrets.Recommended: Update Every Outdated Driver on Your PC in One Scan - Free →Recommended: Fix Windows Errors and Clear Junk Files in Minutes - Free Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.#1 Best Overall
SaleLogitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
- Compatible with Nintendo Switch 2’s new GameChat mode
- Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
- The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
- C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
- The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
The precise command or tool-call syntax depends on the agent framework and the Playwright MCP client you use; the documented capture options are described in the Playwright MCP screenshot reference. If you use an OpenAI computer-use agent, note that screenshots are excluded from API output by default unless screenshot inclusion is enabled. That setting concerns screenshot output from the agent; it is separate from saving a file that a CLI can upload. See OpenAI’s computer-use guide.
Attach the saved image with GitHub CLI
After the agent saves the image in a location the CLI can read, run:
Rank #2
- Compatible with Nintendo Switch 2’s new GameChat mode
- Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
- Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
- Built-In Mic: The built-in microphone lets others hear you clearly during video calls
- Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
gh issue comment ISSUE-NUMBER --body "Screenshot of the page state:" --attach './page.png#Page screenshot'
Replace ISSUE-NUMBER with the issue number and adjust the file path and description. GitHub CLI uploads the local file and inserts its resulting URL into the comment. GitHub’s CLI documentation says, “You need push access to the repository to attach files.” Review GitHub’s instructions for attaching files with GitHub CLI.
Use a Markdown body file for a more descriptive comment
If you want the issue comment to include context and an image reference, create issue-comment.md:
Recommended Free Tools
Rank #3
- 1080P HD Webcam: This HD webcam delivers crisp 1080p video quality, ideal for PCs, desktops, and laptops. Perfect for video calls, online classes, meetings, live streaming, gaming, and everyday recording. It provides clear, sharp images and smooth video at up to 30 frames per second. This live streaming webcam works with platforms such as Zoom, Teams, FaceTime, Google Meet, and YouTube.
- USB Plug and Play Webcam: Designed for PCs, this webcam is easy to use. No drivers or software are required; simply connect the webcam to your computer and start using it immediately. Operation is smooth and convenient. XWEIRYN webcams are compatible with multiple operating systems, including Mac/Windows XP/7/8/10/11/PC/Laptops.
- Widely Compatible Webcam: This versatile webcam is compatible with most operating systems and major video platforms. As a reliable computer webcam, it supports video conferencing, remote learning, live streaming, and gaming, meeting your various needs for daily work and entertainment.
- Smooth and Stable Performance: This webcam uses a stable transmission chip to ensure smooth, lag-free video streaming, synchronized audio and video, and no dropped frames. Even after prolonged use, this durable webcam maintains stable performance. It performs excellently even in low-light environments. It automatically adjusts to adapt to low-light conditions, reducing noise and restoring vibrant colors, ensuring clear and sharp images even without additional studio lighting.
- Compact and Adjustable Design: This lightweight and portable webcam saves space and comes with an adjustable clip. Our USB webcam uses a reliable USB 2.0/3.0 connection and comes with an upgraded 1.5-meter (5-foot) braided cable. It is compatible with Desktop most monitors and Laptop. Its portable design makes it easy to place and carry, ideal for home, office, or travel use.
Observed page state:

Then post it with the same local image attached:
gh issue comment ISSUE-NUMBER --body-file issue-comment.md --attach ./page.png
When a body references the same local file passed to --attach, GitHub CLI rewrites that reference to the uploaded asset URL; it does not add a duplicate image. If the attachment is not referenced in the body, the CLI appends it. The #Page screenshot part in the first example supplies descriptive alt text for the attachment.
Check access and protect sensitive information
- Authenticate the CLI: The agent’s ability to browse a page does not authenticate GitHub CLI. Confirm the CLI is logged in and can access the target repository before relying on an automated handoff.
- Confirm permission: GitHub CLI requires push access to attach a file to an issue comment. Repository policy or authentication limits can prevent the upload even when capture succeeds.
- Consider who can see the image: GitHub says attachments in public repositories can be accessed without authentication. Attachments in private or internal repositories are viewable only to people with repository access. Do not capture or upload secrets, personal data, tokens, or unrelated private content. See GitHub’s file-attachment guidance.
- Check file size: GitHub’s cited attachment guidance lists a 10 MB limit for images and GIFs and 25 MB for other files. These operational limits may change, so check the current guidance if an upload fails or the screenshot is large.
Choose an issue attachment or a workflow artifact
Use an issue-comment attachment when the goal is to show the screenshot inline in the discussion. If a workflow generates a file that users should retrieve separately, a workflow artifact is a different option: GitHub Agentic Workflows documents artifact publishing with safe output rules, allowed paths, maximum uploads, and retention days. See GitHub Agentic Workflows’ Playwright reference. An artifact is not the same as an inline issue attachment.
Rank #4
- 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
- Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
- Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
- Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
- High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
Or skip the browser setup: ScreenshotNeo
If you want a screenshot API call instead of setting up browser automation, ScreenshotNeo accepts a URL and returns an image or PDF. This example saves a WebP capture locally; then the GitHub CLI command can attach it to the issue comment.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server gives AI agents screenshot tools, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. You can learn about ScreenshotNeo or sign up for the free plan.
Troubleshooting
The agent captured the wrong page state
Ask it to reproduce the relevant state before capturing and to wait for the specific content or interaction to finish. Use an element capture for a localized control, a viewport capture for surrounding layout, or full-page mode when the whole document matters.
Best Value
The CLI cannot find the image
Make sure the file was saved in a path visible to the shell running gh, then check the path and filename. An agent container and your local terminal may not share a workspace; transfer the file or save it to a shared directory before attaching.
The attachment command is denied
Check that GitHub CLI is authenticated for the repository and that your account has the required push access. A browser agent’s permissions do not automatically carry over to the CLI.
The upload is too large or fails
Check GitHub’s current attachment guidance for applicable size limits. If appropriate, capture only the relevant element or viewport rather than the full page, then retry with the smaller image.
The screenshot exposes sensitive content
Do not post it as-is. Capture a safe page state, remove or obscure sensitive information before upload, and consider whether the repository’s visibility makes the attachment accessible more broadly than intended.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

