tfsort
« Back to VersTracker
Description:
CLI to sort Terraform variables and outputs
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: terraform cli devops infrastructure-as-code sorting
Install: brew install tfsort
About:
Tfsort is a command-line interface tool designed to organize Terraform configuration files by alphabetically sorting variable and output blocks. This process enhances code readability and maintainability, making it easier for teams to navigate and manage infrastructure as code. It helps enforce consistent ordering conventions across Terraform projects.
Key Features:
  • Alphabetically sorts variable blocks
  • Alphabetically sorts output blocks
  • Preserves comments and formatting
  • Handles nested structures
  • CLI for easy automation
Use Cases:
  • Standardizing Terraform configuration files in large projects
  • Preparing code for review by ensuring consistent ordering
  • Automating code cleanup in CI/CD pipelines
Alternatives:
  • terraform fmt – Native Terraform command for formatting, but does not sort variable/output blocks alphabetically
  • tfsec – Security scanner, not a code formatter
Version History
Detected Version Rev Change Commit
Sep 12, 2025 12:47am 0 VERSION_BUMP 7aff6343