Files & Clipboard
agent-browser can upload files, capture downloads, read local files through file:// URLs, write PDFs and screenshots, and interact with the browser clipboard.
Upload files
The selector must resolve to a file input. Multiple file paths are accepted for multi-file inputs.
Downloads
Use download when a specific element triggers the download. Use wait --download when another action starts the download and you need to wait for completion.
Set a default download directory for browser-initiated downloads:
Without --download-path, downloads go to a temporary directory that is cleaned up when the browser closes.
Screenshots and PDFs
Prefer --if-changed for repeated captures: skipping unchanged images is the most token-efficient option. History is per tab and capture scope. The first capture returns a path; later unchanged captures omit it. JSON includes changed, revision, and pixelChangeRatio. --threshold <0-1> implies --if-changed and treats changes at or below that ratio as unchanged.
Screenshot defaults can also be configured with:
| Setting | Description |
|---|---|
--screenshot-dir / AGENT_BROWSER_SCREENSHOT_DIR | Default screenshot output directory |
--screenshot-format / AGENT_BROWSER_SCREENSHOT_FORMAT | png or jpeg |
--screenshot-quality / AGENT_BROWSER_SCREENSHOT_QUALITY | JPEG quality from 0 to 100 |
Local files
--allow-file-access is Chromium-only. It allows file:// pages to load and access other local files through browser APIs such as fetch and XHR.
Clipboard
copy and paste simulate the platform keyboard shortcuts for the current selection or focused element. Use write when you want to set clipboard text directly.