APIDiffGuard

CLI

Run apidiff check locally or in CI against JSON files or a live URL.

Use @apidiffguard/cli to fail a pipeline when a response drifts from a known-good baseline.

Install

npm install -g @apidiffguard/cli
# or one-off
npx --yes @apidiffguard/cli --help

The binary is apidiff. Diff engine package: @apidiffguard/diff.

Check two JSON files

apidiff check --baseline baseline.json --current live.json --fail-on breaking

Check a baseline against a private URL

apidiff check \
  --baseline baseline.json \
  --url https://api.example.com/v1/me \
  --header "Authorization: Bearer $API_TOKEN" \
  --schema-only \
  --fail-on breaking

CI tip (GitHub Actions)

- name: API schema gate
  run: |
    npx --yes @apidiffguard/cli check \
      --baseline ./fixtures/users.json \
      --url "$API_URL/users" \
      --header "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
      --schema-only \
      --fail-on breaking

For hosted endpoint checks (baselines, alerts, schedules), create a token under Settings → Tokens and call:

curl -X POST "$APP_URL/api/v1/endpoints/$ENDPOINT_ID/check" \
  -H "Authorization: Bearer $ADG_TOKEN"

Options

FlagDescription
--baseline / --oldPath to baseline JSON
--current / --newPath to current JSON
--urlFetch current JSON from an HTTPS URL
--header / -HRepeatable Name: value request header (for --url)
--schema-onlyIgnore leaf value churn; keep structure/type/nullability
--fail-onbreaking (default), warning, or info
--jsonPrint structured JSON instead of text

There is no GitHub App yet — use the CLI gate above, or the hosted token API + Slack/Discord webhooks for monitoring.

On this page