---
title: "Local Testing"
description: "Download baseline snapshots and diff images locally with sentry-cli."
url: https://docs.sentry.io/product/snapshots/local-testing/
---

# Local Testing

This feature is available only if you're in the [Early Adopter program](https://docs.sentry.io/organization/early-adopter-features.md). Features available to Early Adopters 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.

## [Downloading Baselines](https://docs.sentry.io/product/snapshots/local-testing.md#downloading-baselines)

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

**bash**

```bash
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:

**bash**

```bash
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](https://docs.sentry.io/cli/snapshots.md#download-baselines) for all available flags.

## [Diffing Locally](https://docs.sentry.io/product/snapshots/local-testing.md#diffing-locally)

Use `sentry-cli snapshots diff` to compare two directories of images. See the [full diff reference](https://docs.sentry.io/cli/snapshots.md#local-diff) for all available flags.

**bash**

```bash
sentry-cli snapshots diff ./snapshots-base ./snapshots-head
```

This outputs JSON with per-image results (`changed`, `unchanged`, `added`, `removed`) 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:

**bash**

```bash
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.

## [End-to-End Workflow](https://docs.sentry.io/product/snapshots/local-testing.md#end-to-end-workflow)

**bash**

```bash
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](https://docs.sentry.io/cli/snapshots.md).
