Skip to content

Utility Commands

Project setup, import, and interactive tools.

queen init

Initialize a new Queen project.

queen init [flags]
Flag Type Default Description
--driver string "" Database driver (postgres, mysql, sqlite, clickhouse)
--with-config bool false Generate .queen.yaml
--interactive bool false Interactive setup wizard
--migrations-dir string migrations Migrations directory name

Examples

queen init --driver postgres

Creates:

  • migrations/ directory
  • .queen.yaml (if --with-config)
queen init --interactive

Interactive wizard prompts for driver, migrations directory, and whether to generate a config file.


queen import

Import migrations from other tools.

queen import PATH [flags]
Flag Type Default Description
--from string required Source tool: goose
--output string "" Output directory (default: migrations)
--dry-run bool false Preview import without making changes

Examples

Import from Goose:

queen import --from goose ./migrations

Converts Goose SQL migration files (with -- +goose Up / -- +goose Down markers) to Queen Go code.

Dry run:

queen import --from goose ./migrations --dry-run
Found 15 migrations:
  001_create_users.sql -> 001_create_users
  002_add_posts.sql -> 002_add_posts
  ...

Will generate 15 Queen migration files

queen tui

Launch interactive terminal UI.

queen tui

Built with Bubble Tea. Provides a visual overview of migration state with keyboard-driven navigation.

Features

  • Migrations view with status indicators
  • Gap detection view with diagnostics
  • Real-time updates
  • Keyboard navigation

Keyboard Shortcuts

Key Action
/ k Navigate up
/ j Navigate down
g / G Go to top/bottom
1 Migrations view
2 Gaps view
3 / ? Help view
Enter Apply or rollback selected migration
u Apply selected migration (up)
d Rollback selected migration (down)
r Refresh
f Fill selected gap
i Ignore selected gap
q / Ctrl+C Quit

Examples

queen tui
queen tui --driver postgres --dsn "postgres://localhost/mydb"