Terraform Project Tree Generator CLI Tool
Project description
๐ rtftree --- Terraform Project Tree Generator CLI
A professional-grade CLI tool to generate clean, structured, and shareable Terraform project trees --- with smart exclude support, colored output, and Markdown export.
๐ Why rtftree?
Terraform projects often include:
.terraform/terraform.tfstate.terraform.lock.hcl.git/- Provider binaries
- Deeply nested modules
Sharing structure manually becomes messy and unreadable.
๐ฅ rtftree solves this problem by generating a clean, structured tree view of your infrastructure project --- ready for documentation, sharing, and audits.
โจ Features
โ
Beautiful tree-style output
โ
๐จ Colored CLI output
โ
Optional file content preview
โ
Smart exclude support (like .gitignore)
โ
Wildcard pattern support (*.exe, .terraform*)
โ
Exclude via file (--exclude-file)
โ
Markdown export mode (--markdown)
โ
Output to file (-o)
โ
Lightweight & Fast
โ
Installable as a CLI tool
๐ฆ Installation
๐น Local Install (Development Mode)
python -m pip install -e .
๐น Standard Install
python -m pip install .
๐น After PyPI Publish (Global Install)
pip install rtftree
๐ Usage
Basic Usage
rtftree <project-folder>
Example:
rtftree .
๐ Structure Only (No File Content)
rtftree . --no-content
๐ซ Exclude Files & Folders
Direct Patterns
rtftree . --exclude .terraform .git terraform.tfstate *.exe
Using Exclude File
rtftree . --exclude-file exclude.txt
Example exclude.txt:
.terraform
.git
terraform.tfstate
*.exe
.terraform.lock.hcl
Supported:
- Exact file names
- Folder names
- Wildcards
๐พ Save Output to File
rtftree . -o infra_tree.txt
๐ Markdown Export Mode
Generate Markdown-ready structure:
rtftree . --markdown -o structure.md
Perfect for:
- GitHub documentation
- Wiki pages
- Confluence
- Client documentation
๐ฅ Example Output
๐ Terraform Project: infra
โโโ ๐ modules
โ โโโ ๐ main.tf
โ โ resource "azurerm_resource_group" "rg" {
โ โ name = "example"
โ โ location = "East US"
โ โ }
โ โโโ ๐ variables.tf
โ variable "location" {
โ type = string
โ }
โโโ ๐ provider.tf
โ๏ธ CLI Options
Option Description
--no-content Show only folder/file structure
--exclude Space-separated patterns to ignore
--exclude-file Load exclude patterns from file
--markdown Export output in Markdown format
-o, --output Write output to file
๐ Project Structure
rtftree/
โ
โโโ rtftree/
โ โโโ __init__.py
โ โโโ cli.py
โ
โโโ pyproject.toml
โโโ README.md
๐ฅ DevOps Use Cases
- Share Terraform structure in tickets
- Infrastructure documentation
- CI/CD pipeline documentation
- Client infrastructure overview
- Audit reporting
- Pre-deployment reviews
๐ PyPI Publishing
Once published to PyPI, anyone can install globally:
pip install rtftree
This makes rtftree a globally accessible DevOps utility tool.
๐ง Roadmap
.treeignoreauto-detection--max-depthoption- Terraform-only mode (
*.tf) - JSON export
- GitHub Action integration
- Auto documentation mode
๐จโ๐ป Author
Ritesh Sharma
DevOps | Azure | Terraform | Kubernetes
๐ License
MIT License
โญ Support
If you find this tool useful:
โญ Star the repository
๐ Share with DevOps community
๐ Contribute improvements
Built with โค๏ธ for DevOps Engineers
Project details
Release history Release notifications | RSS feed
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 rtftree-1.0.2.tar.gz.
File metadata
- Download URL: rtftree-1.0.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420c8e746d0b513d7b6d841032b1f9e87a6ef908e69b85775915366adf5b00aa
|
|
| MD5 |
0fe7af4f89414f1540514c3253974a77
|
|
| BLAKE2b-256 |
2b147e909c2b65a7742a68161dfff50bc3e72dfaae8bf7ddbaffb320b0a329b9
|
File details
Details for the file rtftree-1.0.2-py3-none-any.whl.
File metadata
- Download URL: rtftree-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8514c993359b1c854999777a4537c8b47f7939b9ebd824b30585c8df4ba9b705
|
|
| MD5 |
fcad485cf2b8d33ba070ef3be04a5a62
|
|
| BLAKE2b-256 |
247bd0bb8aa31364dcfbcea6c31b2661d587d2db2c495437a19c007821bfb1b1
|