> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ellomas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# generate

> Generate test data from a schema file.

# `seedling generate`

The main command. Generates test data from a schema file and writes it to the specified output.

## Usage

```bash theme={null}
seedling generate [options]
```

## Flags

| Flag           | Description                                      | Default       |
| -------------- | ------------------------------------------------ | ------------- |
| `--count`      | Rows per root table                              | `100`         |
| `--seed`       | Deterministic seed (0 = random)                  | `0`           |
| `--schema`     | Schema file path                                 | `schema.yaml` |
| `--output`     | Output file or directory                         | stdout        |
| `--format`     | Output format (`sql`, `csv`, `jsonl`, `parquet`) | `sql`         |
| `--batch-size` | Rows per batch                                   | `1000`        |
| `--db`         | Direct database insert DSN                       | —             |
| `--copy`       | Use COPY protocol (Postgres only)                | `false`       |
| `--truncate`   | TRUNCATE tables before inserting                 | `false`       |
| `--generators` | YAML generator overrides file                    | —             |
| `--config`     | seedling.yaml config file                        | —             |
| `--dry-run`    | Print plan without generating                    | `false`       |
| `--parallel`   | Generate tables in parallel                      | `false`       |
| `--verbose`    | Progress bars and summary                        | `false`       |

## Examples

### Basic SQL Generation

```bash theme={null}
seedling generate --count 10000 --output seed.sql
```

### Deterministic Generation

```bash theme={null}
seedling generate --count 50000 --seed 42 --output seed.sql
```

### Direct Database Insert

```bash theme={null}
seedling generate --count 500000 --db postgres://localhost:5432/staging
```

### Postgres COPY Protocol (Max Throughput)

```bash theme={null}
seedling generate --count 1000000 --db postgres://localhost:5432/staging --copy
```

### CSV Output

```bash theme={null}
seedling generate --count 10000 --output data/ --format csv
```

### Dry Run

```bash theme={null}
seedling generate --count 500000 --dry-run --verbose
```

Output:

```
Plan:
  users:    500,000 rows
  orders:   1,200,000 rows (FK: users.id)
  payments: 1,200,000 rows (FK: orders.id)
  ---
  Total:    2,900,000 rows
  Est. size: 450 MB
  FK order: users → orders → payments
```

### With Generator Overrides

```bash theme={null}
seedling generate --count 10000 --generators overrides.yaml
```

### With Config File

```bash theme={null}
seedling generate --config seedling.yaml
```
