Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

Commands

twerk server start

Start Twerk in a specific mode.

twerk server start <MODE> [OPTIONS]
ModeDescription
standaloneAll-in-one: Coordinator + Worker
coordinatorAPI server, requires separate workers
workerTask executor, requires coordinator
OptionDescriptionDefault
--hostname <HOSTNAME>Coordinator hostname for workersnone

Config is loaded from TWERK_CONFIG or the default config search paths. There is no --config CLI flag.

twerk migration

Run database migrations.

twerk migration [OPTIONS]
OptionDescription
-y, --yesSkip confirmation prompt

twerk migration reads the datastore type and Postgres DSN from config or TWERK_* environment variables.

twerk health

Check coordinator health.

twerk health [OPTIONS]
OptionDescriptionDefault
-e, --endpoint <URL>Coordinator endpointhttp://localhost:8000

twerk version

Show the current CLI version.

twerk version [--json]

Text-mode version discovery commands are clean endpoints: they print only the version line to stdout, keep stderr empty, and exit 0.

Supported forms:

  • twerk --versiontwerk <VERSION>
  • twerk versiontwerk <VERSION>
  • twerk run --versiontwerk-run <VERSION>
  • twerk migration --versiontwerk-migration <VERSION>
  • twerk health --versiontwerk-health <VERSION>

Top-Level Flags

OptionDescription
--jsonEmit machine-readable JSON for help, version, parse errors, and command failures on stdout
--helpShow CLI help
--versionShow the current version

JSON Behavior

  • Help discovery commands such as twerk --json, twerk --json --help, twerk help --json, and twerk run --json --help return JSON with a rendered content field.
  • Version discovery commands such as twerk --json --version and twerk version --json return JSON on stdout, keep stderr empty, and exit 0.
  • JSON parse failures keep Clap exit code 2 and write structured error JSON to stdout.
  • JSON command validation and runtime failures exit 1, write structured error JSON to stdout, and keep stderr empty.

Environment Variables

All configuration can be set via environment variables:

TWERK_<SECTION>_<KEY>=value

Examples:

  • TWERK_LOGGING_LEVEL=debug
  • TWERK_BROKER_TYPE=rabbitmq
  • TWERK_DATASTORE_TYPE=postgres
  • TWERK_RUNTIME_TYPE=docker

See Configuration for full reference.