Chrome headless

CLI

Screenshot or print any web page (local file or URL) to PNG/PDF with the browser you already have.

Visual check of a page or HTML → PDF without Playwright or Puppeteer

4 of 4 recipes verified by execution · 2026-09-17#screenshot#pdf#browser#headless#html

Verified commands

Executed by our harness on the platforms shown; the assertion checked the actual result, not just the exit code.

Screenshot a page (macOS, Google Chrome)

macOS only

Verified macOS · 2026-09-17
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu --hide-scrollbars --window-size=1280,800 --screenshot=shot.png "http://localhost:3000/"
Common failures (2)
  • chrome: command not foundmacOS has no chrome on PATH; call the app binary by its full path
  • window narrower than requestedChrome enforces a minimum window width (~500px); use device emulation for real mobile sizes

Print a page to PDF (macOS, Google Chrome)

macOS only

Verified macOS · 2026-09-17
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu --no-pdf-header-footer --print-to-pdf=out.pdf "file://$PWD/page.html"

Screenshot a page (Linux, chromium)

Linux only

Verified Linux · 2026-09-17
chromium --headless=new --no-sandbox --disable-gpu --hide-scrollbars --window-size=1280,800 --screenshot=shot.png "http://localhost:3000/"
Common failures (1)
  • Running as root without --no-sandbox is not supportedcontainers and CI usually run as root: add --no-sandbox

Print a page to PDF (Linux, chromium)

Linux only

Verified Linux · 2026-09-17
chromium --headless=new --no-sandbox --disable-gpu --no-pdf-header-footer --print-to-pdf=out.pdf "file://$PWD/page.html"

Install

Homebrewbrew install google-chrome
aptsudo apt install chromium

Agent notes

When to use
Verifying UI changes, capturing a rendered page for a vision model, converting HTML to PDF
Quick examples
  • chromium --headless=new --screenshot=shot.png https://example.com

Use from an agent

curl -s https://clihub.com/api/tools/chrome-headless | jq '.agentHints.provenRecipes[] | {task, command, verified}'

Or call get_tool with slug chrome-headless on the MCP server at https://clihub.com/mcp.

Homepage ↗BSD-3-Clause0 views