Generate full directory hierarchies instantly by pasting a tree diagram into your terminal.
Run this command to start the generator immediately:
Windows (PowerShell):
curl.exe -sL https://tinyurl.com/generate-structure -o gen.py; python gen.pymacOS / Linux:
curl -sL https://tinyurl.com/generate-structure | python3How to use:
- Open a terminal/powershell and navigate to the parent directory where you want your project created.
- Run the command.
- Paste your tree structure (e.g., from a prompt or documentation).
- Hit Enter twice (or type
ENDon a new line) to build.
When you run the command, the process follows this logic:
- Prompt:
PASTE STRUCTURE BELOW (Hit Enter twice or type 'END' to finish): - User Input (Example):
my-app/ ├── src/ │ └── main.py └── README.md - Action: Hit Enter twice.
- Output:
Created: my-app/Path: C:\Users\Username\Documents\my-app
- Instant Scaffolding: Detects the root folder name automatically from the first line of your paste.
- Robust Parser: Handles standard tree characters (
├,│,└) and 4-space indentation. - Zero Friction: No cloning or external dependencies required.
- Smart Cleanup: Automatically replaces existing folders of the same name for a fresh build.
- Cross-Platform: Compatible with Windows, macOS, and Linux.
To use the tool anytime by typing mktree:
Windows (PowerShell Profile):
function mktree {
curl.exe -sL https://tinyurl.com/generate-structure -o $env:TEMP\gen.py
python $env:TEMP\gen.py
}macOS / Linux:
alias mktree="curl -sL https://tinyurl.com/generate-structure | python3"- Pasting issues on Windows: If the terminal buffer cuts off your paste, ensure you type
ENDon a new line after pasting. - Permission Denied: Ensure you have write permissions for the directory where you are running the script.
- Python Version: Requires Python 3.6+.
Developed by iantolentino