zshot/cliDownload

--navigator-script

CLI
--navigator-script
Value[TITLE=]SOURCE
LicensePro

Gives the navigator a script it runs on the current page with RUN_SCRIPT, such as an accessibility audit or extracting a table as JSON. The title is free text that tells the navigator what the script returns. Repeatable, up to 20.

SourceWhere
A JavaScript fileCommand line
An http(s) URLCommand line and server
data:text/javascript,… or data:text/javascript;base64,…Command line and server

The source runs in the page as the body of an async function, and what it returns is the result: a promise is awaited and the value is shown to the navigator as JSON for that step. A script that throws, returns nothing or returns a value that cannot be serialized as JSON is reported to the navigator as such. Sources are loaded when the session starts, capped at 4 MiB each with a 30-second fetch timeout, and one that fails to load is skipped with a warning. Results are truncated at 60,000 characters, and the navigator runs up to 4 scripts per step. In server mode, pass http(s) URLs or data: URIs per request in navigator_script as strings or {"title", "source"} objects; the CLI flag is rejected at server startup.

Example

axe-audit.js runs the axe-core accessibility rules and returns the violations it finds.

Run locally
zshot -t goal \
  --navigator-type "anthropic://YOUR_API_KEY@" \
  --navigator-script "axe accessibility audit, JSON violations for this page=https://zshot-cli.com/scripts/axe-audit.js" \
  --navigate "Report the accessibility violations on this page" \
  https://zshot-cli.com/example_assets/zemu/