codegen
Generate code from a single Vexil schema file.
Usage
vexilc codegen <file.vexil> [--target <target>] [--output <path>]
Options
| Option | Default | Description |
|---|---|---|
--target <target> | rust | Code generation target: rust, typescript, or go |
--output <path> | stdout | Write output to a file instead of stdout |
Examples
# Generate Rust to stdout
vexilc codegen sensor.vexil
# Generate TypeScript to a file
vexilc codegen sensor.vexil --target typescript --output sensor.ts
# Generate Go
vexilc codegen sensor.vexil --target go --output sensor.go
Notes
- For schemas with imports, use
buildinstead - The generated code depends on the corresponding runtime library (
vexil-runtimefor Rust,@vexil-lang/runtimefor TypeScript) - Schema errors are reported before code generation begins