repost schema generate validates the schema and emits every client declared by its generator blocks. With --check it compares instead of writing, which is the CI gate for committed clients.
Usage#
repost schema generate [options]Options#
| Option | Description |
|---|---|
--schema <path> | A .repost file or a directory of them. Defaults to ./repost/schema.repost, else ./repost/schema/. |
--check | Compare managed generated files without writing; fail on changed or stale files. |
What it does#
- Discovers and validates the schema. Validation errors exit
1; warnings print to stderr and generation continues. - Resolves every generator's output before writing anything. A missing
generatorblock, an unknown language, a Go or Python generator withoutoutput, or two generators resolving to the same directory all abort with nothing written. - Checks the migration history. A fork or a tampered snapshot is a hard error. Unmigrated changes only print a warning telling you to run
repost schema migrate dev, and generation continues. - Emits all generators in one atomic transaction. If any output fails, every already-written one is rolled back, so a polyglot schema never ends up half-updated.
Generation only overwrites directories it recognizes as its own output (by the generation marker, or a repost-client- package name for npm outputs). Anything else is refused with nothing written.
Exit code 1 on validation errors, misconfiguration, a fork, a checksum mismatch, an overwrite refusal, or --check drift.
Examples#
Generate the TypeScript client into node_modules:
repost schema generateGenerated Repost client (repost-client-2f0c81aa) into node_modules/.repost/client — import it from "@repost/client".Verify committed clients in CI:
repost schema generate --checkGenerated outputs are up to date.On drift, --check exits 1 and lists each changed or stale file per output.