Local Testing

Download baseline snapshots and diff images locally with sentry-cli.

You can download baseline snapshots from Sentry and diff them against local images without leaving your machine. This is useful for fast iteration during development or for AI-assisted visual regression workflows.

Use sentry-cli snapshots download to pull baseline images from Sentry to a local directory:

Copied
sentry-cli snapshots download --app-id web-frontend

This resolves the latest baseline snapshot for the given app-id and extracts images to ./snapshots-base/. You can also target a specific branch or snapshot:

Copied
sentry-cli snapshots download --app-id web-frontend --branch main

sentry-cli snapshots download --snapshot-id 259299

Use --output to change the destination directory. See the full download reference for all available flags.

Use sentry-cli snapshots diff to compare two directories of images. See the full diff reference for all available flags.

Copied
sentry-cli snapshots diff ./snapshots-base ./snapshots-head

This outputs JSON with per-image results (changed, unchanged, added, removed, and skipped when using --selective) and writes diff mask images to ./diff-output/. Use --fail-on-diff to exit with code 1 when any differences are found — useful in CI or pre-push hooks:

Copied
sentry-cli snapshots diff ./snapshots-base ./snapshots-head --fail-on-diff

Pass --threshold to ignore sub-pixel noise (default 0.01), or --selective to treat missing base images as skipped instead of removed.

Copied
sentry-cli snapshots download --app-id web-frontend
# (Run your snapshot generation command here -> saved into ./path/to/snapshots)
sentry-cli snapshots diff ./snapshots-base ./path/to/snapshots --fail-on-diff

For the full flag reference, see the Snapshots CLI reference.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").