Diff SQL schemas and generate migrations from your terminal. Zero install with npx. The exact same engine as the web app â locally, offline, and scriptable.
npx schemalens-cli diff old.sql new.sql
Some developers prefer the terminal. We get it. The CLI runs the same custom parser and diff engine as the browser â no network, no API keys for basic usage.
No install required. Run npx schemalens-cli and diff schemas immediately. Perfect for one-off checks.
Your SQL never leaves your machine. The CLI runs entirely locally with zero network calls for parsing and diffing.
JSON output and strict mode make it easy to integrate into GitHub Actions, GitLab CI, or any CI/CD pipeline.
Pretty-printed terminal output, JSON for machines, Markdown for PRs, and raw SQL for immediate execution.
Set SCHEMALENS_STRICT=1 to exit with code 2 when breaking changes are detected. Block dangerous migrations automatically.
Every diff gets a risk score (0-100) based on change severity. Surface high-risk schema changes before they hit production.
Diff two schemas and get a colorized report with breaking changes, risk score, and migration preview.
Choose the format that fits your workflow. All formats are available in the free CLI.
Colorized terminal output with summary, risk score, and migration preview. Default.
Machine-readable output for CI/CD pipelines, custom scripts, and automation.
Human-readable report perfect for PR descriptions and team documentation.
Ready-to-run ALTER TABLE and CREATE TABLE script for your target dialect.
One CLI. Five SQL dialects. Switch with a single flag.
Same engine. Different interfaces. Pick what fits your workflow.
| Feature | CLI | Web App |
|---|---|---|
| Install required | â No (npx) | â No (browser) |
| Internet required | â No | â ïļ For page load only |
| Visual diff viewer | â Terminal only | â Interactive UI |
| Shareable links | â No | â Yes |
| CI/CD integration | â Native | â Via API |
| Export formats | JSON / Markdown / SQL | Markdown / PDF / SQL / JSON / Prisma / Drizzle |
| Breaking change guard | â Exit code 2 | â Visual warning |
| Free tier limit | 10 tables | 10 tables |
| Pro unlock | License key | License key |
Fail the build when breaking schema changes are detected.
The CLI free tier handles up to 10 tables per diff. Pro unlocks unlimited schemas, full SQL export, and all future CLI updates.
Or run npx schemalens-cli right now â no signup needed.