A modern, feature-rich CLI tool to visualize directory trees.
Project description
๐ณ treel
treel is a modern, colorful, and fully featured Python CLI tool to visualize directory structures โ a smarter, customizable alternative to the classic Unix tree command.
It supports color-coded output, depth control, sorting, file sizes, hidden files, and exporting clean text reports โ all in one neat command.
๐ Features
โ
Limit folder depth โ show only what you need
โ
Include or hide files
โ
Show file sizes (KB)
โ
Sort by name, size, or modified time
โ
Export clean .txt output (no color codes)
โ
Toggle colors for terminal or automation scripts
โ
Cross-platform โ works on Windows, Linux, and macOS
โ
No dependencies except colorama
โ๏ธ Installation
You can install treel directly from PyPI:
pip install treel
๐ป Usage
Here are the most common ways to use it:
Basic directory tree
treel .
Limit tree depth to 2 levels
treel . -d 2
Include files as well
treel . -f
Show file sizes
treel . -f -s
Show hidden files too
treel . -a
Sort entries by size
treel . --sort size
Export a clean text version
treel . -f -o structure.txt
Disable colors (useful for CI/CD logs)
treel . --no-color
Check version or help
treel --version
treel --help
๐ง Example Output
๐ C:\Projects\MyApp
โโโ backend
โ โโโ app
โ โโโ tests
โ โโโ run.py
โ โโโ seed.py
โโโ frontend
โ โโโ src
โ โโโ public
โ โโโ index.html
โ โโโ package.json
โโโ README.md
๐งฐ Command Reference
| Flag | Description | Example |
|---|---|---|
-d, --depth |
Limit directory depth | treel -d 2 |
-f, --files |
Include files in the tree | treel -f |
-a, --all |
Show hidden files/folders | treel -a |
-s, --size |
Show file sizes in KB | treel -s |
--sort |
Sort by name, size, or time |
treel --sort size |
-o, --output |
Export to text file | treel -f -o tree.txt |
--no-color |
Disable color output | treel --no-color |
-v, --version |
Show version info | treel --version |
-h, --help |
Show help menu | treel --help |
๐ง Development
Clone the repository and install locally in editable mode:
git clone https://github.com/23f2005532/treel.git
cd treel
python -m venv .venv
.\.venv\Scripts\activate # (on Windows)
pip install -e .
Run the tool directly:
treel . -f -d 2
๐งฉ Project Structure
treel/
โโโ treel/
โ โโโ __init__.py
โ โโโ treel.py
โโโ setup.py
โโโ README.md
โโโ LICENSE
โโโ requirements.txt
๐ชด Example Use Cases
- Quickly visualizing project folder structure for documentation
- Generating clean, text-based directory trees for README files
- Inspecting codebases in CI/CD pipelines without GUI tools
- Lightweight alternative to the Linux
treecommand
๐งโ๐ป Author
Ehtesham
๐ฆ PyPI: treel
๐ GitHub: 23f2005532
๐ฌ Always open for collaboration & feedback!
๐ License
This project is licensed under the MIT License โ youโre free to use, modify, and distribute it with attribution.
๐ก Treel is built with simplicity and practicality in mind โ a small CLI that does one thing beautifully.
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 treel-1.1.1.tar.gz.
File metadata
- Download URL: treel-1.1.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2ad609b054be74e9407564e7c4041d83dc5c35213683f9bf06696743a0dfe12
|
|
| MD5 |
647e2b9d5b996b7fb65d93c31fc4c23a
|
|
| BLAKE2b-256 |
e92ac72c9289ee4bccf87e9620046d6d120431fd2550cd45c12af1c160499a1b
|
File details
Details for the file treel-1.1.1-py3-none-any.whl.
File metadata
- Download URL: treel-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1f44906208b0cfa3fd3d395dd1fc0dd4a19f5d9f2c0b01f7b443ae48685274a
|
|
| MD5 |
e1793064c6038a35573caf63e0e30cf5
|
|
| BLAKE2b-256 |
9dccc79b2d80631de532ee842b86218090e06c66708310ba83f11761476aa9c3
|