ubx compile runs the full XCL pipeline (lex → parse → typecheck → IR → plugin Compile RPC) and writes the generated code artifact — but does not deploy. It’s useful for previewing generated output, artifact caching in CI, and debugging.
Usage
Flags
| Flag | Description |
|---|---|
--all | Compile all stacks in the workspace (topology order) |
--out <dir> | Write output to this directory instead of .ubx/ |
--plan | Write an --out-style plan JSON alongside the artifact |
--target <binding> | Limit compilation to specific resource bindings (repeatable) |
Examples
Generated artifacts
Forpulumi + python engine, ubx compile writes to .ubx/:
Pulumi.yaml is derived from filepath.Base(dir).
requirements.txt format:
terraform/opentofu engine:
Workspace vs single-stack
- Without
--all: single-stack path — invokes the plugin’sCompileRPC - With
--all: workspace path — compiles all stacks in topological order; native engine stacks use in-process codegen
Exit codes
| Code | Meaning |
|---|---|
0 | Compilation succeeded |
1 | Parse errors, typecheck errors, or plugin error |

