CLI tool to create folder structures from tree input
Project description
f9-Paste2Project
Paste your folder structure and generate the entire project instantly from the terminal.
Overview
f9-Paste2Project is a lightweight, cross-platform CLI utility that converts a pasted folder tree structure (like output from the tree command or AI-generated structures) into real files and directories on your system.
Instead of manually creating folders and files one by one, you can simply paste the structure and let f9 build the project for you automatically.
This is especially useful for quickly setting up new projects, recreating repository structures, testing layouts, and scaffolding your development environments.
Features
- Format Agnostic: Seamlessly handles clean Unix
treeoutput, Windowstree /foutput, and manually typed ASCII trees. - Multiple Input Methods:
- Interactive paste (stdin)
- Read from file (
-f structure.txt) - Read from clipboard (
-c)
- Safe & Reversible: Includes a
--dry-runmode to preview changes before they happen, and an--undoflag to quickly remove the last created structure. - Cross-Platform: Works flawlessly on Windows, macOS, and Linux.
Installation
Install directly from PyPI using pip (Recommended):
pip install f9-Paste2Project
Once installed, the f9 command becomes available globally in your terminal.
Usage
Interactive Mode
Run the command:
f9
Paste your folder structure (e.g., from ChatGPT, documentation, or a tree command):
my-app/
├── src/
│ ├── index.js
│ └── app.js
├── public/
│ └── index.html
└── package.json
Finish Input:
- On Windows: Press
CTRL + ZthenENTER. - On Linux/macOS: Press
CTRL + D.
Your project structure is now created instantly!
Advanced Commands
Usage:
f9 # Interactive mode: paste tree from stdin
f9 -f structure.txt # Read tree from a text file
f9 -c # Read tree directly from your clipboard
f9 --dry-run # Preview the structure without creating anything
f9 --undo # Remove the last created structure
f9 -o /some/base/dir # Output the structure to a specific base directory
f9 -q # Quiet mode (no per-item output)
f9 -v # Verbose mode (extra detail)
f9 --log output.log # Write execution log to a file
Example Output
DIR: my-app
DIR: my-app/src
FILE: my-app/src/index.js
FILE: my-app/src/app.js
DIR: my-app/public
FILE: my-app/public/index.html
FILE: my-app/package.json
How It Works
The tool:
- Reads text input line by line.
- Detects indentation and nesting levels (supports standard tree-style syntax
├──,│,└──). - Intelligently distinguishes between files and directories.
- Creates the physical folders and touches the files in their correct hierarchical locations.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file f9_paste2project-1.0.1.tar.gz.
File metadata
- Download URL: f9_paste2project-1.0.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1941711a092c7c1189aee93f0169d7bb9e281fa80e3d80c3b2a812bac779092b
|
|
| MD5 |
6e72b2db088f78eadc0439f0a95e0013
|
|
| BLAKE2b-256 |
87834af300c7c1ea33b5d1fa6e7d52c032e64715110e03e2a02ab3f1f3db0874
|
File details
Details for the file f9_paste2project-1.0.1-py3-none-any.whl.
File metadata
- Download URL: f9_paste2project-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cc8e1a14fa7f5d6e76184dc70fd274d28403d4d519acd8679f55ac1ced7aadc
|
|
| MD5 |
7e449f51bc475d44bfb6c4cf8838b161
|
|
| BLAKE2b-256 |
e86bf80a85f9f655342a113cd6dde5026434be5b5182a124ddb2ebe77143c0b5
|