# Asset review

`cms-edit asset review` audits visual assets (images, videos, Lottie JSON) from the local index.

## Sync first

```bash
cms-edit index sync
```

Default: **Preview API** (includes drafts). Use `--published` on sync/review for delivery-only content.

## Run

```bash
cms-edit asset review
cms-edit --json-output asset review --space brightline > media-review.json
cms-edit --json-output asset review --include-usage --usage-limit 5
cms-edit --json-output asset review --include-usage --include-passing --usage-limit 0 > image-inventory.json
```

`--include-usage` adds slug-bearing page/article ancestry per asset (slower; uses CMA walk-up). By default only the first **50** assets in the report get usages (`--usage-limit 50`). Raise the limit for larger batches, or pass `--usage-limit 0` for unlimited (fine locally; hosted MCP may timeout on large spaces). Use with `--include-passing` for a full image inventory (replaces the old `audit images` command).

## Checks

- Filename quality (stock IDs, camera defaults, generic names)
- Alt text (`description` on asset)
- Dimensions (max width, default 2000px; SVG/Lottie skipped)
- File size (defaults: 800 KB images, 8 MB video, 400 KB Lottie)
- Animated GIF (`image/gif`)
- No media wrapper (warning — may still be used in rich text)

## Options

| Flag | Default |
|------|---------|
| `--max-width` | 2000 |
| `--max-image-kb` | 800 |
| `--max-video-mb` | 8 |
| `--max-lottie-kb` | 400 |
| `--include-passing` | off (failures only) |
| `--include-usage` | off (no usage ancestry in JSON) |
| `--usage-limit` | 50 when `--include-usage` is set (`0` = unlimited) |
| `--published` | off (Preview index) |

Exit code **1** when any asset has failing issues.

## Spreadsheet

Use the **contentful-cms-media-review** skill with `--json` output to build an Excel workbook.

## Fix alt text

```bash
cms-edit asset set-description <asset-id> "Descriptive alt text"
```