Back to Terragrunt

Hcl Fmt Stdin

docs/src/data/flags/hcl-fmt-stdin.mdx

1.1.4563 B
Original Source

When enabled, Terragrunt will read HCL content from standard input, format it, and write the result to standard output. This is useful for integrating with text editors or other tools.

Example:

bash
echo 'locals { foo="bar" }' | terragrunt hcl fmt --stdin

With --check or --diff, Terragrunt does not print the formatted content. --check exits with status code 1 when the input needs formatting, and --diff prints a unified diff labeled old/stdin and new/stdin.