DEV Community

Cover image for 🌳 Automating Project Structure Insights with Folder_Tree
raymonepping
raymonepping

Posted on

🌳 Automating Project Structure Insights with Folder_Tree

Map. Clean. Document. Repeat.

Because folder structure is documentation β€” and now, it’s automated.


🧠 Why I Built folder_tree

Every time I opened an old project folder, I saw the same mess:
Too many files, deeply nested modules, ignored clutter, and no clear overview.

So I wrote folder_tree β€” a CLI that visualizes, filters, and documents any folder tree in seconds.
It’s minimal, scriptable, and designed to run in CI/CD or your local terminal.

Because sometimes you just need to see the shape of things.


βš™οΈ What It Does

βœ… Outputs your folder tree in Markdown
βœ… Excludes noise automatically (.terraform/, node_modules/, .DS_Store/, etc.)
βœ… Respects .treeignore files and presets
βœ… Optionally includes hidden files like .env, .git
βœ… Counts total files/folders + disk usage
βœ… Templated, versioned, and Homebrew-installable


πŸš€ Quickstart

brew tap raymonepping/folder-tree-cli
brew install raymonepping/folder-tree-cli/folder-tree-cli

folder_tree --preset terraform --output markdown
Enter fullscreen mode Exit fullscreen mode

Need hidden files or disk size?

folder_tree --hidden --compute --output markdown
Enter fullscreen mode Exit fullscreen mode

Set a custom config (optional):

export FOLDER_TREE_HOME=/opt/homebrew/opt/folder-tree-cli/share/folder-tree-cli

Enter fullscreen mode Exit fullscreen mode

✨ Example Output

πŸ“‚ Target: my_project
πŸ›‘οΈ Excludes from: .treeignore
./
β”œβ”€β”€ bin/
β”‚   └── folder_tree*
β”œβ”€β”€ tpl/
β”‚   └── folder_tree_md.tpl
β”œβ”€β”€ README.md
└── FOLDER_TREE.md

5 directories, 10 files
πŸ“¦ Total: 107.6 KB
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Use Cases

  • 🧱 Document structure in your README.md
  • πŸš€ Auto-generate folder views for GitHub projects
  • πŸ“ Catch bloated or outdated folders at a glance

🧬 Under the Hood

  • Modular template system (tpl/)
  • .treeignore and --preset for dynamic filtering
  • Markdown or terminal output (--output markdown)
  • Git-tracked file mode (--git)
  • Supports --compute, --history, --verbose, --bump-version

πŸ”š Final Thoughts

You don’t need another pretty tree diagram.
You need a clean, structured snapshot of your project β€” ready for docs, reviews, or CI logs.

And now you’ve got one.


πŸ“¦ Grab it from GitHub (https://raw.githubusercontent.com/raymonepping/homebrew-folder-tree-cli/refs/heads/main/bin/folder_tree)

🧠 Built for clarity. Documented by default.


πŸ•ŠοΈ Quote to remember:
β€œStructure isn’t boring β€” it’s your first line of clarity.”


Want to read more about folder_tree?

πŸ“˜ medium.com article: Automating Project Structure Insights with Folder_Tree

πŸ“— medium.com article: From ASCII Art to Audit-Ready Docs

Top comments (0)