The CLI utility that turns messy text, directory trees, and indented outlines into real project or directory structures. Build structures from scratch. Refine messy inputs. Automate your setup.
Features β’ Installation β’ Examples β’ Usage β’ Contributing
The Scenario: You're sketching a project architecture in a text file, or maybe ChatGPT just generated a perfect folder structure for you.
The Problem: Manually creating specifically nested folders and files is tedious, error-prone, and slow.
The Solution: Feed that text into tr2rl. It parses seemingly "broken" or "messy" trees and instantly builds the real file structure for you.
- For AI Users: ChatGPT and Claude give you ASCII trees. You can't execute them.
tr2rllets you copy-paste-build in seconds. - For System Architects: Stop writing 20 lines of
mkdir -pandtouchcommands. Just draw the tree. - For Tutorials: Share a lightweight text tree instead of a heavy zip file. Your users can build the repo instantly.
Keywords: Directory tree generator, Project scaffolding, ChatGPT to folder structure, Text to filesystem, Golang CLI tool.
"I just want to create folders from ChatGPT, Gemini, or any AI."
- Copy the tree text from your AI chat.
- Open your terminal in the folder where you want the project.
- Run:
tr2rl build --clipboardWhat this does: It reads the text directly from your clipboard and instantly creates the real files and folders on your computer.
"I want to see what it will do BEFORE it creates files."
- Use the "Dry Run" flag:
- Run:
tr2rl build --clipboard --dry-runWhat this does: It shows you a preview list of every file that WOULD be created, but it does not touch your disk yet. Use this to be safe.
"I'm following a tutorial with a big file tree."
- Copy the tree text from the blog post or documentation.
- Run:
tr2rl build --clipboardWhat this does: It turns that static text diagram into a real starter project instantly.
"I have this messy text from a friend."
- Paste it into a file called
plan.txt. - Run:
tr2rl build plan.txtWhat this does: It reads the structure from the file
plan.txtinstead of the clipboard.
- πͺ Magic Parsing: Smartly understands Unicode trees (
βββ), ASCII trees (|--), Indented lists, and even messy, mixed-format text. - π οΈ Build & Populate: Creates directories and files instantly. Can auto-fill files with language-specific boilerplate (e.g.,
package mainfor Go). - π§Ή Refine & Format: Takes messy "napkin-sketch" text and formats it into a pristine, professional Unicode tree string.
- π‘οΈ Safety Preview: Use
--dry-runto see exactly what would happen before it touches your disk. - π Clipboard Mode: Build or format directly from your system clipboard. No temporary files needed.
- π Zero Dependencies: A single, static binary. Runs anywhere (Windows, macOS, Linux).
Here are some real-world commands to get you started.
Build a complex project structure from a file, verifying it first.
# Preview what will be created (Dry Run)
.\tr2rl.exe build testdata/grand_finale.tree --dry-run
# Actually create the structure
.\tr2rl.exe build testdata/grand_finale.treeWe've included production-ready architectures in the examples/ folder.
# Microservices with K8s & Docker
.\tr2rl.exe build examples/microservices-k8s.tree ./my-cluster --populate
# Next.js Fullstack (App Router, Tailwind, Supabase)
.\tr2rl.exe build examples/nextjs-fullstack.tree ./my-app --populate
# Python Data Science Project (Cookiecutter style)
.\tr2rl.exe build examples/data-science.tree ./analysis --populateCopy a tree from a chat window or website, then run:
.\tr2rl.exe build --clipboardTurn a messy text file into a clean, shareable tree diagram.
# Format a file
.\tr2rl.exe format testdata/grand_finale.tree
# Format text currently in your clipboard
.\tr2rl.exe format --clipboardbrew tap cytificlabs/tr2rl
brew install tr2rlscoop bucket add cytificlabs https://github.com/cytificlabs/scoop-bucket
scoop install tr2rlsnap install tr2rl
# Note: If not yet stable, try: snap install tr2rl --edgeGo to the Releases Page and download the file for your system.
git clone https://github.com/cytificlabs/tr2rl.git
cd tr2rl
go build -o tr2rl.exe .Parses input text and creates the corresponding directory structure.
Syntax:
tr2rl build [file] [output-dir] [flags]Flags:
--dry-run: Enable preview mode (do not write to disk). Default:false.--force: Overwrite existing files.--populate: Auto-fill created files with boilerplate content.--clipboard: Read input from clipboard instead of a file.
Reads messy input and outputs a clean, canonical Unicode tree. Great for documentation.
Syntax:
tr2rl format [file] [flags]Flags:
--style: Output format. Options:unicode(default) orascii.--clipboard: Read input from clipboard.
View built-in project templates to quick-start your development.
# List all templates
tr2rl template list
# Use a template (pipe it to build)
tr2rl template show react-vite | tr2rl build - ./my-app --dry-run=falsetr2rl is context-aware and handles "noisy" input.
| Style | Example Input |
|---|---|
| Unicode Tree | βββ src/ |
| ASCII Tree | ` |
| Indented List | src (just spaces) |
| Path List | root/src/main.go |
Contributions are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes
- Push to the Branch
- Open a Pull Request
If tr2rl saved you time, consider supporting the development!
- β Star this repo: It helps others find the tool.
- β Buy me a coffee: https://ko-fi.com/cosmicquark
- π£οΈ Share it: Tell your friends or tweet about it!
Distributed under the MIT License. See LICENSE for more information.