Skip to content

Riteshatri/rtftree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 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.


Python License CLI Terraform


πŸ“Œ 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

  • .treeignore auto-detection
  • --max-depth option
  • 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

About

πŸš€ RTFTree β€” A blazing-fast CLI tool that transforms your Terraform projects into beautifully structured tree views. 🌳 Clean & readable output 🧠 Smart exclude filtering πŸ“„ Optional file content previews ⚑ Built for DevOps engineers who demand clarity in Infrastructure as Code

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages