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
| 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.
# 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.