terraform-plan-formatter

Crates.ioterraform-plan-formatter
lib.rsterraform-plan-formatter
version0.1.0
created_at2025-11-24 00:22:52.643798+00
updated_at2025-11-24 00:22:52.643798+00
descriptionA CLI tool to format Terraform plan output in human-readable format
homepagehttps://github.com/example/terraform-plan-formatter
repositoryhttps://github.com/example/terraform-plan-formatter
max_upload_size
id1947168
size50,123
Rayan (hichambouzkraoui)

documentation

https://docs.rs/terraform-plan-formatter

README

Terraform Plan Formatter

A minimal CLI tool to format Terraform plan output in a beautiful, human-readable format with expandable HTML output.

Installation

Quick Install (macOS/Linux)

curl -sSL https://raw.githubusercontent.com/example/terraform-plan-formatter/main/install.sh | bash

Quick Install (Windows)

iwr -useb https://raw.githubusercontent.com/example/terraform-plan-formatter/main/install.ps1 | iex

Package Managers

Alpine Linux

apk add tfplan

Manual Installation

Download Pre-built Binaries

  1. Go to Releases
  2. Download the appropriate binary for your platform:
    • macOS Intel: tfplan-v0.1.0-x86_64-apple-darwin.tar.gz
    • macOS Apple Silicon: tfplan-v0.1.0-aarch64-apple-darwin.tar.gz
    • Linux: tfplan-v0.1.0-x86_64-unknown-linux-gnu.tar.gz
    • Windows: tfplan-v0.1.0-x86_64-pc-windows-gnu.zip
  3. Extract and place tfplan in your PATH

Build from Source

git clone https://github.com/example/terraform-plan-formatter.git
cd terraform-plan-formatter
cargo build --release
cp target/release/tfplan /usr/local/bin/

Usage

# From file
tfplan plan.json

# From stdin
terraform plan -out=plan.tfplan
terraform show -json plan.tfplan | tfplan

# Generate HTML output
tfplan --html plan.json > plan.html

# Collapsed view (headers only)
tfplan --collapsed plan.json

# Interactive mode
tfplan --interactive plan.json

Features

  • Color-coded output for different actions (create, update, delete, replace)
  • HTML output with expandable/collapsible sections
  • Interactive mode for real-time expand/collapse
  • Collapsed view for overview
  • Cross-platform support (macOS, Linux, Windows)
  • Terraform Cloud styling for familiar look and feel

Examples

Terminal Output

▼ + aws_instance.web will be created
        ami: "ami-12345678"
        instance_type: "t3.micro"

▼ ~ aws_s3_bucket.data will be changed
        encryption: null => "AES256"
        versioning: false => true

HTML Output

Interactive HTML with clickable expand/collapse functionality, dark theme, and syntax highlighting.

Development

# Build
make build

# Test
make test

# Build for all platforms
make release

# Quick demo
make demo
Commit count: 0

cargo fmt