Local Testing
Download baseline snapshots and diff images locally with sentry-cli.
This feature is currently in Beta. Beta features are still in progress and may have bugs. We recognize the irony.
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.
sentry-cli snapshots download and sentry-cli snapshots diff are experimental. These commands are subject to breaking changes, including removal, in any Sentry CLI release.
Use sentry-cli snapshots download to pull baseline images from Sentry to a local directory:
sentry-cli snapshots download --app-id web-frontend
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:
sentry-cli snapshots download --app-id web-frontend --branch main
sentry-cli snapshots download --snapshot-id 259299
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.
For very large test suites (tens of thousands of images), you may hit download size limits. In that case, an alternative would be to generate your baseline snapshots locally instead of downloading them (via your base branch). If you're running into this limit with a smaller number of images than expected, reach out to support.
Use sentry-cli snapshots diff to compare two directories of images. See the full diff reference for all available flags.
sentry-cli snapshots diff ./snapshots-base ./snapshots-head
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:
sentry-cli snapshots diff ./snapshots-base ./snapshots-head --fail-on-diff
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.
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
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.
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").