> ## 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 init

> Scaffold a repost/ workspace: a starter schema, .env placeholders, and .gitignore entries.

`repost schema init` creates a `repost/` directory with a working starter schema, a `.env` file with the two credential placeholders, and the matching `.gitignore` entries. The starter schema is canonically formatted and generates as-is.

## Usage

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

Run bare on a terminal, it prompts for the SDK language and output directory. With any argument, or outside a terminal, it runs headless with the flags below, so scripts and CI never see a prompt.

## Options

| Option                     | Description                                                                                                                         |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `--language <language>`    | SDK language for the scaffolded generator block. Defaults to `typescript`; see [`languages`](/docs/cli/schema/languages) for the values. |
| `--output <path>`          | Generated source root written into the schema. Required for every language except TypeScript.                                       |
| `--resource-output <path>` | Java and Kotlin only: the generated resource root.                                                                                  |
| `--package-name <package>` | Java and Kotlin only: the package for generated code.                                                                               |
| `--client-name <type>`     | Java and Kotlin only: the generated client class name. Defaults to `RepostClient`.                                                  |

## What it does

1. Validates the options. A Go or Python init without `--output` is refused, and a Java or Kotlin init missing arguments reports every missing flag in one error, writing nothing.
2. Refuses to run if `repost/` already exists: `` `repost/` already exists — refusing to overwrite an existing workspace ``.
3. Writes `repost/schema.repost` with a starter `user.created` event and the generator block for your language.
4. Adds `REPOST_SEND_API_KEY=""` and `REPOST_TOKEN=""` placeholders to `.env`, and `.env` plus the engine's state directories to `.gitignore`. Existing lines are never clobbered or duplicated.
5. Prints language-specific next steps.

Exit code `1` on any refusal, `0` on success.

## Example

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema init --language typescript
```

```text theme={"languages":{"custom":["/languages/repost.json"]}}
Created repost/schema.repost
Created .env
Created .gitignore
Next steps:
  1) edit repost/schema.repost
  2) npm install @repost/client
  3) repost schema migrate dev --name init
  4) create an Environment in the dashboard and paste its API key
     into .env (REPOST_SEND_API_KEY)
  5) import { createRepostClient } from "@repost/client"
```

A JVM init also prints the managed source and resource roots, the compatible runtime and plugin coordinates, and the import line for your generated client:

```bash theme={"languages":{"custom":["/languages/repost.json"]}}
repost schema init --language java \
  --output ./src/main/java \
  --resource-output ./src/main/resources \
  --package-name com.acme.orders \
  --client-name OrdersClient
```

## Continue

<Columns cols={3} className="gap-y-4">
  <Card title="migrate dev" icon="git-branch" href="/docs/cli/schema/migrate-dev" cta="Next command" arrow="true">
    Record the starter schema as your first migration.
  </Card>

  <Card title="languages" icon="list" href="/docs/cli/schema/languages" cta="Languages" arrow="true">
    The supported languages and their defaults.
  </Card>

  <Card title="Schema workflow" icon="terminal" href="/docs/cli/schema" cta="Overview" arrow="true">
    The full init to deploy walkthrough.
  </Card>
</Columns>
