Skip to content

CLI Reference

Complete flag-by-flag reference for the seedforge CLI. Flags marked with defaults reflect the values baked into src/cli.ts in the library.

Terminal window
seedforge [options]

Seedforge reads a schema from a live database or ORM file, generates FK-correct fake rows, and either inserts them, writes a .sql file, or prints a dry-run summary. All behavior is controlled by the flags below or a .seedforge.yml config file.

Exactly one schema source is required. If none is passed, Seedforge looks for prisma/schema.prisma in the current directory before giving up.

Database connection string. Accepts postgres://, postgresql://, mysql://, sqlite://, or a plain .db / .sqlite path.

Terminal window
seedforge --db postgres://localhost/mydb
seedforge --db mysql://root:pass@localhost/mydb
seedforge --db sqlite:///path/to/db.sqlite

Path to a Prisma schema file. No live DB is needed when combined with --output.

Terminal window
seedforge --prisma ./prisma/schema.prisma --output seed.sql

Path to a Drizzle ORM schema file or directory of schema files.

Terminal window
seedforge --drizzle ./src/db/schema.ts --output seed.sql

Path to a TypeORM entity directory.

Terminal window
seedforge --typeorm ./src/entities/ --output seed.sql

Path to a JPA/Hibernate Java entity directory.

Terminal window
seedforge --jpa ./src/main/java/com/example/entities/ --output seed.sql

One or more paths to plugin modules that register custom schema parsers or data generators.

Terminal window
seedforge --plugin ./my-parser-plugin.ts --output seed.sql

Database schema namespace to introspect. Default: public.

Terminal window
seedforge --db postgres://localhost/mydb --schema app

Write INSERT statements to a .sql file instead of executing them. When combined with a parser flag (--prisma, --drizzle, etc.), no live database connection is opened.

Terminal window
seedforge --db postgres://localhost/mydb --output seed.sql

Generate rows in memory and print a summary without touching the database. Default: false.

Terminal window
seedforge --db postgres://localhost/mydb --dry-run

Emit a machine-readable JSON summary to stdout after the run. Default: false.

Terminal window
seedforge --db postgres://localhost/mydb --json

Rows per table. Default: 50. Per-table overrides live in .seedforge.yml under tables.<name>.count.

Terminal window
seedforge --db postgres://localhost/mydb --count 500

PRNG seed for deterministic output. Same seed + same schema = identical rows every run.

Terminal window
seedforge --db postgres://localhost/mydb --seed 42

Use PostgreSQL’s COPY protocol for bulk insertion (10x+ faster on large datasets). PostgreSQL only — errors out with exit code 1 on MySQL or SQLite. Default: false.

Terminal window
seedforge --db postgres://localhost/mydb --count 100000 --fast

Space-separated list of tables to skip. Glob patterns are supported in the config file but not on the CLI.

Terminal window
seedforge --db postgres://localhost/mydb --exclude schema_migrations audit_log

Path to a .seedforge.yml config file. If omitted, Seedforge auto-detects .seedforge.yml in the current directory.

Terminal window
seedforge --config ./config/seedforge.yml

Seedforge can route text-column generation through an LLM for richer content. Requires --ai plus a provider.

Enable AI-enhanced text generation. Default: false.

Provider name: openai, anthropic, ollama, or groq.

Provider-specific model name.

Columns to route through the AI pool, either as bare column names (bio) or qualified (users.bio).

Terminal window
seedforge --db postgres://localhost/mydb \
--ai --ai-provider openai --ai-model gpt-4o-mini \
--ai-columns users.bio posts.body

Skip the production-database confirmation prompt. Seedforge warns before touching connection strings that look like managed hosts (RDS, Neon, Supabase, Cloud SQL, etc.). Default: false.

Terminal window
seedforge --db postgres://rds-host.amazonaws.com/mydb --yes

Log the insertion order, deferred FK edges, self-referencing tables, and per-table column/FK counts. Default: false.

Suppress all non-essential stdout. Errors still print to stderr. Default: false.

Dump the parsed schema as JSON and print the full options object (with connection strings redacted). Default: false.

Terminal window
seedforge --db postgres://localhost/mydb --verbose

Display help text with examples.

Print the installed version.

CodeMeaning
0Run completed successfully
1Known error — bad config, missing schema source, production-check failure, plugin load failure, --fast on non-Postgres, etc. Rendered with an SF#### error code
2Unexpected non-Error throw

Seedforge does not read environment variables directly from the CLI — every flag is explicit. However, .seedforge.yml supports ${VAR} interpolation, so the conventional pattern is to put the connection string in DATABASE_URL and reference it from YAML:

connection:
url: ${DATABASE_URL}
schema: public
Terminal window
DATABASE_URL=postgres://localhost/mydb seedforge --config .seedforge.yml

Any environment variable referenced with ${VAR} syntax inside .seedforge.yml is interpolated at config-load time.