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.
Release files for treef 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| treef-0.1.0.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| treef-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.7 kB
Release files / treef-0.1.0.tar.gz
| Download URL | treef-0.1.0.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b73a8497f0468280ef0e72fabd0667dcd023f871f1693361dad3c5d385f642d
|
|
BLAKE2b-256 checksum How to use checksums |
563f16bac5927a6ee3969ca3b9e1cb7391c235f204f162bd9ea63b3da6588eea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / treef-0.1.0-py3-none-any.whl
| Download URL | treef-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4957d46c4a85db0ca93e350cde3bcf29cea803db64a19a25070d907a81fc2cfd
|
|
BLAKE2b-256 checksum How to use checksums |
2db8390710cb9895a6933f89fb40c510d89e00096057c298c862c6e7d047f644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|