Skip to Content
πŸŽ‰ ShotSweep is live! Launched on NFSFU234 Open Source Day.
DocsExamples

Examples

Every example below shows the command you run and the files ShotSweep produces. The examples use real sites from the NFSFU234 open-source ecosystem β€” TourGuideΒ  and FormValidationΒ .

Each example writes to its own output folder. This matters because captures of the same page and viewport use the same filename (full-<W>x<H>.png), so writing light and dark captures to the same folder can cause one run to overwrite the other.

Full-page capture

terminal
shotsweep capture \ --url https://tour-guide.nforshifu234dev.com \ --mode full \ --out ./public/screenshots/full-page
A full-page capture of the TourGuide landing page, stitched into one tall image.

Full-page mode captures the page from top to bottom instead of limiting the result to the initial viewport.

Sectioned capture

terminal
shotsweep capture \ --url https://tour-guide.nforshifu234dev.com \ --mode sections \ --out ./public/screenshots/sections \ --debug

Sectioned mode divides the page into viewport-sized screenshots based on the page’s measured scrollable height.

--debug is useful when you want to inspect what ShotSweep measured during capture, especially when a page contains content that loads or expands after the initial render.

Section 01 β€” top of the page
Section 06 β€” captured section
Section 02 β€” captured section

The number of sections depends on the page's measured scroll height and the capture viewport. Use the debug output or manifest.json to inspect the sections produced by a run.

Capturing a whole sitemap

terminal
shotsweep capture \ --sitemap https://tour-guide.nforshifu234dev.com/sitemap.xml \ --out ./public/screenshots/sitemap

Instead of supplying one URL, you can give ShotSweep a sitemap. It discovers the URLs listed in that sitemap and captures each page into the output directory.

Home β€” /
Getting Started β€” /getting-started
API Reference β€” /api-reference
Examples β€” /examples

Each URL from the sitemap gets its own capture directory, making large documentation sites practical to capture in one command.

Multiple viewports in one run

terminal
shotsweep capture \ --url https://form-validation.nforshifu234dev.com \ --viewport desktop --viewport mobile \ --out ./public/screenshots/viewports

You can request multiple viewport presets in the same capture. ShotSweep runs the capture for each viewport and keeps the resulting screenshots separate by their dimensions.

Desktop β€” 1440Γ—900
Mobile β€” 390Γ—844

The viewport dimensions are part of the output filename, so captures from different viewport sizes can coexist in the same output tree.

Dark mode

terminal
shotsweep capture \ --url https://form-validation.nforshifu234dev.com \ --dark \ --out ./public/screenshots/dark
The page captured with the browser's prefers-color-scheme preference set to dark.

--dark captures the page with a dark color-scheme preference, allowing sites that respond to prefers-color-scheme: dark to render their dark theme during capture.

Visual diff

terminal
shotsweep capture \ --url https://form-validation.nforshifu234dev.com \ --out ./public/screenshots/diff/before shotsweep capture \ --url https://form-validation.nforshifu234dev.com \ --dark \ --out ./public/screenshots/diff/after shotsweep diff \ ./public/screenshots/diff/before/manifest.json \ ./public/screenshots/diff/after/manifest.json \ --out ./public/screenshots/diff/result

The diff command compares two capture manifests and produces visual comparison artifacts for pages that differ between the two runs.

For this example, the two runs intentionally use different color-scheme preferences, so the result demonstrates what a visual change looks like rather than representing a typical before/after regression test.

Run A β€” light mode
Run B β€” dark mode
Diff β€” pixels that changed between the runs

The diff output groups comparison artifacts by page. The exact generated folder name depends on the captured URL and viewport; use diff-report.json or inspect the result directory to locate old.png, new.png, and diff.png.

Next steps

Last updated on