Capture screen, window, or browser tab using browser screen sharing

Synopsis

screencapture [options] <output-file>

Description

Captures a screenshot of a screen, window, or browser tab using the browser's getDisplayMedia API. The browser prompts the user to select what to capture. The image is saved to the SLICC virtual filesystem in the format determined by the output file extension. This command only works in browser environments that support the Screen Capture API.

Options

-h, --help Show help message

-c, --clipboard Copy the capture to the clipboard instead of saving to a file

-v, --view Save to file and return the image inline so the agent can see it

Supported Formats

.png PNG (default)

.jpg, .jpeg JPEG

.webp WebP

Examples

$ screencapture screenshot.png

Capture and save as PNG.

$ screencapture -c

Capture and copy to clipboard (no file output).

$ screencapture -v capture.png

Capture, save to file, and return the image inline for the agent to inspect.

Notes

Unlike the macOS screencapture command, this version uses the browser Screen Capture API (navigator.mediaDevices.getDisplayMedia) and always prompts the user to select what to capture — there is no silent or headless mode. Clipboard output is always converted to PNG regardless of the file extension, as the Clipboard API requires PNG format. This command is unavailable in the Chrome extension runtime.

See Also

imgcat, screenshot