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 serveRun the Rad database server.
rad validateValidate a rad.schema.yaml file.
rad schemaInspect and manage the database schema.
rad schema statusCompare server, accepted, desired, and generated schemas.
rad schema diffShow desired schema changes and data preflight findings.
rad schema migrateApply rad.schema.yaml transactionally.
rad schema pullRecover the accepted schema from the database.
rad generateGenerate a typed client for the accepted schema.

rad serve

Run the Rad database server.

OptionPurposeDefaultEnvironment
--addr <value>HTTP server listen address.0.0.0.0:7237RAD_ADDR
--storage <memory|file|s3>Storage backend. Choices: memory, file, s3.fileRAD_STORAGE
-d, --db <path>File storage directory.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
--s3-bucket <value>S3 bucket used by the s3 storage backend.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 the schema structure, types, and references locally without calling out to the remote database.

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

rad schema

Inspect and manage the database schema.

SubcommandPurpose
statusCompare server, accepted, desired, and generated schemas.
diffShow desired schema changes and data preflight findings.
migrateApply rad.schema.yaml transactionally.
pullRecover the accepted schema from the database.
OptionPurposeDefaultEnvironment
--config <file>Project configuration file.rad.config.yaml
-f, --file <file>Desired schema file.rad.schema.yaml

rad schema status

Compare server, accepted, desired, and generated schemas.

rad schema diff

Show desired schema changes and data preflight findings.

OptionPurposeDefaultEnvironment
--format <text|json>Output format. Choices: text, json.text

rad schema migrate

Apply rad.schema.yaml transactionally.

OptionPurposeDefaultEnvironment
--accept-data-lossPermit explicitly reported destructive changes.
--no-generateDo not regenerate configured clients.

rad schema pull

Recover the accepted schema from the database.

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

rad generate

Generate a typed client for the accepted schema.

OptionPurposeDefaultEnvironment
-f, --file <file>Desired 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

Exit codes

CodeMeaning
0OK: The command completed successfully.
1Error: The command could not complete.