A tool to create project structures from .tree files.
Project description
Tired of manually creating nested folders and empty files for new projects? Treef is a simple, powerful command-line tool that builds a complete directory structure from a single, human-readable .tree file.
It's perfect for bootstrapping projects, sharing boilerplate structures, and ensuring consistency across your team.
๐ณ Key Features
- Intuitive ASCII Tree Syntax: Define complex nested structures in a file that looks just like the output of the
treecommand. - Zero Configuration: Just create a
.treefile and run a single command. - Interactive Prompt: If multiple
.treefiles are found,treefprovides a clean, interactive prompt to choose which one to use. - Safe by Design: After successfully building the project, the definition file is automatically renamed from
.treeto.treefto prevent accidental re-runs. - Helpful Guidance: If no
.treefile is found,treefprovides a helpful "getting started" guide. - Blazingly Fast: Written in Python, it's lightweight and executes instantly.
๐ Quick Start
1. Installation
Install treef from PyPI using pip:
pip install treef
2. Create a .tree File
In a new, empty project directory, create a file named my_project.tree.
# my_project.tree
# A comment describing the project structure.
# Directories are marked with a leading or trailing slash.
/src
โโโ /api
โ โโโ /middleware
โ โโโ /routes
โ โโโ auth.routes.js
โ โโโ user.routes.js
โโโ /services
โ โโโ database.service.js
โโโ app.js
โโโ server.js
/tests
โโโ /unit
โโโ /integration
.env
.gitignore
package.json
README.md
3. Run the Command
Navigate to the directory containing your .tree file and run:
treef
4. See the Result
That's it! Your directory will now be populated with the structure you defined.
Generated Structure:
.
โโโ src/
โ โโโ api/
โ โ โโโ middleware/
โ โ โโโ routes/
โ โ โโโ auth.routes.js
โ โ โโโ user.routes.js
โ โโโ services/
โ โ โโโ database.service.js
โ โโโ app.js
โ โโโ server.js
โโโ tests/
โ โโโ unit/
โ โโโ integration/
โโโ .env
โโโ .gitignore
โโโ my_project.treef <-- Your file was automatically renamed!
โโโ package.json
โโโ README.md
โ๏ธ Command-Line Options
| Option | Description |
|---|---|
--verbose |
Enable detailed debug logging. |
--help |
Show the help message and exit. |
๐ค Contributing
Contributions are welcome! If you have a feature request, bug report, or want to improve the code, please feel free to open an issue or submit a pull request.
To set up a development environment:
- Clone the repository:
git clone https://github.com/rahebsaeed/treef.git - Create and activate a virtual environment.
- Install in editable mode:
pip install -e . - Install development dependencies:
pip install -r requirements-dev.txt - Run tests:
pytest
๐ License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
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 treef-0.1.0.tar.gz.
File metadata
- Download URL: treef-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b73a8497f0468280ef0e72fabd0667dcd023f871f1693361dad3c5d385f642d
|
|
| MD5 |
317cd2a3b94546c564e998d2d60ee6b5
|
|
| BLAKE2b-256 |
563f16bac5927a6ee3969ca3b9e1cb7391c235f204f162bd9ea63b3da6588eea
|
File details
Details for the file treef-0.1.0-py3-none-any.whl.
File metadata
- Download URL: treef-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4957d46c4a85db0ca93e350cde3bcf29cea803db64a19a25070d907a81fc2cfd
|
|
| MD5 |
d927f424bbb2b043706f124d376ea99b
|
|
| BLAKE2b-256 |
2db8390710cb9895a6933f89fb40c510d89e00096057c298c862c6e7d047f644
|