Skip to main content

🚀 Beta: All Pro and Team features are free. Install on GitHub →

Command Line

CodeRifts CLI — Diff Schemas in Your Terminal

Install with a single command. Diff OpenAPI specs locally during development, in pre-commit hooks, or in any CI pipeline. Get the same analysis engine that powers the GitHub App — right in your terminal.

npm install -g coderifts

Or run without installing: npx coderifts diff old.yaml new.yaml

Usage Examples

Compare two local files

coderifts diff base.yaml head.yaml

Use cloud API for full governance report

coderifts login
coderifts diff base.yaml head.yaml --cloud

Output as Markdown

coderifts diff base.yaml head.yaml --format markdown

CI mode — exit 1 if risk score exceeds threshold

coderifts diff base.yaml head.yaml --ci --threshold 50

Run without installing (npx)

npx coderifts diff base.yaml head.yaml --format json

Flags & Options

FlagDefaultDescription
-f, --formatterminalOutput format: terminal, json, or markdown
--cifalseCI mode — exit code 1 if breaking changes exceed threshold
--threshold50Risk score threshold for CI mode (0-100)
--cloudfalseUse CodeRifts cloud API instead of local analysis
-c, --configauto-detectPath to .coderifts.yml config file

Common Workflows

Pre-Commit Hook

Catch breaking changes before they're even committed.

# .git/hooks/pre-commit
npx coderifts diff \
  old-api.yaml \
  new-api.yaml \
  --ci --threshold 50

Local Development

Quick check while editing your spec.

# See what changed
coderifts diff \
  old-api.yaml \
  new-api.yaml \
  --format json

Install in one command.

npm install -g coderifts

Works locally out of the box. For cloud features, get a free API key →

Prefer a GitHub-native experience? Install the GitHub App instead.