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 --helpThe binary is apidiff. Diff engine package: @apidiffguard/diff.
Check two JSON files
apidiff check --baseline baseline.json --current live.json --fail-on breakingCheck 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 breakingCI 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 breakingFor 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
| Flag | Description |
|---|---|
--baseline / --old | Path to baseline JSON |
--current / --new | Path to current JSON |
--url | Fetch current JSON from an HTTPS URL |
--header / -H | Repeatable Name: value request header (for --url) |
--schema-only | Ignore leaf value churn; keep structure/type/nullability |
--fail-on | breaking (default), warning, or info |
--json | Print 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.