Skip to main content

CLI Overview

The Ormed CLI manages migrations, seeds, and schema tooling for projects configured with ormed.yaml.

Running the CLI

Use this if you have ormed_cli in your dev_dependencies. This ensures version parity with your project.

dart run ormed_cli:ormed --help
dart run ormed_cli:ormed init
dart run ormed_cli:ormed migrate
warning

Adding ormed_cli to your project will pull in all database drivers (SQLite, MySQL, Postgres) as transitive dependencies.

Config discovery

By default the CLI finds the nearest ormed.yaml by walking up from the current directory.

Override the config path explicitly:

dart run ormed_cli:ormed migrate --config path/to/ormed.yaml

Targeting connections

If your ormed.yaml contains multiple connections, target one with:

dart run ormed_cli:ormed migrate --connection analytics
dart run ormed_cli:ormed seed --connection analytics

Production guard

Commands that mutate schema/data prompt for confirmation when the process environment indicates production (ORM_ENV, DART_ENV, FLUTTER_ENV, or ENV equals production).

Use --force (when supported) to skip the prompt.