CLI ToolsMay 12, 2026·2 min read

oasdiff — OpenAPI Breaking-Change Diff CLI

oasdiff compares two OpenAPI specs and flags breaking changes with CI-friendly exit codes, so API refactors don’t silently ship incompatible contracts.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Stage only · 17/100Stage only
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Stage only
Trust
Trust: Established
Entrypoint
Asset
Universal CLI install command
npx tokrepo install ad3d0523-cda7-4257-9bdb-023370d39c5a
Intro

oasdiff compares two OpenAPI specs and flags breaking changes with CI-friendly exit codes, so API refactors don’t silently ship incompatible contracts.

  • Best for: API teams that publish OpenAPI, and platform teams enforcing contract safety in CI
  • Works with: OpenAPI YAML/JSON files, local files or URLs, CI pipelines (exit codes)
  • Setup time: 5–15 minutes

Practical Notes

  • Use breaking as a hard gate; use changelog to help reviewers.
  • CI tip: store previous spec as an artifact and compare on PR.

CI gate: block incompatible API changes

The common failure mode is “a schema field got renamed and nobody noticed”. Make it explicit by comparing base vs revision on every PR:

oasdiff breaking openapi.base.yaml openapi.pr.yaml

If breaking changes exist, the command exits non-zero, which is ideal for CI.

Reviewer UX: attach a human-friendly changelog

In addition to failing CI, provide a readable summary:

oasdiff changelog openapi.base.yaml openapi.pr.yaml > oasdiff.changelog.txt

Paste the key lines into the PR description (or post via a bot).

Practical tips

  • Normalize specs first (same bundling/flattening strategy) to reduce false diffs.
  • Keep specs in-repo so agents and CI can diff deterministically.
  • If your spec comes from codegen, pin the generator version and compare the generated output.

FAQ

Q: Does it only detect breaking changes? A: No. It can also output full diffs and changelogs; breaking is the strict subset for gates.

Q: Can I compare URLs instead of files? A: Yes—oasdiff supports various inputs; keep CI inputs stable for deterministic results.

Q: How do I reduce noisy diffs? A: Ensure both specs are normalized the same way (flattening, ordering, bundling).

🙏

Source & Thanks

Source: https://github.com/oasdiff/oasdiff > License: Apache-2.0 > GitHub stars: 1,193 · forks: 95

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets