Reading a large terraform plan output in JSON can be overwhelming, especially in complex infrastructures.
tfviz is a simple CLI tool that takes terraform show -json output and generates a clean, visual HTML report.
It summarizes key statistics and shows changes grouped by module and resource, making it easier to understand and share with your team.
- Go 1.18 or higher
- Terraform 0.12 or higher
- Terraform plan output in JSON format (
terraform show -json)
Make sure Go is installed on your system.
go build -o tfviz main.gosudo mv tfviz /usr/local/bin/By default, tfviz runs on port 9876. To change it, modify the port variable in the serveHTMLOnce function inside main.go:
func serveHTMLOnce(html string) {
port := "9876" // ← Change this if needed
...
}In your Terraform project directory:
tfviz planThis will start a temporary local web server and automatically open your default browser to show the visualized plan.
To see a dependency graph of your resources, use the --graph or -g flag:
tfviz plan --graphNo HTML file is written to disk — everything runs in memory.
The server automatically shuts down 5 seconds after the page has been opened, regardless of whether the browser is still open or not.