OS Manuals

/usr/bin/terrafmt

Format terraform blocks embedded in files (FIPS)

From terrafmt-fips 1.0.1-r4 (enterprise-packages), captured 2026-11-08 by running terrafmt --help (exit 0). permalink

A small utility that formats terraform blocks found in files. Primarily intended to help with terraform provider development.

Usage:
  terrafmt [fmt|diff|blocks] [flags]
  terrafmt [command]

Available Commands:
  blocks      extracts terraform blocks from a file
  completion  Generate the autocompletion script for the specified shell
  diff        formats terraform blocks in a directory, file, or stdin and shows the difference
  fmt         formats terraform blocks in a directory, file, or stdin
  help        Help about any command
  version     Print the version number of terrafmt

Flags:
  -c, --check        return an error during diff if formatting is required
  -f, --fmtcompat    enable format string (%s, %d etc) compatibility
  -h, --help         help for terrafmt
  -q, --quiet        quiet mode, only shows block line numbers
  -u, --uncoloured   disable coloured output
  -v, --verbose      show files as they are processed & additional stats

Use "terrafmt [command] --help" for more information about a command.
Options (6)
OptionDescriptionSource
-c, --checkreturn an error during diff if formatting is requiredhelp
-f, --fmtcompatenable format string (%s, %d etc) compatibilityhelp
-h, --helphelp for terrafmthelp
-q, --quietquiet mode, only shows block line numbershelp
-u, --uncoloureddisable coloured outputhelp
-v, --verboseshow files as they are processed & additional statshelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.