CodeRifts CLI
Only a granted change can proceed.
What this gate does. Advisory by default. diff analyses locally and exits on a threshold you choose; the gate commands (deploy-gate, publish-gate, registry-gate) are the enforcing ones, and they are not documented on this page yet.
coderifts status with no API key exits 0 and prints three local lines (measured 2026-09-30, coderifts@8.6.8). What those lines are.
Install with a single command. Diff OpenAPI specs locally during development, in pre-commit hooks, or in any CI pipeline.
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
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.
During the public beta every organization gets Team features at $0 with a self-serve key, public and private repositories alike, no separate Team key to request, and each key allows 1,000 requests a month: after that, /preflight authorize returns BETA_LIMIT_REACHED while its analysis keeps working; other API routes return 429.