CLI

Commands and options provided by the Rad command-line tool.

Use the CLI to run Rad, apply rad.schema.yaml, and generate a typed client from the accepted schema.

Commands

CommandPurpose
rad initInitialize a Rad project without overwriting existing project files.
rad serveRun the database API and administration UI.
rad validateValidate a desired schema locally without contacting a server.
rad doctorDiagnose project, server, accepted-state, generation, and transition health.
rad schemaValidate, inspect, plan, apply, recover, and monitor schemas.
rad schema statusCompare server, accepted, desired, and generated schema state.
rad schema diffPlan desired changes and report destructive or blocking findings.
rad schema migrateApply rad.schema.yaml transactionally and wait for online work.
rad schema pullRecover desired and accepted local state from the server.
rad schema json-schemaPrint the bundled JSON Schema for rad.schema.yaml.
rad schema transitionsInspect, wait for, and cancel durable online schema work.
rad schema transitions listList durable schema transitions, including retained terminal records.
rad schema transitions getInspect one transition without advancing it.
rad schema transitions waitWait until one transition reaches a terminal state.
rad schema transitions cancelCancel active transition work and schedule partial artifacts for cleanup.
rad generateGenerate a typed Go client for the exact accepted schema.
rad skillsDiscover the Agent Skill bundled with this Rad version.
rad skills listList bundled skills.
rad skills getPrint the Rad skill instructions.
rad skills pathMaterialize the bundled skill and print its directory path.
rad specPrint the bundled OpenCLI command specification.

rad init

Create rad.config.yaml and rad.schema.yaml in a new or existing project directory. In a terminal, Rad guides you through the small set of project choices. Use --yes to accept defaults without prompts. Existing project files are never overwritten, and accepted rad.state is created only by a successful schema migration or pull.

Documentation: https://www.radengine.dev/docs/cli#rad-init

ArgumentPurposeDefault
[DIRECTORY]Directory to initialize..
OptionPurposeDefaultEnvironment
--database-url <value>Rad database URL written to the project configuration.rad://127.0.0.1:7237
-o, --out <path>Generated Go client output directory.generated
--pkg <value>Generated Go package name.db
--no-generateDo not configure generated client output.
--emptyCreate an empty schema instead of the starter users table.
-y, --yesAccept supplied values and defaults without prompting.

rad serve

Run Rad until interrupted. A write instance owns the Slate writer; any number of read instances can serve polling checkpoint views of the same storage path. A fresh database defaults to direct catalog management; pass --catalog-mode schema when rad.schema.yaml should own all catalog changes. Catalog mode is immutable after database initialization.

The public API uses --addr (default port 7237). The administration UI uses the following port (default 7238). Pass --frontend postgres to also expose the PostgreSQL wire protocol on port 5432.

Documentation: https://www.radengine.dev/docs/cli#rad-serve

OptionPurposeDefaultEnvironment
--addr <value>Public HTTP listen address; the admin UI uses the next port.0.0.0.0:7237RAD_ADDR
--role <read|write>Process-wide Slate access role. Choices: read, write.writeRAD_ROLE
--reader-poll-interval-ms <value>Slate manifest polling interval for read instances.1000RAD_READER_POLL_INTERVAL_MS
--storage <memory|file|s3>Storage backend for SlateDB data. Choices: memory, file, s3.fileRAD_STORAGE
-d, --db <path>File storage directory; used only with --storage file.dataRAD_DATA_DIR
--storage-path <value>Logical SlateDB path within the selected backend.radRAD_STORAGE_PATH
--catalog-mode <direct|schema>Catalog mode for a fresh database; immutable after initialization. Choices: direct, schema.RAD_CATALOG_MODE
--frontend <postgres>Optional compatibility frontend to expose alongside the HTTP API. Choices: postgres.RAD_FRONTEND
--postgres-addr <value>PostgreSQL frontend listen address; used with --frontend postgres.0.0.0.0:5432RAD_POSTGRES_ADDR
--s3-bucket <value>S3 bucket; required with --storage s3.RAD_S3_BUCKET
--s3-prefix <value>S3 object prefix; defaults to --storage-path.RAD_S3_PREFIX
--s3-region <value>S3 region.RAD_S3_REGION
--s3-endpoint <value>Custom S3-compatible endpoint, such as RustFS.RAD_S3_ENDPOINT

