A simple Python CLI to print a
directory tree (like tree command), with support for depth limits,
hidden files, and excludes.
- 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
pip install gabbium-treeBasic:
gtree .Limit depth:
gtree . --max-depth 2Only directories:
gtree . --only-dirsExclude extra paths:
gtree . --exclude dist buildSave to file:
gtree . --output tree.txtOr with shell redirection:
gtree . > tree.txt- Cross-platform (Windows, macOS, Linux)\
- Prints with Unicode characters (fallback to ASCII if needed)\
- Defaults to ignoring common junk folders (
.git,node_modules,__pycache__)
~/my-project
├── src/
│ ├── app/
│ └── utils/
├── tests/
└── pyproject.tomlThis project is licensed under the MIT License -- see LICENSE for details.