Generate
Run configured generators from drzl.config.*.
Usage:
pnpm dlx @drzl/cli generate -c drzl.config.tsnpx @drzl/cli generate -c drzl.config.tsyarn dlx @drzl/cli generate -c drzl.config.tsbunx @drzl/cli generate -c drzl.config.tsBehavior:
- Analyzes your schema then runs each generator in
generators[] - Prints a file summary per generator kind
--check: fail CI when generated output is stale
npx @drzl/cli generate --checkRegenerates and compares the result against what is on disk. Exits 1 if anything differs and 0 when everything is current, naming each file:
Generated output is out of date (2 file(s)):
~ changed src/validators/zod/people.zod.ts
+ added src/validators/zod/extra.zod.ts
Run `drzl generate` and commit the result. Nothing was written by this check.It catches the two things that actually happen: someone edits a generated file by hand, and someone changes the schema without regenerating. Both are review problems today and CI problems with this.
It never modifies your working tree. The output directories are snapshotted before regeneration and restored afterwards whether or not anything drifted, including deleting files the run created. A failed check leaves the tree exactly as it found it.
In GitHub Actions:
- run: npx @drzl/cli generate --checkThis check is only possible because DRZL writes files. Validators that derive schemas in memory at import time have nothing on disk to compare, so they cannot offer it.
See also: Guide → Configuration

