@devsync/cli Command Reference
Complete command-line interface documentation for scanning schema drift, dry-run migration generation, and platform synchronization.
Overview
The @devsync/cli is a developer-first tool designed to extract local codebase schemas (Prisma, Drizzle, TypeORM, Kysely), connect to target database environments read-only, and generate deterministic migration previews without modifying your database.
npm install -g @devsync/cli
dev-sync --helpPrimary Commands
1. dev-sync scan
Scans local ORM files against your target database to detect structural mismatches, missing columns, type differences, or unindexed foreign keys.
dev-sync scan \
--schema ./prisma/schema.prisma \
--db "postgresql://user:pass@localhost:5432/mydb" \
--check--schema <path> Path to local ORM schema file--db <url> Target database connection string--check Exit code 1 if drift is detected (Ideal for CI/CD)--json Output structured JSON scan report2. dev-sync fix
Generates DDL SQL migration statements and rollback strategies for all detected schema mismatches.
dev-sync fix --preview3. dev-sync init
Initializes a local project configuration file (.devsync/config.json).
dev-sync init4. dev-sync login
Authenticates your CLI session with your Dev-Sync.dev cloud workspace.
dev-sync login --key <your-api-token>