Start here to discover the main workflows, example verbs, review site, overlay screenshots, and JavaScript API docs.
Use this page as the map for the rest of the documentation. css-visual-diff has three common entry points:
List all embedded help pages:
css-visual-diff help --list
Read this starter page again:
css-visual-diff help getting-started
Inspect the repository-scanned example commands:
css-visual-diff verbs --repository examples/verbs examples --help
css-visual-diff verbs --repository examples/verbs examples review-sweep --help
css-visual-diff verbs --repository examples/verbs examples overlay --help
The source examples live in:
examples/verbs/
├── README.md # runnable example commands
├── low-level-inspect.js # locator/extractor/snapshot example
├── overlay-examples.js # annotated PNG and gallery exports
└── review-sweep.js # YAML spec → review-site data directory
Start a static file server from the repository root:
python3 -m http.server 18767
Generate comparison artifacts and a review-site manifest:
css-visual-diff verbs \
--repository examples/verbs \
examples review-sweep from-spec \
--specFile examples/specs/review-site-smoke.yaml \
--outDir /tmp/cssvd-review-site-smoke \
--output json
Serve the interactive review site:
css-visual-diff serve \
--data-dir /tmp/cssvd-review-site-smoke \
--port 18098 \
--open
This path demonstrates the intended larger workflow: JavaScript opens pages and writes evidence; css-visual-diff serve reviews completed evidence without rerunning Chromium.
Use the built-in compare command when you already know the two URLs and selectors:
css-visual-diff compare \
--url1 http://localhost:7070/prototype.html \
--selector1 '[data-section="hero"]' \
--url2 http://localhost:5173/ \
--selector2 '[data-section="hero"]' \
--viewport-w 1280 \
--viewport-h 900 \
--threshold 30 \
--out /tmp/cssvd-hero-compare
This writes screenshots, compare.json, compare.md, and pixel diff images for one region.
Overlay screenshots label page sections or components in context. Run the example fixture server first:
python3 -m http.server 18767
Then export one annotated PNG:
css-visual-diff verbs --repository examples/verbs \
examples overlay annotated-png \
http://127.0.0.1:18767/examples/pages/overlay-components.html \
/tmp/cssvd-overlay \
--contentAlphaPercent 10 \
--output json
For API details, read:
css-visual-diff help javascript-api
and search for cvd.overlaySpec, cvd.overlayTarget, and page.overlay.
| Goal | Help page |
|---|---|
| Learn the JS browser API | css-visual-diff help javascript-api |
| Write project-local CLI workflows | css-visual-diff help javascript-verbs |
| Build pixel-perfect CSS feedback loops | css-visual-diff help pixel-accuracy-scripting-guide |
| Generate review-site data from a YAML spec | css-visual-diff help site-comparison-workflow |
| Use the interactive review website | css-visual-diff help review-site |
| Produce review-site data yourself | css-visual-diff help review-site-data-spec |
| Understand the review-sweep example | css-visual-diff help js-verb-review-sweep |
When in doubt, start with the smoke run above, inspect examples/verbs/review-sweep.js, then adapt the verb pattern to your project.