CLI Reference
The Watt TF command-line interface is designed for high-performance transformations and seamless integration into CI/CD pipelines.
wtf
The global wtf command serves as the entry point for all Watt TF operations. It provides a unified interface for executing various subcommands, each tailored to specific tasks in the workflow.
Global Options
| Option | Type | Description |
|---|---|---|
--verbose | flag | Enables verbose output for debugging and detailed logs. |
--log-format | string | Sets the log format. Options: pretty, text, or json. Default is pretty. |
--silent | flag | Enables silent mode, suppressing all output except for errors and warnings. |
wtf build
The build command is the primary entry point for transforming your blueprints into Terraform JSON files.
Usage
wtf build [options]Options
| Option | Type | Description |
|---|---|---|
--blueprint -b | string | Path to your blueprint YAML file. |
--input-i | string | Path to your input JSON or YAML file containing variables. |
--output-o | string | Path where the generated Terraform JSON file will be saved. |
--schema-s | string | Path/URL to a JSON Schema to validate the input file before transformation. |
--strict | flag | Enables strict mode (halts on missing keys or syntax errors). |
--strip-nulls | flag | Removes any keys with null values from the final output. |
--dry-run | flag | Performs a dry run. Prints a preview of the generated Terraform JSON configuration without writing any files. |
--config-c | string | Path to a configuration file (deprecated) |
Deprecation Note
Previously, it was possible to pass blueprints to Watt TF using --config or -c. This is still possible, but will be removed in the next major version (v2.0.0).
Example
In a typical CI/CD scenario (like GitHub Actions or GitLab CI), you would use the following pattern to ensure your infrastructure configuration is valid before deployment:
wtf build \
--blueprint blueprint.yaml \
--input env.prod.yaml \
--output main.tf.json \
--schema schemas/input-schema.json
--log-format jsonTIP
You could also use our GitHub Action to simplify this process. Check out the Documentation or the Watt TF GitHub Action Repository.
