CLI
The slintorm CLI manages schema generation, migrations, and rollbacks. All commands read config from slintorm.config.js or the "slintorm" key in package.json, with CLI flags taking highest priority.
Command reference
generate
# Generate schema files from TypeScript source
# Scans --dir (or config dir) for interfaces, outputs:
# src/schema/generated.ts
# src/schema/generated.json
npx slintorm generatemigrate
# Apply pending migrations
npx slintorm migraterollback
# Roll back the most recent batch
npx slintorm rollback
# Roll back a specific migration by name
npx slintorm rollback users
# Roll back to a specific batch number (rolls back all batches after N)
npx slintorm rollback --to 3status
# Show pending and applied migrations with their batch numbers
npx slintorm status
# Output example:
# [✓] users batch 1 2024-01-10
# [✓] posts batch 1 2024-01-10
# [✗] comments pendingfresh
Drops all tables and re-runs every migration. Destroys all data. Development only.
# Drop all tables and re-run all migrations from scratch
# USE WITH CAUTION — destroys all data in development
npx slintorm freshdrop-tracking
# Remove the _slint_migrations tracking table
# Useful when you want to reset migration history without dropping tables
# (e.g. switching from another ORM or fixing a corrupted state)
npx slintorm drop-tracking--help
# Print all available commands
npx slintorm --helpConfig resolution and flags
# Config resolution order (highest to lowest priority):
# 1. CLI flags --dir ./src --driver sqlite
# 2. slintorm.config.js in cwd
# 3. "slintorm" key in package.json
# Example: override dir at runtime
npx slintorm migrate --dir ./app/models --driver postgres --databaseUrl $DATABASE_URLTerminal output
The CLI uses timestamped logging and progress bars for long-running operations. Color-coded output: green for success, yellow for pending/skipped, red for errors. All timestamps are ISO 8601 UTC.