Skip to main content

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 tree command

๐Ÿง‘โ€๐Ÿ’ป 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treel-1.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

treel-1.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for treel-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b2ad609b054be74e9407564e7c4041d83dc5c35213683f9bf06696743a0dfe12
MD5 647e2b9d5b996b7fb65d93c31fc4c23a
BLAKE2b-256 e92ac72c9289ee4bccf87e9620046d6d120431fd2550cd45c12af1c160499a1b

See more details on using hashes here.

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

Hashes for treel-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f44906208b0cfa3fd3d395dd1fc0dd4a19f5d9f2c0b01f7b443ae48685274a
MD5 e1793064c6038a35573caf63e0e30cf5
BLAKE2b-256 9dccc79b2d80631de532ee842b86218090e06c66708310ba83f11761476aa9c3

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