rad validate

Parse and validate rad.schema.yaml structure, types, identities, constraints, indexes, and references without changing any state or contacting the configured database.

Documentation: https://www.radengine.dev/docs/schemas

OptionPurposeDefaultEnvironment
-f, --file <file>Desired declarative schema file.rad.schema.yaml

rad doctor

Run read-only checks against rad.config.yaml, rad.schema.yaml, rad.state, the configured server, generated clients, and durable schema transitions. Warnings identify expected or recoverable drift. Failed checks make the command exit unsuccessfully.

Documentation: https://www.radengine.dev/docs/cli#rad-doctor

OptionPurposeDefaultEnvironment
--config <file>Project configuration file; relative schema and output paths resolve from it.rad.config.yaml
-f, --file <file>Desired declarative schema file.rad.schema.yaml

rad schema

Manage the desired schema in rad.schema.yaml, the database's accepted schema, local accepted state in rad.state, generated clients, and durable online transition work.

Safe workflow: rad validate rad schema diff rad schema migrate rad schema status

Documentation: https://www.radengine.dev/docs/schemas/manage

SubcommandPurpose
statusCompare server, accepted, desired, and generated schema state.
diffPlan desired changes and report destructive or blocking findings.
migrateApply rad.schema.yaml transactionally and wait for online work.
pullRecover desired and accepted local state from the server.
json-schemaPrint the bundled JSON Schema for rad.schema.yaml.
transitionsInspect, wait for, and cancel durable online schema work.
OptionPurposeDefaultEnvironment
--config <file>Project configuration file; relative schema and output paths resolve from it.rad.config.yaml
-f, --file <file>Desired declarative schema file.rad.schema.yaml

rad schema status

Read the server schema, local immutable accepted snapshot, and desired schema, verify configured generated clients, then summarize whether all four copies are synchronized. This command does not modify the project or database.

Documentation: https://www.radengine.dev/docs/schemas/manage#1-check-the-four-copies

rad schema diff

Ask the server to plan rad.schema.yaml against the current accepted schema. The plan is read-only and point-in-time. Migration replans transactionally before applying. Destructive findings require explicit consent; blocking findings cannot be bypassed.

Documentation: https://www.radengine.dev/docs/schemas/manage#2-review-the-plan

OptionPurposeDefaultEnvironment
--format <text|json>Output format; retained for compatibility with existing tooling. Choices: text, json.text

rad schema migrate

Replan and apply the desired schema against the current catalog. Rad refuses blocking changes, requests explicit consent for reported data loss, waits for durable online transitions, updates rad.state, and regenerates configured clients.

In non-interactive mode, a destructive plan fails unless --accept-data-loss is supplied. Never add that flag without reviewing the JSON diff and obtaining the user's consent.

Documentation: https://www.radengine.dev/docs/schemas/manage#3-apply-and-wait

OptionPurposeDefaultEnvironment
--accept-data-lossPermit only the destructive findings reported by the migration plan.
--no-generateDo not regenerate configured clients after acceptance.

rad schema pull

Use the server's accepted schema as the source of truth. Pull refuses to overwrite a locally modified rad.schema.yaml unless --force is supplied; forced pulls first write a timestamped backup.

Pull is a recovery operation, not the normal way to accept desired schema changes.

Documentation: https://www.radengine.dev/docs/schemas/manage#recover-local-state-from-the-server

OptionPurposeDefaultEnvironment
--forceBack up and replace a locally modified desired schema.
--no-generateDo not regenerate configured clients after recovery.

rad schema json-schema

Emit the exact rad.schema.yaml JSON Schema bundled with this Rad binary. Use it for offline validation, editor integration, or agent introspection.

Documentation: https://www.radengine.dev/docs/schemas

rad schema transitions

Observe the authoritative lifecycle state of schema transitions. Progress counters are advisory; ready, failed, and cancelled are terminal states.

Documentation: https://www.radengine.dev/docs/schemas/monitor

