@coderifts/cli
v1.0.3
Published
Detect breaking API changes from the command line. Works locally or with the CodeRifts cloud API.
Maintainers
Readme
@coderifts/cli
Detect breaking API changes between OpenAPI specs from the command line. Works locally or with the CodeRifts cloud API.
Installation
npm install -g @coderifts/cliQuick Start
# Compare two specs locally
coderifts diff old-api.yaml new-api.yaml
# Use cloud API for full governance report
coderifts login
coderifts diff old-api.yaml new-api.yaml --cloud
# CI mode — exit 1 if risk score exceeds threshold
coderifts diff old-api.yaml new-api.yaml --ci --threshold 50Commands
coderifts diff <old-spec> <new-spec>
Compare two OpenAPI specs and report breaking changes.
| Flag | Description | Default |
|------|-------------|---------|
| -f, --format <format> | Output format: terminal, json, markdown | terminal |
| --ci | CI mode — exit code 1 if breaking changes exceed threshold | false |
| --threshold <number> | Risk score threshold for CI mode (0-100) | 50 |
| --cloud | Use CodeRifts cloud API instead of local analysis | false |
| -c, --config <path> | Path to .coderifts.yml config file | auto-detect |
Output formats:
- terminal — Colored tables and risk score box (default)
- json — Full structured report for programmatic use
- markdown — Markdown table for CI comments
A coderifts-report.json file is always saved to the current directory.
coderifts init
Interactive configuration generator. Creates a .coderifts.yml file with industry-specific presets:
- Default (recommended)
- Fintech / Payments
- Healthcare / HIPAA
- Platform / API-First
- E-commerce
coderifts login
Save your CodeRifts API key for cloud features. Get a free key at app.coderifts.com/api/signup.
CI/CD Integration
GitHub Actions
- name: Check API breaking changes
run: |
npx @coderifts/cli diff old-api.yaml new-api.yaml --ci --format jsonGitLab CI
api-check:
script:
- npx @coderifts/cli diff old-api.yaml new-api.yaml --ci --threshold 40Jenkins
sh 'npx @coderifts/cli diff old-api.yaml new-api.yaml --ci'Environment Variables
| Variable | Description |
|----------|-------------|
| CODERIFTS_API_KEY | API key (alternative to coderifts login) |
| NO_COLOR | Disable colored output |
