# ed spec-compare compare

> ed spec-compare compare in the Edith ed command line reference. The ed command line

- Canonical URL: https://getedith.pro/docs/cli/spec-compare/compare
- Updated: 2026-12-02

[The `ed` command line](https://getedith.pro/docs/cli)

Compare a base and revision contract without sending API requests.

```sh
ed spec-compare compare /tmp/base.yaml /tmp/revision.yaml
ed spec-compare compare /tmp/base.json /tmp/revision.json --json
```

Both arguments must be absolute paths to regular local `.json`, `.yaml` or `.yml`
files, each at most 8 MiB. Symlinks are resolved, and reports name the resolved
physical path.
OpenAPI 3.0.x and 3.1.x are supported in JSON or YAML. The installed analyzer must
be oasdiff 1.37.0 or later in the 1.x series. Install it separately with
`brew install oasdiff` if needed, then retry.

The default output is deterministic Markdown. `--json` returns `base`, `revision`,
`analyzer`, `operations` and `documentFindings`. Operations have `group` (added,
removed or changed), `method`, `path`, `findings`, `baseSource` and `revisionSource`.
Findings preserve the analyzer rule `id`, `text`, numeric `level`, and source
locations where supplied. Level 3 is breaking, 2 is warning and 1 is information.
Source links carry a line fragment or an OpenAPI JSON pointer when a precise line
is unavailable. File paths are included in reports, so review them before sharing.

Operations and findings are sorted. Reports contain no timestamps. With unchanged
files, analyzer version and paths, repeated comparisons produce identical Markdown.
Unchanged operations are omitted. Changes outside operations appear under document
findings. A changed operation with no consumer rule receives a definition finding.

Unresolved internal references, any external file or URL references, unsupported
versions and invalid documents fail the comparison. A validation failure names the
side (Base or Revision), file, line and column and the analyzer rule text. Each analyzer command has a
30 second deadline and a 64 MiB output limit. The terminal reply is limited to
4 MiB, so very large reports are refused. Comparison does not modify contracts,
install tools, follow server URLs or load local oasdiff configuration.

| Exit code | Meaning |
| --- | --- |
| 0 | The report was printed. |
| 1 | The comparison failed: an invalid, unsupported or oversized contract, or an analyzer error. |
| 2 | The command line was wrong, such as a missing argument. |
| 3 | A contract path does not exist. |
| 4 | oasdiff is not installed. The hint names `brew install oasdiff`. |

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
