Skip to main content

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.


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

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

rtftree-1.0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtftree-1.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

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

Hashes for rtftree-1.0.2.tar.gz
Algorithm Hash digest
SHA256 420c8e746d0b513d7b6d841032b1f9e87a6ef908e69b85775915366adf5b00aa
MD5 0fe7af4f89414f1540514c3253974a77
BLAKE2b-256 2b147e909c2b65a7742a68161dfff50bc3e72dfaae8bf7ddbaffb320b0a329b9

See more details on using hashes here.

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

Hashes for rtftree-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8514c993359b1c854999777a4537c8b47f7939b9ebd824b30585c8df4ba9b705
MD5 fcad485cf2b8d33ba070ef3be04a5a62
BLAKE2b-256 247bd0bb8aa31364dcfbcea6c31b2661d587d2db2c495437a19c007821bfb1b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page