A beautiful tree visualization tool for Terraform/OpenTofu plan output
Project description
tofu-tree
๐ณ Simple tree visualization for Terraform/OpenTofu plan output
Transform your terraform plan or tofu plan output into an easy-to-read hierarchical tree structure with color-coded change indicators.
โจ Features
- ๐ณ Beautiful Tree Output โ Visualize your Terraform plan as a clean, hierarchical tree
- ๐จ Color-Coded Symbols โ Instantly see what's being created (+), destroyed (-), replaced (ยฑ), or updated (~)
- ๐ Auto-Detection โ Automatically finds and runs
tofuorterraformin your PATH - ๐ Summary Statistics โ Quick overview of total changes at a glance
- ๐ฆ Zero Dependencies โ Pure Python, works out of the box
- ๐ฅ๏ธ Cross-Platform โ Works on Linux, macOS, and Windows
๐ฆ Installation
pip install tofu-tree
Or with pipx for isolated installation:
pipx install tofu-tree
๐ Quick Start
Run in a Terraform/OpenTofu directory
cd your-terraform-project
tofu-tree
Pipe plan output directly
tofu plan -concise -no-color | tofu-tree --input
Specify a directory
tofu-tree /path/to/terraform/project
๐ Usage
usage: tofu-tree [-h] [-V] [--no-color] [--input] [path]
Parse Terraform/OpenTofu plan output and display as a beautiful tree
positional arguments:
path Path to the Terraform/OpenTofu directory (default: current directory)
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--no-color Disable ANSI color output for symbols (color is enabled by default)
--input, -i Read plan output from stdin instead of running terraform/tofu plan
๐ฌ Example Output
+-ยฑ local_file
โ โโโ - nested_docs
โ โ โโโ - nested_docs: changelog
โ โ โโโ - nested_docs: license
โ โ โโโ - nested_docs: readme
โ โ
โ โโโ + nested_docs_2
โ โ โโโ + nested_docs_2: changelog
โ โ โโโ + nested_docs_2: license
โ โ โโโ + nested_docs_2: readme
โ โ
โ โโโ +-ยฑ scripts
โ โโโ - scripts: backup
โ โโโ + scripts: create
โ โโโ ยฑ scripts: deploy
โ
+ 4 to be created
- 4 to be destroyed
ยฑ 1 to be replaced
~ 0 to be updated
Symbol Legend
| Symbol | Color | Meaning |
|---|---|---|
+ |
๐ข Green | Resource will be created |
- |
๐ด Red | Resource will be destroyed |
ยฑ |
๐ฃ Magenta | Resource will be replaced (destroy + create) |
~ |
๐ก Yellow | Resource will be updated in-place |
๐ง How It Works
- Parse โ Reads Terraform/OpenTofu plan output (concise format with
-conciseflag) - Build โ Constructs a hierarchical graph from resource addresses
- Display โ Renders the graph as a tree with proper connectors (โโโ, โโโ)
- Summarize โ Shows counts of created, destroyed, replaced, and updated resources
๐ค Contributing
Contributions are welcome! Here's how to get started:
# Clone the repository
git clone https://github.com/yourusername/tofu-tree.git
cd tofu-tree
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linter
ruff check src tests
# Run type checker
mypy src/tofu_tree
If you like the idea please upvote this feature request Add short concise tree view output option for tofu plan #3619
๐ License
Hippocratic License 3.0 โ see LICENSE for details.
This license includes ethical restrictions, including a prohibition on using this software to train artificial intelligence systems without explicit permission.
๐ Acknowledgments
Inspired by the Unix tree command and the need for better Terraform plan visualization.
Vibe Coded with โค๏ธ for the Infrastructure as Code community
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tofu_tree-0.3.3.tar.gz.
File metadata
- Download URL: tofu_tree-0.3.3.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6281d0dbef0f1e05eb4ecce408a2bc15a8d3d6c0c2743f9d840054dd483d051
|
|
| MD5 |
d201200b5545d1ec5cca40ab0b80f9f7
|
|
| BLAKE2b-256 |
e39358b35f144b5e7c256bd3a4e1d2257d240c276ed4369a5f3ea9e8c8e41238
|
Provenance
The following attestation bundles were made for tofu_tree-0.3.3.tar.gz:
Publisher:
publish.yml on Samet-MohamedAmin/tofu-tree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tofu_tree-0.3.3.tar.gz -
Subject digest:
a6281d0dbef0f1e05eb4ecce408a2bc15a8d3d6c0c2743f9d840054dd483d051 - Sigstore transparency entry: 774525643
- Sigstore integration time:
-
Permalink:
Samet-MohamedAmin/tofu-tree@9494f805db8100581270f81b0d421e65390e393b -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Samet-MohamedAmin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9494f805db8100581270f81b0d421e65390e393b -
Trigger Event:
release
-
Statement type:
File details
Details for the file tofu_tree-0.3.3-py3-none-any.whl.
File metadata
- Download URL: tofu_tree-0.3.3-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8be044a1983cca0fe470d46bf7cd0f82f902421e9e6d5fd9584b149167c610f4
|
|
| MD5 |
bbaef42816c2d984d447c5e58070245b
|
|
| BLAKE2b-256 |
76c2ffd1ded1b39495a253bb58370a8522e5d70115bd4ab35d5a11045c188055
|
Provenance
The following attestation bundles were made for tofu_tree-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on Samet-MohamedAmin/tofu-tree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tofu_tree-0.3.3-py3-none-any.whl -
Subject digest:
8be044a1983cca0fe470d46bf7cd0f82f902421e9e6d5fd9584b149167c610f4 - Sigstore transparency entry: 774525648
- Sigstore integration time:
-
Permalink:
Samet-MohamedAmin/tofu-tree@9494f805db8100581270f81b0d421e65390e393b -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Samet-MohamedAmin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9494f805db8100581270f81b0d421e65390e393b -
Trigger Event:
release
-
Statement type: