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

# repost schema 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

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
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

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](/docs/send/monorepos) 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`:

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema generate
```

```text theme={"languages":{"custom":["/languages/repost.json"]}}
Generated Repost client (repost-client-2f0c81aa) into node_modules/.repost/client — import it from "@repost/client".
```

Verify committed clients in CI:

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema generate --check
```

```text theme={"languages":{"custom":["/languages/repost.json"]}}
Generated outputs are up to date.
```

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

## Continue

<Columns cols={3} className="gap-y-4">
  <Card title="migrate dev" icon="git-branch" href="/docs/cli/schema/migrate-dev" cta="Record" arrow="true">
    Record schema changes; it regenerates as part of the run.
  </Card>

  <Card title="Polyglot monorepos" icon="git-merge" href="/docs/send/monorepos" cta="Monorepos" arrow="true">
    Multi-generator semantics in depth.
  </Card>

  <Card title="migrate status" icon="list-checks" href="/docs/cli/schema/migrate-status" cta="CI gate" arrow="true">
    The companion check for migration health.
  </Card>
</Columns>
