> ## 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 import svix

> Convert a Svix environment export into a repost/ workspace, preserving the full version history.

`repost schema import svix` converts a Svix environment export into a complete `repost/` workspace: a schema describing the latest version of every event type, and an initial migration that preserves the source's full version history verbatim. The written schema is formatted and validates cleanly, and a generate on it round-trips to the source's schemas.

## Usage

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema import svix <file> [options]
```

`<file>` is the JSON from Svix's environment export endpoint.

## Options

| Option        | Description                                                              |
| ------------- | ------------------------------------------------------------------------ |
| `--out <dir>` | Directory to scaffold `repost/` into. Defaults to the current directory. |

## What it does

1. Reads and parses the export. A file that isn't a Svix environment export is rejected with the reason.
2. Refuses to run if the target `repost/` already exists.
3. Converts every event type: one catalog member and event binding per type, a payload model per schema, snake\_case fields renamed to camelCase with `@map`, and structurally identical nested models and enums deduplicated. Svix's archived and deprecated flags both become `@deprecated`.
4. Anything that cannot be represented losslessly is an error, and the command lists every offender at once rather than the first: event-type names that aren't valid identifiers, names without a `.`, and unsupported JSON Schema keywords. Names are never changed silently; rename in Svix or edit the export, then re-import.

Exit code `1` on a read error, an existing workspace, or any conversion problem, with nothing written.

## Example

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema import svix export.json --out app
```

```text theme={"languages":{"custom":["/languages/repost.json"]}}
Imported 12 event type(s) from export.json:
  4 catalog(s), 9 model(s), 2 enum(s)
Wrote:
  app/repost/schema.repost
  app/repost/migrations/20260718090000_init
```

Review the schema, then continue with [`generate`](/docs/cli/schema/generate) and, for future edits, [`migrate dev`](/docs/cli/schema/migrate-dev).

## Continue

<Columns cols={3} className="gap-y-4">
  <Card title="Defining events" icon="braces" href="/docs/send/schema" cta="Schema" arrow="true">
    The language your Svix catalog now lives in.
  </Card>

  <Card title="migrate deploy" icon="upload" href="/docs/cli/schema/migrate-deploy" cta="Go live" arrow="true">
    Deploy the imported history to an environment.
  </Card>

  <Card title="generate" icon="cog" href="/docs/cli/schema/generate" cta="Generate" arrow="true">
    Emit typed clients from the imported schema.
  </Card>
</Columns>
