CLI Reference
This page provides a complete reference for all FlashORM CLI commands.
Global Options
--config, -c: Specify config file path (default:./flash.config.json)--force, -f: Skip confirmations--version, -v: Show CLI version--help, -h: Show help
Commands
flash init
Initialize a new FlashORM project.
flash init [flags]Flags:
--sqlite: Initialize for SQLite--postgresql: Initialize for PostgreSQL--mysql: Initialize for MySQL
Examples:
flash init --postgresql
flash init --sqlite
flash init --mysqlflash migrate
Create a new migration.
flash migrate [name] [flags]Flags:
--empty, -e: Create empty migration (no auto-generated SQL)--auto, -a: Auto-generate SQL from schema changes
Examples:
flash migrate "add user table"
flash migrate "update schema" --auto
flash migrate --empty "custom migration"flash apply
Apply pending migrations to the database.
flash apply [flags]Flags:
--force, -f: Skip confirmations
Examples:
flash apply
flash apply --forceflash gen
Generate type-safe code from SQL queries.
flash genGenerates code based on your flash.config.json configuration for Go, TypeScript/JavaScript, and Python.
flash studio
Launch FlashORM Studio web interface.
flash studio [subcommand] [flags]Subcommands:
sql(default): Launch SQL Studio for PostgreSQL, MySQL, or SQLitemongodb: Launch MongoDB Studioredis: Launch Redis Studio
Flags:
--port, -p: Port to run studio on (default: 5555)--browser, -b: Open browser automatically (default: true)--no-browser: Disable automatic browser opening--db: Database URL (overrides config)--url: Connection URL (for redis/mongodb subcommands)
Examples:
# SQL Studio (PostgreSQL, MySQL, SQLite)
flash studio
flash studio --port 3000
flash studio --db "postgres://user:pass@localhost:5432/mydb"
flash studio sql --db "mysql://user:pass@localhost:3306/mydb"
# MongoDB Studio
flash studio mongodb --url "mongodb://localhost:27017/mydb"
flash studio mongodb --url "mongodb+srv://user:pass@cluster.mongodb.net/mydb"
# Redis Studio
flash studio redis --url "redis://localhost:6379"
flash studio redis --url "redis://:password@localhost:6379" --port 3000flash pull
Pull schema from existing database.
flash pull [flags]Flags:
--db: Database URL to pull from--output, -o: Output directory for schema files
flash export
Export data from database.
flash export [flags]Flags:
--format, -f: Export format (json, csv, sqlite)--output, -o: Output file path--table, -t: Specific table to export--query, -q: Custom SQL query for export
Examples:
flash export --format json --output data.json
flash export --table users --format csvflash branch
Manage database schema branches.
flash branch [command]Subcommands:
create <name>: Create new branchswitch <name>: Switch to branchmerge <source>: Merge branchlist: List all branchesdelete <name>: Delete branch
flash status
Show current migration and branch status.
flash statusflash seed
Seed database with realistic fake data for development and testing.
flash seed [tables...] [flags]Arguments:
tables...: Optional list of tables with counts in formattable:count(e.g.,users:100 posts:500)
Flags:
--count, -c: Number of rows to generate per table (default: 10)--table, -t: Specific table to seed (alternative to positional args)--truncate: Truncate tables before seeding--force, -f: Skip confirmation--relations: Include foreign key relationships
Examples:
# Seed all tables with default count (10)
flash seed
# Seed all tables with 100 rows each
flash seed --count 100
# Seed specific table
flash seed --table users --count 50
# Seed multiple tables with different counts
flash seed users:100 posts:500 comments:1000
# Truncate and reseed
flash seed --truncate --force
# Seed with relationship handling
flash seed --relations --count 50Smart Data Generation: FlashORM automatically generates appropriate data based on column names:
email→ realistic emailsname,first_name,last_name→ human namesphone→ phone numbersurl,website→ URLsaddress,city,country→ location datacreated_at,updated_at→ timestampspassword→ hashed passwordsprice,amount→ currency values
flash reset
Reset database to clean state (drops all tables).
flash reset [flags]Flags:
--force, -f: Skip confirmation
flash down
Rollback migrations.
flash down [count] [flags]Parameters:
count: Number of migrations to rollback (default: 1)
Flags:
--force, -f: Skip confirmation
flash raw
Execute raw SQL commands.
flash raw [flags]Flags:
--file, -f: SQL file to execute--query, -q: Inline SQL query
flash plugins
Manage FlashORM plugins.
flash plugins [command]Subcommands:
list: List installed pluginsadd <name>: Install pluginremove <name>: Remove plugin
flash add-plug
Install a plugin.
flash add-plug <plugin-name>Available plugins:
core: ORM, migrations, code generation, seeding. Auto-installs on first use.studio: Web-based visual database editor. Optional, install when needed.
flash rm-plug
Remove a plugin.
flash rm-plug <plugin-name>flash update
Update installed plugins and optionally the flash binary itself.
flash update [flags]Flags:
--self: Update all plugins and the flash binary--self-only: Update only the flash binary, leave plugins untouched
Examples:
# Update all installed plugins
flash update
# Update plugins and the flash binary
flash update --self
# Update only the flash binary
flash update --self-onlyConfiguration
FlashORM uses flash.config.json for configuration:
{
"version": "2",
"schema_dir": "db/schema",
"queries": "db/queries/",
"migrations_path": "db/migrations",
"export_path": "db/export",
"database": {
"provider": "postgresql",
"url_env": "DATABASE_URL"
},
"gen": {
"go": {
"enabled": true
},
"js": {
"enabled": false,
"out": "flash_gen"
},
"python": {
"enabled": false,
"out": "flash_gen",
"async": true
}
}
}Environment Variables
DATABASE_URL: Database connection stringFLASH_CONFIG: Path to config file (alternative to --config)
Exit Codes
0: Success1: Error2: Plugin not found3: Migration conflict