SubcommandPurpose
listList durable schema transitions, including retained terminal records.
getInspect one transition without advancing it.
waitWait until one transition reaches a terminal state.
cancelCancel active transition work and schedule partial artifacts for cleanup.

rad schema transitions list

List active transitions and retained terminal records. Filter by protocol kind or lifecycle state without changing work.

Documentation: https://www.radengine.dev/docs/schemas/monitor

OptionPurposeDefaultEnvironment
--kind <index-build|column-replacement|constraint-validation>Return only one transition protocol kind. Choices: index-build, column-replacement, constraint-validation.
--state <waiting|building|catching-up|validating|ready|failed|cancelled>Return only one lifecycle state. Choices: waiting, building, catching-up, validating, ready, failed, cancelled.

rad schema transitions get

Read the durable control record, progress counters, retained-work pressure, and last error for one transition.

Documentation: https://www.radengine.dev/docs/schemas/transitions

ArgumentPurposeDefault
<TRANSITION>Durable transition ID, such as tr42.

rad schema transitions wait

Poll one transition until it becomes ready, failed, or cancelled. The wait has explicit interval and timeout bounds and never advances the transition itself.

Documentation: https://www.radengine.dev/docs/schemas/monitor

ArgumentPurposeDefault
<TRANSITION>Durable transition ID, such as tr42.
OptionPurposeDefaultEnvironment
--interval-ms <value>Poll interval in milliseconds.500
--timeout-seconds <value>Maximum wait in seconds.300

rad schema transitions cancel

Cancel only when abandoning the requested schema change. The operation is idempotent for an already-cancelled transition and rejects ready or failed terminal work. Use --yes for unattended execution.

Documentation: https://www.radengine.dev/docs/schemas/monitor

ArgumentPurposeDefault
<TRANSITION>Durable transition ID, such as tr42.
OptionPurposeDefaultEnvironment
-y, --yesConfirm cancellation without prompting.

rad generate

Generate a typed client from the immutable accepted schema snapshot recorded by rad schema migrate or rad schema pull. Generation refuses to target unapplied desired changes. rad generate reads accepted state; it does not create or repair it.

Documentation: https://www.radengine.dev/docs/concepts/schemas-and-clients

OptionPurposeDefaultEnvironment
-f, --file <file>Desired declarative schema file.rad.schema.yaml
-o, --out <path>Output directory.generated
--pkg <value>Generated package or client name.db
--lang <go>Client language. Choices: go.go

rad skills

Rad ships one Agent Skills-compatible guide covering project setup, declarative schema editing, migration safety, client generation, diagnostics, and operations. The bundled instructions always match this binary.

Agent Skills standard: https://agentskills.io Documentation: https://www.radengine.dev/docs/cli#rad-skills

SubcommandPurpose
listList bundled skills.
getPrint the Rad skill instructions.
pathMaterialize the bundled skill and print its directory path.

rad skills list

List the Agent Skills-compatible guides embedded in this Rad binary.

Documentation: https://www.radengine.dev/docs/cli#rad-skills-list

rad skills get

Print the canonical skill instructions matching this binary. Add --full to include each referenced guide in the same response.

Documentation: https://www.radengine.dev/docs/cli#rad-skills-get

ArgumentPurposeDefault
<NAME>Bundled skill name. Choices: rad.
OptionPurposeDefaultEnvironment
--fullInclude all bundled reference documents.

rad skills path

Write the complete, version-matched skill into Rad's cache and print its root directory for agents that load skills from the filesystem. Set RAD_SKILLS_DIR to choose the parent directory.

Documentation: https://www.radengine.dev/docs/cli#rad-skills-path

ArgumentPurposeDefault
<NAME>Bundled skill name. Choices: rad.

rad spec

Emit the exact command contract used to generate this binary's parser and CLI documentation. YAML is the normative source; JSON is available for machine consumers.

Documentation: https://www.radengine.dev/docs/cli#rad-spec

OptionPurposeDefaultEnvironment
--format <yaml|json>Specification encoding. Choices: yaml, json.yaml

Exit codes

CodeMeaning
0OK: The command completed successfully.
1Error: The command could not complete; JSON errors include a stable code.