Skip to content

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

OptionTypeDescription
--verboseflagEnables verbose output for debugging and detailed logs.
--log-formatstringSets the log format. Options: pretty, text, or json. Default is pretty.
--silentflagEnables 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

bash
wtf build [options]

Options

OptionTypeDescription
--blueprint
-b
stringPath to your blueprint YAML file.
--input
-i
stringPath to your input JSON or YAML file containing variables.
--output
-o
stringPath where the generated Terraform JSON file will be saved.
--schema
-s
stringPath/URL to a JSON Schema to validate the input file before transformation.
--strictflagEnables strict mode (halts on missing keys or syntax errors).
--strip-nullsflagRemoves any keys with null values from the final output.
--dry-runflagPerforms a dry run. Prints a preview of the generated Terraform JSON configuration without writing any files.
--config
-c
stringPath 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:

bash
wtf build \
  --blueprint blueprint.yaml \
  --input env.prod.yaml \
  --output main.tf.json \
  --schema schemas/input-schema.json
  --log-format json

TIP

You could also use our GitHub Action to simplify this process. Check out the Documentation or the Watt TF GitHub Action Repository.