generate

Generate every SDK declared in your schema, or verify with --check that the committed output hasn't drifted.

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

OptionDescription
--schema <path>A .repost file or a directory of them. Defaults to ./repost/schema.repost, else ./repost/schema/.
--checkCompare managed generated files without writing; fail on changed or stale files.

What it does

  1. Discovers and validates the schema. Validation errors exit 1; warnings print to stderr and generation continues.
  2. Resolves every generator's output before writing anything. A missing generator block, an unknown language, a Go or Python generator without output, or two generators resolving to the same directory all abort with nothing written.
  3. 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.
  4. 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 generate
Generated Repost client (repost-client-2f0c81aa) into node_modules/.repost/client — import it from "@repost/client".

Verify committed clients in CI:

repost schema generate --check
Generated outputs are up to date.

On drift, --check exits 1 and lists each changed or stale file per output.

Continue