Skip to content

Usage

Diff two schema files

sh
driftabot <command> --base <file> --head <file> [--format <format>] [--fail-on-breaking]
CommandDescription
openapiDiff two OpenAPI 3.x schemas (YAML or JSON)
graphqlDiff two GraphQL SDL schemas
grpcDiff two Protobuf schemas (.proto)

Flags

FlagDescriptionDefault
--basePath to the base (before) schema filerequired
--headPath to the head (after) schema filerequired
-f, --formatOutput format: text, json, markdown, githubtext
--fail-on-breakingExit with code 1 if breaking changes are detectedfalse

Examples

sh
# OpenAPI — text output
driftabot openapi --base api/base.yaml --head api/head.yaml

# GraphQL — JSON output
driftabot graphql --base schema/base.graphql --head schema/head.graphql --format json

# gRPC — fail CI on breaking changes
driftabot grpc --base proto/base.proto --head proto/head.proto --fail-on-breaking

Impact analysis

After detecting breaking changes, use driftabot impact to scan source code and find every file and line that references each breaking change.

sh
driftabot <schema-command> --base <file> --head <file> --format json \
  | driftabot impact --scan <dir>

Or from a saved diff file:

sh
driftabot openapi --base base.yaml --head head.yaml --format json > diff.json
driftabot impact --diff diff.json --scan ./src

Flags

FlagDescriptionDefault
--diffPath to a JSON diff file; omit or use - to read stdinstdin
--scanDirectory to scan for source references.
-f, --formatOutput format: text, json, markdown, githubtext

Examples

sh
# Pipe OpenAPI diff directly into impact scan
driftabot openapi --base old.yaml --head new.yaml --format json \
  | driftabot impact --scan ./services

# Markdown report — collapsible sections per breaking change
driftabot impact --diff diff.json --scan ./src --format markdown

# JSON output (machine-readable)
driftabot impact --diff diff.json --scan ./src --format json

See Output Formats for format details and examples.

Released under the MIT License.