Skip to main content

CLI tool to generate a directory tree view of your project

Project description

🌳 tree-it

Python License: MIT Platform Status

A simple and flexible CLI tool to generate a visual representation of your project's directory tree — with support for advanced ignore rules (like .gitignore).

Generate a clean overview of your folder structure in seconds.


🔧 Features

  • Output a tree view of any directory
  • Control the depth of the tree with a --depth option (0, 1, ..., or full)
  • Ignore folders, files or patterns (e.g. *.log, folder/, folder/*)
  • Show folder names without listing their content
  • Export result to a readable .txt file
  • Works on any OS with Python 3

📦 Installation

Install from PyPI:

pip install tree-it

Or clone the repository:

git clone https://github.com/Damien-Bureau/tree-it.git
cd tree-it

🚀 Usage

treeit [path] [options]

Options

Option Description
path Root directory to scan (default: current folder)
-o, --output Output file (default: tree.txt)
-d, --depth Max depth (0, 1, ..., or full)
--ignore [patterns...] Ignore rules (see examples below)

🎯 Ignore Patterns

Pattern Meaning
folder/ Completely ignore folder and its content
folder/* Keep folder in tree, ignore its content
*.ext Ignore all files with that extension
file.txt Ignore a specific file

✅ Examples

# Show tree up to depth 2, ignoring node_modules entirely
treeit -d 2 --ignore node_modules/

# Ignore all .log files and only the content of frontend/node_modules
treeit --ignore *.log frontend/node_modules/*

📄 Output example

my-project/
├── backend/
│   └── node_modules/  (content ignored)
├── frontend/
│   ├── assets/
│   └── App.jsx
├── .gitignore
└── README.md

🔒 License

MIT — free to use, modify and share.
Feel free to contribute or suggest improvements!

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

treeit_cli-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

treeit_cli-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file treeit_cli-1.0.0.tar.gz.

File metadata

  • Download URL: treeit_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for treeit_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f0fe5102a82224cc75dc823f68a732c847ff3064a73fc4267f1a91a36d05d350
MD5 636c814728f44eff38141544f8630b41
BLAKE2b-256 5e83ed4ad96ce89caefa1098d034363040daadaca6eed00b9d62fff41b3c4a1b

See more details on using hashes here.

File details

Details for the file treeit_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: treeit_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for treeit_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 832a5ffa6a77d98cec85807433699165f0df57865d56fda56adbe9ad06ee1882
MD5 203780a332669734c82a985e81c30bb0
BLAKE2b-256 18e69c02b29d2e2d8a653ef4a01a743d11c3eda084e258560a7924d2db5871fc

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