# ath repair

> Repair typed-table JSON bytes left by npm 1.0.0 provider imports.

Website: https://ath.fit/docs/repair/
Markdown: https://ath.fit/docs/repair.md

ATH v1.1.0 · MIT license. Documentation source: [070754a](https://github.com/mwhitham/ath/blob/070754ac465e33d41525c8722c102b56284596f1/src/program.ts). If your installed version differs, check its command help.

v1.1.0 is the latest release on npm. These docs were reviewed against it on 8 November 2026.

## Usage

```text
ath repair
```

## What it does

Previews repair candidates for typed-table JSON encoding left by npm 1.0.0 provider imports. Key-order-only fixes apply with --yes alone. When typed columns disagree with the current revision in meaning (for example after direct SQL edits), use --from-revision after reviewing the preview.

Each confirmed repair creates a new verified SQLite backup. Failed attempts leave that backup on disk for restore; retry creates another backup. Requires sqlite3 on PATH when repair candidates exist.

## Examples

Preview first. For revision alignment, repeat the database ID exactly with --confirm-revision-align.

```text
ath repair
ath repair -y
ath repair -y --from-revision --confirm-revision-align <database-id>
```

## Options

| Argument or option | Description |
| --- | --- |
| `[file]` | optional database path; defaults to the one in this folder |
| `--file <path>` | repair a database other than the one in this folder |
| `-y, --yes` | apply the repair after reviewing the preview |
| `--from-revision` | copy typed-table JSON from the current revision when bytes disagree in meaning |
| `--confirm-revision-align <database-id>` | repeat the database ID exactly when using --from-revision |
| `--dry-run` | show how many records would change and write nothing |
| `--json` | structured preview only |

## Related commands

- [ath migrate](https://ath.fit/docs/migrate/)
- [ath check](https://ath.fit/docs/check/)
