Skip to main content

CLI tool to create folder structures from tree input

Project description

Paste2Project

Paste your folder structure and generate the entire project instantly from the terminal.


Overview

Paste2Project is a lightweight CLI utility for Windows that converts a pasted folder tree structure 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 development scaffolding.


Features

  • Automatically creates nested folders
  • Instantly generates files from tree structure input
  • Supports standard tree-style syntax (├──, , └──)
  • Fast and lightweight
  • Smart indentation and hierarchy detection
  • Optimized for Windows CLI usage
  • Simple installation with minimal setup

Project Structure

f9/
├── f9.py
├── f9_Installer.bat
└── README.md

Installation

Clone the Repository

git clone https://github.com/forex911/paste2project.git
cd f9

Automatic Setup (Recommended)

Run the installer:

f9_Installer.bat

What the Installer Does

  • Copies project files to:
C:\Users\<your-user>\AppData\Local\f9
  • Creates the f9 command (f9.bat)
  • Safely adds the directory to the User PATH without truncation issues

Important

After installation, restart your terminal:

  • Command Prompt
  • PowerShell
  • VS Code Terminal

This ensures the f9 command is recognized properly.


Usage

Step 1: Run the Command

f9

Step 2: Paste Your Folder Structure

Example:

my-app/
├── src/
│   ├── index.js
│   └── app.js
├── public/
│   └── index.html
└── package.json

Step 3: Finish Input

Press:

CTRL + Z
ENTER

This signals the end of input in Windows.


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

Your project structure is now created instantly.


How It Works

The tool:

  • Reads pasted input line by line
  • Detects indentation and nesting levels
  • Uses a stack-based structure to track directories
  • Creates folders using Path.mkdir()
  • Creates files using Path.touch()

This ensures accurate recreation of the provided structure.


Common Use Cases

  • Quickly starting new projects
  • Recreating GitHub repository structures
  • Testing folder layouts
  • Competitive programming templates
  • Backend and frontend scaffolding
  • Rapid prototyping

Notes

  • Use proper tree structure formatting
  • Folder names should end with /
  • Avoid invalid file names
  • Restart terminal after installation

Troubleshooting

f9 Command Not Recognized

  • Restart the terminal
  • Ensure PATH contains:
C:\Users\<your-user>\AppData\Local\f9

Check using:

echo %PATH%

If missing, add it manually via Environment Variables.


PATH Truncation Issues

Avoid using:

setx PATH

This may truncate long PATH values.

Use the installer instead, which safely updates the registry.

Also remove broken entries such as:

C:\Users\<your-user>\AppDat

Command Works Only with Full Path

Example:

C:\Users\<your-user>\AppData\Local\f9\f9.bat

This means PATH is not configured correctly.

Add the folder to PATH manually or re-run the installer.


Permission Issues

  • Run terminal as Administrator if needed
  • Ensure write access to the target directory

Incorrect Structure Creation

Make sure the structure uses proper formatting:

  • ├──
  • └──

Folders should end with /

Avoid unnecessary spaces or invalid characters.


Nothing Happens After Paste

Ensure you finish input using:

CTRL + Z
ENTER

Without this, Windows will continue waiting for input.


Python Not Installed

Verify Python installation:

python --version

If Python is not installed, install it before running the tool.


Future Improvements

Planned enhancements include:

  • Linux support
  • macOS support
  • JSON and YAML input support
  • GUI version
  • VS Code extension
  • Template saving and reuse

Contributing

Pull requests and improvements are welcome.


Support

If this project is useful to you, consider giving it a star on GitHub.


Author

F9


License

MIT License

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

f9_paste2project-1.0.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

f9_paste2project-1.0.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file f9_paste2project-1.0.0.tar.gz.

File metadata

  • Download URL: f9_paste2project-1.0.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for f9_paste2project-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6de26459597683204cd9badb7cffd9ec6d75d8b5c7e055739f6b14be0afc99b5
MD5 9f73d89d19b267d8770117b40b950ebc
BLAKE2b-256 7e13ce8462ee9e2b9db01ba5ee7579fa6e0506b925b648f397919c93085102d3

See more details on using hashes here.

File details

Details for the file f9_paste2project-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for f9_paste2project-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22d4585ba596372d3e7114daad285344bd609af03e0e988fe770f94f41f658f1
MD5 c7e6ae33b904f18790c5a8ded066b3b1
BLAKE2b-256 20aae5d2e103db13f958c1ab2438fc6d4eb193048b695ca5c3e2f1c444942633

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