Skip to content

CLI Commands

Initialize a new seedcli project.

Terminal window
seedcli init [flags]
FlagShortDescription
--force-fOverwrite existing config
Terminal window
# Initialize new project
seedcli init
# Force overwrite existing config
seedcli init --force

Creates:

  • seedcli.yaml - Configuration file
  • .logseed/ - Log directory

Seed database tables with fake data.

Terminal window
seedcli seed [flags]
FlagShortDescriptionDefault
--table-tTable(s) to seed (repeatable)-
--all-aSeed all tablesfalse
--rows-nRows per tablefrom config
--batch-size-Rows per batch insert100
--seed-Random seed for reproducibilitycurrent time
--dry-run-Preview without insertingfalse
--skip-errors-Continue on errorsfalse
--truncate-Truncate tables firstfalse
--disable-fk-Disable foreign key checksfalse
--db-url-Database URL (overrides config)-
Terminal window
# Seed all tables
seedcli seed --all
# Seed specific tables
seedcli seed -t users -t orders
# Seed with custom row count
seedcli seed --all -n 100
# Reproducible seeding
seedcli seed --all --seed 42
# Dry run preview
seedcli seed --all --dry-run
# Large dataset with batching
seedcli seed --all -n 10000 --batch-size 1000
# Skip constraint errors
seedcli seed --all --skip-errors

List tables in the database.

Terminal window
seedcli list [flags]
FlagShortDescriptionDefault
--db-url-Database URL-
--format-Output format (table, json)table
Terminal window
# List all tables
seedcli list
# JSON output
seedcli list --format json
# With different database
seedcli list --db-url "postgresql://localhost/other_db"
📋 Tables in database
┌─────────────┬─────────┬──────────────┬─────────────────────┐
│ Table │ Columns │ Dependencies │ Estimated Rows │
├─────────────┼─────────┼──────────────┼─────────────────────┤
│ users │ 6 │ 0 │ 0 │
│ products │ 5 │ 0 │ 0 │
│ orders │ 4 │ 2 │ 0 │
│ order_items │ 3 │ 2 │ 0 │
└─────────────┴─────────┴──────────────┴─────────────────────┘
Total: 4 tables

Preview generated data without inserting.

Terminal window
seedcli preview [flags]
FlagShortDescriptionDefault
--table-tTable(s) to preview (repeatable)-
--rows-nNumber of sample rows3
--format-Output format (table, json)table
--seed-Random seedcurrent time
--db-url-Database URL-
Terminal window
# Preview users table
seedcli preview -t users
# Preview multiple tables
seedcli preview -t users -t products
# More sample rows
seedcli preview -t users -n 10
# JSON output
seedcli preview -t users --format json
# Reproducible preview
seedcli preview -t users --seed 42
📋 Preview: users (3 rows)
┌─────┬──────────────┬─────────────────────────────┬────────────┐
│ id │ username │ email │ created_at │
├─────┼──────────────┼─────────────────────────────┼────────────┤
│ 1 │ johndoe42 │ john.doe@example.com │ 2025-03-15 │
│ 2 │ janesmith │ jane.smith@company.org │ 2025-06-22 │
│ 3 │ mikebrown │ mike.brown@startup.io │ 2025-09-01 │
└─────┴──────────────┴─────────────────────────────┴────────────┘

Display version information.

Terminal window
seedcli version
seedcli version 2.0.0
Build date: 2026-01-26
Go version: go1.21
OS/Arch: darwin/arm64
Supported adapters:
• postgres - PostgreSQL 12+
• sqlite - SQLite 3

All commands automatically load seedcli.yaml from:

  1. Current working directory
  2. $HOME/.config/seedcli/
  3. /etc/seedcli/

All operations are logged to .logseed/seedcli-YYYY-MM-DD.log.

CodeMeaning
0Success
1General error
2Configuration error
3Database connection error
4Seeding error