# snapdir diff Compare two sides, each a set of manifests, reporting file-level differences. `diff` reads MANIFESTS ONLY: it compares manifest entries without downloading the content objects those manifests reference. That makes it useful for scheduled inventory comparisons, release deltas, and audit workflows where object pools may be large or remote. ## Usage ```text snapdir diff [OPTIONS] ``` ### Options | Option | Description | | --- | --- | | `--from ` | FROM-side ref. Repeatable; refs are unioned into the FROM side. | | `--to ` | TO-side ref. Repeatable; refs are unioned into the TO side. | | `--id ` | Pin each side to this single manifest ID instead of unioning the whole store. | | `--all` | Also emit unchanged `=` paths. | | `--json` | Emit a JSON array of `{status, path}` objects instead of porcelain lines. | | `--exit-code` | Exit `1` when any difference is found, like `git diff --exit-code`. | | `--on-conflict ` | Intra-side path collision policy: `error` (default) or `last-wins`. | Statuses are `A` for added, `D` for deleted, and `M` for modified. With `--all`, unchanged paths are emitted as `=`. ## Examples Compare two manifest stores: ```console snapdir diff --from s3://inventory/prod --to gs://inventory/dr ``` Compare a single pinned manifest ID on each side and fail the command when any difference exists: ```console snapdir diff --id 1220abc... --from s3://inventory/a --to s3://inventory/b --exit-code ``` Emit JSON for tooling: ```console snapdir diff --from file:///srv/before --to file:///srv/after --json ``` Resolve same-path collisions within a side by letting the last repeated ref win: ```console snapdir diff --from s3://old-a --from s3://old-b --to s3://new --on-conflict last-wins ``` ## See also - [`snapdir manifest`](snapdir-manifest.md) — print the manifest text being compared - [`snapdir sync`](snapdir-sync.md) — copy snapshots between stores - [Agentic vulnerability auditing](../use-cases/agentic-vulnerability-auditing.md)