Skip to content

Command-line Interface

The weltenwanderer CLI validates .ddd files and generates executable code for target platforms.

Installation

The CLI is included in the @weltenwanderer/cli package. After building the monorepo, the binary is available as weltenwanderer.

Commands

validate

Validates one or more .ddd files against all compiler checks.

weltenwanderer validate <pattern...>

Arguments:

ArgumentDescription
pattern...One or more glob patterns matching .ddd files (e.g. "src/**/*.ddd"). At least one pattern is required.

Example:

Terminal window
weltenwanderer validate "examples/**/*.ddd"
weltenwanderer validate registration.ddd checkout.ddd

Output:

Each file is reported on its own line, prefixed with a check mark on success or a cross on failure. Errors include the source position in line:column format followed by the error message.

✓ examples/minimal/registration.ddd
✗ examples/broken/checkout.ddd
12:5 Mismatched input 'event' expecting '}'
24:1 Command 'PlaceOrder' has no decide clause

generate

Generates TypeScript/Emmett code from a single .ddd file.

weltenwanderer generate <file.ddd> [options]

Options:

OptionDefaultDescription
--target <target>emmettTarget platform. Currently only emmett is supported.
--output <dir>src/generatedOutput directory for generated files.

Example:

Terminal window
weltenwanderer generate registration.ddd
weltenwanderer generate registration.ddd --target emmett --output dist/generated

The file is parsed and validated before generation. If parse or validation errors are found, the command prints diagnostics and exits with code 1 without generating any files.

On success, the command creates the output directory structure and reports the number of generated files:

✓ Generated 7 files to src/generated

Exit codes

CodeMeaning
0All files passed validation
1One or more files failed validation, or no files matched the given patterns, or an unknown subcommand was provided
2Unexpected runtime error

Error output format

Errors are written to stdout, one per line, indented two spaces beneath the failing file path:

<line>:<column> <message>

Parser errors and diagnostic errors (severity: error) are both reported. Warnings are not reported.