Compare your current API schema against the last saved snapshot. Reports added, removed, modified, and breaking changes. Use --fail-on-breaking to gate CI pipelines.
Usage
dino diff --tenant <id> [flags]
Flags
| Flag | Type | Default | Description |
|---|
--tenant | string | — | Required. Tenant ID (or set in .dino.yml) |
--env | string | Tenant default | Target environment |
--format | "markdown" | "json" | "markdown" | Output format |
--quiet | boolean | false | Suppress stdout output |
--snapshot-dir | string | .dino/snapshots | Directory for reading and writing snapshots |
--fail-on-breaking | boolean | false | Exit with code 1 if breaking changes are detected |
How It Works
- Discover — Introspects the live API schema
- Build snapshot — Creates a snapshot of the current schema
- Load previous — Reads the most recent snapshot from disk
- Diff — Compares previous vs. current and categorizes changes
- Save — Writes the current snapshot as the new baseline
On the first run (no previous snapshot exists), the current schema is saved as the baseline. No diff is produced.
Examples
Check for schema changes
dino diff --tenant acme --env staging
# Schema Diff — acme / staging
## Summary
Added: 3 | Removed: 1 | Modified: 2 | Breaking: 1
## Breaking Changes
- Removed field `User.legacyId`
## Added
- Field `User.avatarUrl`
- Field `User.preferences`
- Query `searchUsers`
## Modified
- Field `User.email` — type changed (String → String!)
CI gate for breaking changes
dino diff --tenant acme --env production --fail-on-breaking
Returns exit code 1 if any breaking changes are detected. Use this in CI to block deployments that introduce breaking API changes.
- name: Schema compatibility check
run: dino diff --tenant acme --env production --fail-on-breaking
dino diff --tenant acme --format json > diff.json
Commit your .dino/snapshots directory to version control so that dino diff always has a baseline to compare against, even in fresh CI environments.
Exit Codes
| Code | Meaning |
|---|
0 | No breaking changes (or --fail-on-breaking not set) |
1 | Breaking changes detected with --fail-on-breaking, or command error |