CLI Command Reference
This page is a quick command index. For guides, start with:
Prerequisites
What You’ll Learn
- The command surface area grouped by workflow
- Common command flags and aliases
- Which command to pick for each migration/seed/schema task
Step Outcome
By the end of this page, you should be able to:
- Identify the right command for scaffold/migrate/seed/schema operations
- Use preview/status commands before mutating state
- Navigate command aliases without ambiguity
Global patterns
- The CLI uses convention defaults when
ormed.yamlis absent. - If
ormed.yamlexists, it is auto-discovered (or use--config). - Use
--connection <name>to select a connection block. - Many commands support
--databaseto override the driver database option.
Recommended Command Order
initmake:migration/makemigrationsmigrate --pretendmigrateseedmigrate:status/ schema tools
Commands
init
Scaffolds code-first datasource config plus migration registry by default:
dart run ormed_cli:ormed init
dart run ormed_cli:ormed init --with-seeders # add seed scaffold
dart run ormed_cli:ormed init --with-tests # add test helper scaffold
dart run ormed_cli:ormed init --with-config # also scaffold ormed.yaml
make / make:migration / make:seeder
Generates migrations or seeders:
dart run ormed_cli:ormed make:migration --name create_users_table
dart run ormed_cli:ormed make:migration --name create_users_table --format sql
dart run ormed_cli:ormed make:seeder --name UserSeeder
Compatible aliases:
make --name ...(migration)make --name ... --seeder(seeder)
makemigrations
Generates migration(s) by diffing generated model metadata against current schema:
dart run ormed_cli:ormed makemigrations
dart run ormed_cli:ormed makemigrations --sync-only
dart run ormed_cli:ormed migrations:sync --dry-run
dart run ormed_cli:ormed migrations:check
migrate
Applies pending migrations:
dart run ormed_cli:ormed migrate
dart run ormed_cli:ormed migrate --limit 5
dart run ormed_cli:ormed migrate --pretend
migrate:export
Exports up.sql and down.sql for migrations:
dart run ormed_cli:ormed migrate:export --out database/migration_sql
dart run ormed_cli:ormed migrate:export --out database/migration_sql --all
migrate:status
dart run ormed_cli:ormed migrate:status
dart run ormed_cli:ormed migrate:status --pending
migrate:rollback
dart run ormed_cli:ormed migrate:rollback
dart run ormed_cli:ormed migrate:rollback --steps 3
migrate:fresh / migrate:reset / migrate:refresh
dart run ormed_cli:ormed migrate:fresh
dart run ormed_cli:ormed migrate:reset
dart run ormed_cli:ormed migrate:refresh
seed
dart run ormed_cli:ormed seed
dart run ormed_cli:ormed seed --class UserSeeder
dart run ormed_cli:ormed seed --pretend
schema:dump
dart run ormed_cli:ormed schema:dump
dart run ormed_cli:ormed schema:dump --prune
schema:describe
dart run ormed_cli:ormed schema:describe
dart run ormed_cli:ormed schema:describe --json
db:wipe
dart run ormed_cli:ormed db:wipe
dart run ormed_cli:ormed db:wipe --drop-views