Skip to main content
Treef Logo

treef

Effortlessly scaffold project structures from simple text trees.

PyPI Version Python Versions License Build Status Test Coverage

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 tree command.
  • Zero Configuration: Just create a .tree file and run a single command.
  • Interactive Prompt: If multiple .tree files are found, treef provides 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 .tree to .treef to prevent accidental re-runs.
  • Helpful Guidance: If no .tree file is found, treef provides 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:

  1. Clone the repository: git clone https://github.com/rahebsaeed/treef.git
  2. Create and activate a virtual environment.
  3. Install in editable mode: pip install -e .
  4. Install development dependencies: pip install -r requirements-dev.txt
  5. 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)

Source distribution for treef 0.1.0
File Size Uploaded
treef-0.1.0.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for treef 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page