Skip to content

CLI Reference

The ditto command provides snapshot management tools independent of a test run.

Commands

Command Description
ditto run Run pytest with snapshot reporting
ditto update Regenerate all snapshots
ditto prune Remove stale snapshots
ditto verify Fail if the backend drifted from ditto.lock
ditto list List all snapshot files
ditto status Show aggregate statistics
ditto clean Delete all .ditto/ directories
ditto recorders List registered recorder plugins
ditto doctor Run health checks
ditto lint Check snapshots for issues
ditto stats Per-directory usage breakdown

Run ditto --version to print the installed pytest-ditto version (include it in bug reports).

CLI and remote backends

ditto list, status, stats, and lint are credential-free by default. Local snapshots are read straight from the filesystem; remote snapshots are read from the committed ditto.lock. No test modules are imported and no backend credentials are needed — even for projects with remote or fixture-defined targets, because the lock already records every resolved target from past runs.

Pass --live to read the live backends instead (an internal pytest --setup-only pass that resolves real fixtures and per-test record(target=…) marks). --live imports your test modules and needs the same credentials your test run needs.

Remote snapshots read from the lock have no physical size or modified date (shown as —); use --live for those. See The Lock File.

ditto clean remains local-only and never touches remote snapshots.