CLI Commands

Command-line interface reference for Stabilize CLI

generate

Generate a new model, migration, or seed file.

bunx stabilize-cli generate <type> <name> [fields...]

Types:

  • model Generate a model file
  • migration Generate a migration file for an existing model
  • seed Generate a seed file for a model

Examples:

bunx stabilize-cli generate model User name:string age:int
bunx stabilize-cli generate migration User
bunx stabilize-cli generate seed User --count 10

Options:

  • --name Custom migration name
  • --count How many seed rows to generate

migrate

Apply all pending database migrations.

bunx stabilize-cli migrate
bunx stabilize-cli migrate:rollback

Options:

  • --config Path to database config file

seed

Run all pending seed files.

bunx stabilize-cli seed
bunx stabilize-cli seed:rollback

Options:

  • --class Run a specific seeder class
  • --config Path to database config file

db:drop

Drop all tables in the database. Use with caution!

bunx stabilize-cli db:drop

Options:

  • --force Skip confirmation prompt
  • --config Path to database config file

db:reset

Drop, migrate, and seed your database. Destroys and rebuilds your database.

bunx stabilize-cli db:reset

Options:

  • --force Skip confirmation prompt for db:drop
  • --config Path to database config file

status

Show the status of all migrations and seeds.

bunx stabilize-cli status

Options:

  • --config Path to database config file

init

Initialize Stabilize in your project.

bunx stabilize-cli init

Creates necessary directories (models, migrations, seeds) and a sample configuration file.

--version

Display the CLI version.

bunx stabilize-cli --version

--help

Display help information.

bunx stabilize-cli --help