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

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

OptionDescription
--language <language>SDK language for the scaffolded generator block. Defaults to typescript; see 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

repost schema init --language typescript
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:

repost schema init --language java \
  --output ./src/main/java \
  --resource-output ./src/main/resources \
  --package-name com.acme.orders \
  --client-name OrdersClient

Continue