Overview

CodeRifts CLI — diff schemas 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#

Flag Default Description
-f, --format terminal Output format: terminal, json, or markdown
--ci false CI mode — exit code 1 if breaking changes exceed threshold
--threshold 50 Risk score threshold for CI mode (0-100)
--cloud false Use CodeRifts cloud API instead of local analysis
-c, --config auto-detect Path 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.

coderifts diff \
  old-api.yaml \
  new-api.yaml \
  --format json

For cloud features, get a free API key. Prefer a GitHub-native experience? Install the GitHub App instead.

Updated

Was this page helpful?