Skip to content

gabbium/tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gabbium-tree

A simple Python CLI to print a directory tree (like tree command), with support for depth limits, hidden files, and excludes.

✅ What it does

  • Prints a project folder structure in a clean tree format\
  • Supports options like:
    • --max-depth → limit tree depth\
    • --only-dirs → show only directories\
    • --exclude → skip specific directories (defaults: .git, node_modules, __pycache__, ...)\
    • --output → save output to file

📦 Installation

pip install gabbium-tree

⚙️ Usage

Basic:

gtree .

Limit depth:

gtree . --max-depth 2

Only directories:

gtree . --only-dirs

Exclude extra paths:

gtree . --exclude dist build

Save to file:

gtree . --output tree.txt

Or with shell redirection:

gtree . > tree.txt

🔑 Features

  • Cross-platform (Windows, macOS, Linux)\
  • Prints with Unicode characters (fallback to ASCII if needed)\
  • Defaults to ignoring common junk folders (.git, node_modules, __pycache__)

✅ Example output

~/my-project
├── src/
│   ├── app/
│   └── utils/
├── tests/
└── pyproject.toml

🪪 License

This project is licensed under the MIT License -- see LICENSE for details.

About

A simple Python CLI to print a directory tree

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages