Skip to Content
🎉 ShotSweep is live! Launched on NFSFU234 Open Source Day.
DocsCLI Reference

CLI reference

ShotSweep’s CLI lets you capture screenshots, reuse authenticated sessions, and compare capture runs for visual regressions. The reference below lists every command, flag, and default value, with examples for common workflows.

shotsweep │ ├── capture ├── login └── diff

shotsweep capture

Take screenshots of one or more pages.

Input (pick one)

FlagDescription
--url <url>Single URL to capture
--urls <file>JSON array or newline-delimited file of URLs
--csv <file>CSV file containing a column of URLs
--csv-column <name>Column name in the CSV holding the URL (auto-detected if omitted)
--sitemap <url>sitemap.xml URL to fetch and parse
--base <url>Base URL to prepend to --paths
--paths <file>JSON array or newline-delimited file of relative paths, used with --base
--replace-origin <url>Rewrite every resolved URL’s origin to this
--limit <n>Capture at most this many resolved URLs (positive integer)
--offset <n>Skip this many resolved URLs before capturing (0 or more)

URLs don’t need a scheme: example.com becomes https://example.com (http:// for localhost and loopback addresses), and a pasted Markdown link such as [x](https://x.com) is unwrapped. See Inputs & Sitemaps.

Capture behavior

FlagDescriptionDefault
--mode <mode>full, sections or elementfull
--selector <css>CSS selector of the single element to capture. Required with --mode element—
--viewport <WxH|preset>Repeatable, e.g. --viewport 1440x900desktop
--wait-until <domcontentloaded|load|networkidle>What counts as “page loaded” before capturingload
--wait <ms|selector>Wait a fixed ms or for a CSS selector, after --wait-until resolves. A selector that never appears is capped by --timeout and recorded as a warning—
--no-scrollSkip the top-to-bottom scroll that triggers scroll-reveal animations and lazy-loaded imagesscroll is on for full and sections
--image-wait <ms>After scrolling, how long to wait for images still loading. Unfinished images are reported as a warning10000
--strict-loadFail a page when --wait-until times out, instead of capturing it anyway with a warningfalse
--freeze-animationsFast-forward finite CSS animations and cancel infinite ones while capturingfalse
--user-agent <string>Present this User-Agent instead of headless Chromium’s—
--ignore-https-errorsAccept invalid or self-signed TLS certificatesfalse
--darkEmulate prefers-color-scheme: darkfalse
--out <dir>Output directory./screenshots

Auth

FlagDescription
--session <file>Reuse a saved storageState session
--bearer <token>Sets Authorization: Bearer <token> on requests to the captured site (and its subdomains)
--header <"Key: Value">Repeatable, arbitrary request header, sent to the captured site only
--headers-all-originsSend --bearer / --header values to every origin the page contacts, including third parties
--cookie <"name=value; Domain=...">Repeatable cookie to inject (needs a Domain=; also accepts Path=, Secure, HttpOnly, SameSite=)

Reliability & recovery

FlagDescriptionDefault
--concurrency <n>Pages captured in parallel1
--timeout <ms>Timeout for each page load, selector wait and screenshot30000
--retries <n>Retry a failed page load this many times0
--resumeSkip full-page URL+viewport pairs already captured in --out’s manifest whose screenshot file still existsfalse

Output & scripting

FlagDescriptionDefault
--zipAlso bundle the output directory into a .zip after capturefalse
--dry-runResolve and print target URLs without capturing anythingfalse
--jsonPrint the final result as one JSON line instead of colored outputfalse
--debugShow detailed diagnostic output while runningfalse
--verbosePrint one persistent line per completed job, instead of an overwriting spinnerfalse
--quietSuppress the live progress linefalse
--describePrint an AI-ready summary of the captured screenshotsfalse
--no-recordSkip writing run-record.json (tool, browser and OS versions, resolved config, artifact hashes)the record is written

shotsweep login

Drive a login form once and save the session for reuse with capture --session.

FlagRequiredDescription
--login-url <url>YesPage containing the login form
--email-selector <css>YesCSS selector for the email/username field
--password-selector <css>YesCSS selector for the password field
--submit-selector <css>YesCSS selector for the submit button
--email <value>NoEmail/username (or set SHOTSWEEP_EMAIL)
--password <value>NoPassword (or set SHOTSWEEP_PASSWORD)
--session-out <file>NoWhere to save the session (default ./auth.json)

shotsweep diff

Compare two capture runs using their manifest.json files.

terminal
shotsweep diff <old-manifest> <new-manifest>
FlagDescriptionDefault
--out <dir>Where to write diff images and the report./diff
--threshold <ratio|percent|preset>Fraction of differing pixels before a page counts as changed — accepts 0.001, "0.1%", or strict/default/loosedefault (0.001)
--zipAlso bundle the diff output into a .zip when donefalse
--jsonPrint the summary as JSON instead of colored outputfalse
--summaryPrint a human-readable visual regression summaryfalse
--text <file>Write the human-readable summary to a text file—

See Diffing Two Runs for thresholds, regression policy, reports, and exit-code behavior.

Config file

Drop a shotsweep.config.json or .shotsweeprc.json in your project so shotsweep capture and shotsweep diff run with fewer flags.

shotsweep.config.json
{ "sitemap": "https://example.com/sitemap.xml", "viewport": ["1440x900", "390x844"], "mode": "full", "out": "./screenshots", "diff": { "out": "./diff", "threshold": "loose", "summary": true, "text": "./reports/visual-summary.txt" } }

Top-level keys are shared defaults for both commands. Repeatable options such as viewport accept either a single string or an array.

A config file that exists but isn’t valid JSON stops the run with an error naming the file, so a typo never silently turns into default settings. Keys that don’t match any option are reported as warnings (on stderr) and ignored.

A "diff" sub-object overrides shared keys specifically for shotsweep diff.

Priority, highest to lowest:

explicit CLI flag → command-specific config (diff.*) → shared top-level config

For example, the config can provide the default threshold, output directory, summary, and text report without requiring those flags every time.

An explicit CLI flag still wins:

terminal
shotsweep diff \ before/manifest.json \ after/manifest.json \ --threshold strict

Threshold values from a config file go through the same ratio, percentage, and preset normalization as CLI values.

See Diffing Two Runs.

Last updated on