# asc diff

> asc diff: compare App Store localization metadata between local files and a version, or between two versions, without changing anything.

Source: https://air.build/docs/cli/asc-diff/

`asc diff` prints plans of the differences between two sets of App Store metadata. It changes nothing, and the same inputs always give the same plan. It needs an Apple team (`--auth`); output and exit codes work as described on the [asc](https://air.build/docs/cli/asc/) page, and the flag table leaves out `--output` and `--pretty`, which are explained there.

| Subcommand | What it does |
| --- | --- |
| [localizations](https://air.build/docs/cli/asc-diff/#localizations) | Compares version localizations from local files or another version. |

## localizations

Compares the localized App Store text of a version (`description`, `keywords`, `marketingUrl`, `promotionalText`, `supportUrl`, `whatsNew`) between a source and a target, locale by locale.

It has two modes:

- **Local against remote:** `--path` (a folder of `LOCALE.strings` files, or one such file) is the source and `--version` the target.
- **Remote against remote:** `--from-version` is the source and `--to-version` the target.

`--version`, `--from-version` and `--to-version` are App Store version IDs, not version strings, and each must belong to the `--app` app. Find them with `asc versions list --app 1234567890`.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`). Required. | — |
| `--path` | Local `.strings` folder or file to use as the source. | — |
| `--version` | Target version ID. Required with `--path`. | — |
| `--from-version` | Source version ID. | — |
| `--to-version` | Target version ID. Required with `--from-version`. | — |

Notes:

- Give `--path` or `--from-version`, not both; with neither, the command exits `2` with `Error: either --path or --from-version is required`. `--to-version` can't be used with `--path`, nor `--version` with `--from-version`.
- Local files are checked before any request: an unknown key in a `.strings` file stops the command.
- The JSON plan has `scope` (`localizations`), `appId`, `direction` (`source-to-target`), `source` and `target` (each with `kind`, `local` or `remote`, and its `path` or `versionId`), and three lists: `adds` (`field exists in target but not in source`), `updates` (`field value differs`) and `deletes` (`field exists in source but not in target`). Each item names its `key` (`LOCALE:field`), `locale`, `field` and `reason`, plus `from` (updates, deletes) and `to` (adds, updates).
- Table and Markdown output show one row per change with `change` (`add`, `update` or `delete`), `key`, `locale`, `field`, `reason`, `from` and `to`, with long values shortened; with no differences, one row reads `none` and `no changes`.

```sh
asc diff localizations --app "1234567890" --path "./metadata/localizations" --version "VERSION_ID"
asc diff localizations --app "1234567890" --from-version "VERSION_ID_A" --to-version "VERSION_ID_B" --output table
```
