#compdef zshot

autoload -U is-at-least

_zshot() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-f+[Write output to PATH, or "-" for STDOUT]:PATH:_files' \
'--file-name=[Write output to PATH, or "-" for STDOUT]:PATH:_files' \
'-t+[Output format, default png or inferred from -f]:TYPE:((pdf\:""
png\:""
apng\:""
jpg\:""
webp\:""
jpegxl\:""
tiff\:""
bmp\:""
webm\:""
mkv\:""
avif\:""
gif\:""
mp4\:""
mhtml\:""
html\:""
markdown\:""
txt\:""
har\:""
warc\:""
wacz\:""
sqlite\:""
axtree\:""
axtree_json\:""
llm_text\:""
llm_json\:""
goal\:"What the navigator said when it reported its goal achieved"
trace\:""
pprof_cpu\:""
pprof_memory\:""
download\:""))' \
'--output-type=[Output format, default png or inferred from -f]:TYPE:((pdf\:""
png\:""
apng\:""
jpg\:""
webp\:""
jpegxl\:""
tiff\:""
bmp\:""
webm\:""
mkv\:""
avif\:""
gif\:""
mp4\:""
mhtml\:""
html\:""
markdown\:""
txt\:""
har\:""
warc\:""
wacz\:""
sqlite\:""
axtree\:""
axtree_json\:""
llm_text\:""
llm_json\:""
goal\:"What the navigator said when it reported its goal achieved"
trace\:""
pprof_cpu\:""
pprof_memory\:""
download\:""))' \
'--input-mimetype=[MIME type for local file or STDIN input]:MIME:_default' \
'-c+[Read configuration from PATH]:PATH:_files' \
'--config=[Read configuration from PATH]:PATH:_files' \
'--license-key=[Activate or use a license key]:KEY:_default' \
'--license-json=[Path to a JSON file containing signed license data If not specified, will check ZSHOT_LICENSE_JSON_BASE64 environment variable, then license_json in the config file (base64 encoded)]:LICENSE_JSON:_files' \
'--status-file=[Path to write current-operation status lines to (e.g. a file or FIFO a GUI reads, or \`/dev/tty\`). Undocumented; most users get auto status on a TTY without it. When the path is a terminal the line is overwritten in place; otherwise it is newline-delimited]:FILE:_files' \
'--wait-for=[Condition or delay to wait for before capture]:WAIT_FOR:_default' \
'--timeout=[Total timeout in seconds, 0 for none]:SECONDS:_default' \
'-l+[Logging level, default error]:LEVEL:_default' \
'--log-level=[Logging level, default error]:LEVEL:_default' \
'--install-skill=[Install the zshot Agent Skill]::PATH:_files' \
'--completions=[Print shell completion script and exit]::SHELL:((bash\:"Bourne Again Shell"
elvish\:"Elvish"
fish\:"Friendly Interactive Shell"
powershell\:"PowerShell"
zsh\:"Z Shell"))' \
'-x+[Browser width in pixels, default 1920]:WIDTH:_default' \
'--browser-width=[Browser width in pixels, default 1920]:WIDTH:_default' \
'-y+[Browser height in pixels, default 1080]:HEIGHT:_default' \
'--browser-height=[Browser height in pixels, default 1080]:HEIGHT:_default' \
'--device=[Device preset to emulate, from --device-list]:NAME:_default' \
'--llm-debug=[Write LLM prompts, replies, and screenshots]:PATH:_files' \
'--llm-usage=[Write LLM token usage as JSON to PATH]:PATH:_files' \
'--device-scale-factor=[Rendering scale factor]:SCALE:_default' \
'--user-agent=[User-Agent sent by the browser]:AGENT:_default' \
'--accept-language=[Accept-Language sent by the browser]:LANGUAGES:_default' \
'--platform=[Navigator platform string]:PLATFORM:_default' \
'--emulate-media=[CSS media type to emulate, e.g. screen or print]:MEDIA:_default' \
'--emulate-touch-points=[Touch points to emulate, 1–16]:NUMBER:_default' \
'--emulate-geolocation=[Emulate geolocation with an RFC 5870 geo URI]:GEOSTRING:_default' \
'--emulate-timezone=[IANA timezone to emulate]:IANA_TZ:_default' \
'--emulate-vision-deficiency=[Vision deficiency to emulate in browser]:TYPE:((blurredVision\:"Simulates blurred vision"
reducedContrast\:"Simulates reduced contrast sensitivity"
achromatopsia\:"Complete color blindness (monochromacy)"
deuteranopia\:"Red-green color blindness (missing green cones)"
protanopia\:"Red-green color blindness (missing red cones)"
tritanopia\:"Blue-yellow color blindness (missing blue cones)"))' \
'--emulate-memory=[Override navigator.deviceMemory in GB]:GB:_default' \
'--emulate-hardware-concurrency=[Override navigator.hardwareConcurrency]:CORES:_default' \
'--emulate-gpu-vendor=[Override WebGL unmasked vendor string]:VENDOR:_default' \
'--emulate-gpu-renderer=[Override WebGL unmasked renderer string]:RENDERER:_default' \
'*-H+[Pass custom headers to target domain]:HEADER:_default' \
'*--header=[Pass custom headers to target domain]:HEADER:_default' \
'--web-bot-auth=[Sign requests with Web Bot Auth]:AGENT=KEY:_default' \
'*--cookie=[Set cookies in the browser]:COOKIE:_default' \
'--storage=[Load and save browser storage state]:PATH:_default' \
'--storage-limit=[Maximum browser storage file size in bytes]:BYTES:_default' \
'--storage-chrome-profile=[Seed storage from a Chrome profile]::PATH:_files' \
'--storage-firefox-profile=[Seed storage from a Firefox profile]::PATH:_files' \
'--storage-safari-profile=[Seed storage from a Safari profile]::PATH:_files' \
'--storage-chrome-profile-key=[Safe Storage password for Chrome profile]:KEY:_default' \
'--javascript=[JavaScript code to run after page load]:JAVASCRIPT:_default' \
'--javascript-file=[JavaScript file to run after page load]:PATH:_files' \
'--proxy-server=[Proxy server URL]:URL:_default' \
'--proxy-auth=[Proxy server user and password]:AUTH:_default' \
'--image-width=[Width of output image]:WIDTH:_default' \
'--image-height=[Height of output image]:HEIGHT:_default' \
'--image-selector=[CSS selector for element to capture as image]:SELECTOR:_default' \
'--image-duration=[Duration of output image, if animated]:SECONDS:_default' \
'--image-framerate=[Animated image framerate, default 5]:FPS:_default' \
'--bmp-pixel-format=[BMP pixel format, default bgr24]:FORMAT:((bgr24\:"24-bit blue, green, red — the byte order standard BMP stores"
rgb565le\:"16-bit 5-6-5 red/green/blue, little-endian"
gray8\:"8-bit grayscale"))' \
'--video-width=[Width of output video]:WIDTH:_default' \
'--video-height=[Height of output video]:HEIGHT:_default' \
'--video-selector=[CSS selector of element to capture as video]:SELECTOR:_default' \
'--video-framerate=[Framerate of output video]:FPS:_default' \
'--video-duration=[Duration of output video]:SECONDS:_default' \
'--pdf-width=[Width of output PDF in inches]:INCHES:_default' \
'--pdf-height=[Height of output PDF in inches]:INCHES:_default' \
'--pdf-scale=[PDF render scale, 0.1–2]:SCALE:_default' \
'--markdown-format=[Markdown dialect\: common or gfm]:FORMAT:((common\:"CommonMark format (standard markdown without extensions)"
gfm\:"GitHub Flavored Markdown (includes tables, strikethrough, autolinks, etc.)"))' \
'--markdown-selector=[CSS selector of elements for markdown]:SELECTOR:_default' \
'--llm-format-prompt=[Prompt guiding LLM extraction]:PROMPT:_default' \
'--llm-format-expects=[JSON Schema or allowed answers for LLM output]:EXPECTATION:_default' \
'--llm-format-model=[Model connection URI for LLM output]:CONFIG:_default' \
'--navigate=[Instructions for the browser navigator]:INSTRUCTIONS:_default' \
'*--navigator-type=[Model connection URI for navigation]:CONFIG:_default' \
'--navigator-escalation-max=[Max actions per escalation turn, default 1]:N:_default' \
'*--navigator-credential=[Credential for the navigator as key=value]:CREDENTIAL:_default' \
'*--navigator-credential-helper=[Resolve credential via command or URL]:NAME=SPEC:_default' \
'--navigator-credential-secret=[Shared secret passed to credential helpers]:SECRET:_default' \
'--navigator-credential-helper-timeout=[Credential helper timeout, default 30]:SECONDS:_default' \
'*--navigator-credential-helper-env=[Environment variable passed to helpers]:VAR:_default' \
'*--navigator-credential-env=[Read navigator credential from env var]:NAME=VAR:_default' \
'*--navigator-credential-origin=[URL glob where a credential may be filled]:[NAME=]GLOB:_default' \
'*--navigator-file=[File available for navigator uploads]:FILE:_default' \
'*--navigator-data=[Named data value visible to the navigator]:NAME=VALUE:_default' \
'*--navigator-data-json=[JSON object, file, or URL of navigator data]:JSON:_default' \
'--navigator-file-timeout=[Timeout for fetching navigator file URL]:SECONDS:_default' \
'--navigator-file-size-limit=[Maximum navigator file size in bytes]:BYTES:_default' \
'--navigator-goal=[Goal condition that completes navigation]:GOAL:_default' \
'--navigator-max-steps=[Maximum steps to reach goal, default 10]:NUMBER:_default' \
'--navigator-stall-escalation=[Unchanged-page steps before escalating]:NUMBER:_default' \
'--navigator-step-timeout=[Navigator step timeout, default 30]:SECONDS:_default' \
'--navigator-initial-scope=[Initial URL scope\: origin, domain, or path]:SCOPE:((origin\:"The start URL'\''s origin\: its scheme, host, and port"
domain\:"The start URL'\''s registrable domain and every subdomain of it, on any port"
path\:"The start URL'\''s folder and everything beneath it"))' \
'*--navigator-allow-url=[Additional URL glob the navigator may visit]:GLOB:_default' \
'*--navigator-deny-url=[URL glob the navigator may not visit]:GLOB:_default' \
'--navigator-captures-video=[Record navigator session video to PATH]:PATH:_files' \
'--navigator-captures-playwright=[Write navigator actions as Playwright script]:PATH:_files' \
'--navigator-captures-puppeteer=[Write navigator actions as Puppeteer script]:PATH:_files' \
'--navigator-video-width=[Width of navigator video]:WIDTH:_default' \
'--navigator-video-height=[Height of navigator video]:HEIGHT:_default' \
'--navigator-video-captions-position=[Caption position on navigator video]:POSITION:_default' \
'--har=[Write HTTP Archive to PATH]:PATH:_files' \
'--archive-body-size-limit=[Maximum archived response body size in bytes]:BYTES:_default' \
'--network-log=[Capture network actions in a log file]:PATH:_files' \
'--warc=[Path to write a WARC for this request]:PATH:_files' \
'--archive-cdx=[Write CDXJ index of WARC records to PATH]:PATH:_files' \
'--sqlite=[Write SQLite archive to PATH]:PATH:_files' \
'--crawl-url-is-sitemap=[Treat input URL as a sitemap or URL list]::FORMAT:((auto\:"Infer the format from the target extension, then its Content-Type"
xml\:"XML sitemap\: \`<urlset>\` page list or \`<sitemapindex>\` of child sitemaps"
text\:"Plain text\: one URL per line; blank lines and \`#\` comments ignored"))' \
'--crawl-sitemap-max-depth=[Sitemap index depth to follow, default 1]:N:_default' \
'*--crawl-allow-url=[URL glob to include when crawling]:GLOB:_default' \
'*--crawl-deny-url=[URL glob to skip when crawling]:GLOB:_default' \
'--crawl-delay=[Minimum seconds between same-host loads]:SECS:_default' \
'--crawl-concurrency=[Concurrent browsers during a crawl]:N:_default' \
'--crawl-page-timeout=[Per-page timeout in seconds during a crawl]:SECONDS:_default' \
'--crawl-link-depth=[Maximum link hops to follow from seed URL]:N:_default' \
'*--crawl-link-selector=[Additional CSS selector for links to follow]:CSS:_default' \
'--crawl-max-links=[Maximum pages to capture during a crawl]:N:_default' \
'--archive-spill-max-bytes=[Maximum bytes spilled to disk during a crawl]:BYTES:_default' \
'--axtree=[Write accessibility tree to PATH]:PATH:_files' \
'--trace=[Write performance trace to PATH]:PATH:_files' \
'--pprof-cpu=[Write CPU sampling profile to PATH]:PATH:_files' \
'--pprof-memory=[Write memory allocation profile to PATH]:PATH:_files' \
'--pprof-cpu-interval-us=[CPU sampling interval in microseconds]:PPROF_CPU_INTERVAL_US:_default' \
'--pprof-memory-interval-bytes=[Memory sampling interval in bytes]:PPROF_MEMORY_INTERVAL_BYTES:_default' \
'*--chromium-arg=[Append a raw Chromium command-line switch]:ARG:_default' \
'*--chromium-preference=[Set a Chromium preference]:NAME=VALUE:_default' \
'*--block-ip-range=[Block requests to CIDR IP range]:CIDR:_default' \
'*--allow-ip-range=[Allow requests to CIDR IP range]:CIDR:_default' \
'*--ip-blocklist=[Load IP blocklist from file or URL]:PATH_OR_URL:_default' \
'--server-update-blocklist-interval=[Re-fetch --ip-blocklist sources every SECONDS]:SECONDS:_default' \
'*--adblock-rules=[Load EasyList adblock rules from file or URL]:PATH_OR_URL:_default' \
'--server-update-adblock-interval=[Re-fetch --adblock-rules sources every SECONDS]:SECONDS:_default' \
'--server-bind-address=[Server bind address or unix\:PATH]:IFADDR_OR_PATH:_default' \
'--server-bind-port=[Server bind port, default 3000]:PORT:_default' \
'--server-basic-auth=[Require HTTP Basic auth as user\:password]:AUTH:_default' \
'--server-token-auth=[Require Bearer token auth for requests]:TOKEN:_default' \
'--server-delegated-auth=[Delegate request auth to URL or command]:URL|COMMAND:_default' \
'--server-delegated-auth-timeout=[Delegated auth timeout, default 5]:SECONDS:_default' \
'--server-prometheus-auth=[HTTP Basic auth for /metrics endpoint]:AUTH:_default' \
'--server-prometheus-bind-address=[Separate bind address for /metrics listener]:IFADDR:_default' \
'--server-prometheus-bind-port=[Port for the separate /metrics listener]:PORT:_default' \
'*--server-response-header=[Add a custom header to every server response]:NAME: VALUE:_default' \
'--server-enable-cors=[Enable CORS for ORIGINS, or all origins]::ORIGINS:_default' \
'--server-signed-url=[Require HMAC-signed URLs for GET requests]:ALGO:SECRET:_default' \
'--server-signed-url-max-age=[Maximum age in seconds for signed URLs]:SECONDS:_default' \
'--server-additional-asset-expiration=[TTL in seconds for with_* render assets]:SECONDS:_default' \
'--server-cache=[Cache render results on disk]::PATH:_files' \
'--server-cache-ttl=[Server cache entry TTL in seconds]:SECONDS:_default' \
'--server-cache-size-limit=[Maximum server cache size in bytes]:BYTES:_default' \
'--server-max-concurrency=[Maximum concurrent render requests]:NUMBER:_default' \
'--server-queue-requests=[Max queued requests when busy, default 100]:NUMBER:_default' \
'--cdp=[Serve a CDP endpoint or run "-- CMD"]::HOST:PORT:_default' \
'-h+[Show help. \`--help all\` shows everything.]::category:_default' \
'--help=[Show help. \`--help all\` shows everything.]::category:_default' \
'--no-timeout[Disable timeouts]' \
'--no-fail[Consider non-2XX responses successful]' \
'--log-chrome-to-stderr[Show Chromium/CEF logs in log output]' \
'-q[Disable all logging output]' \
'--quiet[Disable all logging output]' \
'--no-preview[Disable inline terminal previews]' \
'--software-rendering[Render in software without a GPU]' \
'--open-source-licenses[Print open-source license notices and exit]' \
'--diagnostics[Output environment diagnostics]' \
'--llm-info[Output LLM integration info as JSON\: resolved formatter/navigator config (protocol, model, options, vision capability) plus the raw Jinja prompt templates used for each navigator phase and the formatter. Combine with \`--llm-format-model\` or \`--navigator-type\` to see how those inputs resolve]' \
'--llm-info-spec[Print the JSON Schema for the \`--llm-info\` document and exit]' \
'--license-info[Output license info]' \
'--refresh-license[Refresh saved license from licensing server]' \
'--trial[Request and activate a Pro trial license]' \
'--eula[Output the End User License Agreement]' \
'--device-list[List all device presets]' \
'--device-list-json[]' \
'--formats[List available output formats]' \
'--formats-json[]' \
'--cli-schema[Print the JSON Schema for this CLI to stdout and exit]' \
'--flag-docs-json[Print every visible flag'\''s help, category, tier and zshot-cli.com page as JSON and exit]' \
'--request-schema[Print the JSON Schema for the HTTP \`POST /\` request body and exit. The HTTP payload mostly overlaps with the CLI flags but renames a few fields (\`headers\`→\`header\`, \`cookies\`→\`cookie\`, \`process_timeout\`→\`timeout\`, \`no_fail\`→\`fail\`, etc.) and uses different optionality for several others — this schema is the authoritative source for those differences]' \
'--emulate-dark-mode[Emulate dark color scheme]' \
'--emulate-mobile-device[Enable mobile device emulation]' \
'--emulate-disable-bluetooth[Disable Web Bluetooth API]' \
'--emulate-disable-usb[Disable WebUSB API]' \
'--emulate-disable-serial[Disable Web Serial API]' \
'--skip-robot-instructions[Skip robots.txt and page robot directives]' \
'--remove-modals[Remove modal overlays, popups, and paywalls]' \
'--full-page[Capture the full scrollable page]' \
'--pdf-landscape[Render PDF in landscape]' \
'--pdf-prefer-css-page-size[Use CSS page size over printing page size]' \
'--pdf-generate-tagged-pdf[Generate a tagged accessible PDF]' \
'--pdf-generate-document-outline[PDF will have a table of contents]' \
'--markdown-no-title[Omit the page title from markdown output]' \
'--markdown-embed-content[Embed images in markdown as data URIs]' \
'--llm-no-screenshot-labels[Omit element ref labels from LLM screenshots]' \
'--navigator-renders-when-impossible[Still render when goal is reported impossible]' \
'--navigator-session-archived[Include entire navigator session in archives]' \
'--navigator-video-shows-captions[Draw action captions on navigator video]' \
'--navigator-video-shows-pointer[Draw pointer on navigator video]' \
'--har-capture-bodies[HAR will contain response bodies]' \
'--warc-no-gzip[Disable gzip compression for output WARC]' \
'--crawl-links[Follow and archive links on captured pages]' \
'--crawl-media-sources[Archive <audio> and <video> source URLs]' \
'--axtree-only-visible[Include only visible elements in axtree]' \
'--trace-no-gzip[Disable gzip compression for the trace]' \
'--trace-no-screenshots[Omit the screenshot filmstrip from the trace]' \
'--trace-captures-navigation[Trace will contain navigator session]' \
'--pprof-no-gzip[Disable gzip compression for pprof output]' \
'--pprof-captures-navigation[pprof will contain navigator session]' \
'--no-sandbox[Disable Chromium/CEF process sandboxing]' \
'--container[Run with container sandbox and licensing]' \
'--insecure-web-mode[Disable cross-site web security protections]' \
'--allow-unsafe-ssl[Ignore SSL certificate errors]' \
'--block-private-ips[Block requests to private IP ranges]' \
'-s[Run as an HTTP server]' \
'--server[Run as an HTTP server]' \
'--server-enable-schema[Enable the /openapi.json schema endpoint]' \
'--server-enable-prometheus[Enable the /metrics Prometheus endpoint]' \
'--server-enable-mcp[Enable the /mcp HTTP endpoint]' \
'(-s --server)--mcp-local-server[Run as an MCP server over stdio]' \
'--cdp-webdriver[Expose loopback attach for WebDriver clients]' \
'--agent-help[Usage information tailored for automated agents]' \
'-V[Print version]' \
'--version[Print version]' \
'*::urls -- URL or local file to fetch, or "-" for STDIN:_default' \
&& ret=0
}

(( $+functions[_zshot_commands] )) ||
_zshot_commands() {
    local commands; commands=()
    _describe -t commands 'zshot commands' commands "$@"
}

if [ "$funcstack[1]" = "_zshot" ]; then
    _zshot "$@"
else
    compdef _zshot zshot
fi
