CLI Commands
seedcli init
Section titled “seedcli init”Initialize a new seedcli project.
seedcli init [flags]| Flag | Short | Description |
|---|---|---|
--force | -f | Overwrite existing config |
Examples
Section titled “Examples”# Initialize new projectseedcli init
# Force overwrite existing configseedcli init --forceOutput
Section titled “Output”Creates:
seedcli.yaml- Configuration file.logseed/- Log directory
seedcli seed
Section titled “seedcli seed”Seed database tables with fake data.
seedcli seed [flags]| Flag | Short | Description | Default |
|---|---|---|---|
--table | -t | Table(s) to seed (repeatable) | - |
--all | -a | Seed all tables | false |
--rows | -n | Rows per table | from config |
--batch-size | - | Rows per batch insert | 100 |
--seed | - | Random seed for reproducibility | current time |
--dry-run | - | Preview without inserting | false |
--skip-errors | - | Continue on errors | false |
--truncate | - | Truncate tables first | false |
--disable-fk | - | Disable foreign key checks | false |
--db-url | - | Database URL (overrides config) | - |
Examples
Section titled “Examples”# Seed all tablesseedcli seed --all
# Seed specific tablesseedcli seed -t users -t orders
# Seed with custom row countseedcli seed --all -n 100
# Reproducible seedingseedcli seed --all --seed 42
# Dry run previewseedcli seed --all --dry-run
# Large dataset with batchingseedcli seed --all -n 10000 --batch-size 1000
# Skip constraint errorsseedcli seed --all --skip-errorsseedcli list
Section titled “seedcli list”List tables in the database.
seedcli list [flags]| Flag | Short | Description | Default |
|---|---|---|---|
--db-url | - | Database URL | - |
--format | - | Output format (table, json) | table |
Examples
Section titled “Examples”# List all tablesseedcli list
# JSON outputseedcli list --format json
# With different databaseseedcli list --db-url "postgresql://localhost/other_db"Output
Section titled “Output”📋 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 tablesseedcli preview
Section titled “seedcli preview”Preview generated data without inserting.
seedcli preview [flags]| Flag | Short | Description | Default |
|---|---|---|---|
--table | -t | Table(s) to preview (repeatable) | - |
--rows | -n | Number of sample rows | 3 |
--format | - | Output format (table, json) | table |
--seed | - | Random seed | current time |
--db-url | - | Database URL | - |
Examples
Section titled “Examples”# Preview users tableseedcli preview -t users
# Preview multiple tablesseedcli preview -t users -t products
# More sample rowsseedcli preview -t users -n 10
# JSON outputseedcli preview -t users --format json
# Reproducible previewseedcli preview -t users --seed 42Output
Section titled “Output”📋 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 │└─────┴──────────────┴─────────────────────────────┴────────────┘seedcli version
Section titled “seedcli version”Display version information.
seedcli versionOutput
Section titled “Output”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 3Global Behavior
Section titled “Global Behavior”Configuration Loading
Section titled “Configuration Loading”All commands automatically load seedcli.yaml from:
- Current working directory
$HOME/.config/seedcli//etc/seedcli/
Logging
Section titled “Logging”All operations are logged to .logseed/seedcli-YYYY-MM-DD.log.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Configuration error |
3 | Database connection error |
4 | Seeding error |