A Python implementation of the tree command, designed for Windows but compatible with other platforms. It provides a feature-rich command-line utility to recursively list directories in a tree-like format.
uv tool install tree-py-shisotree-py [options] [directory]| Flag | Description |
|---|---|
-L <level> |
Max display depth of the directory tree. |
-d |
List directories only. |
-a |
All files are listed (including hidden files). |
-f |
Print the full path prefix for each file. |
-i |
Makes tree not print the indentation lines. |
-h |
Print the size in a human readable way. |
-p |
Print the file type and permissions. |
-C |
Turn colorization on always. |
-I <pattern> |
Do not list files that match the given pattern. |
-P <pattern> |
List only those files that match the pattern. |
--prune |
Prune empty directories from the output. |
--dirsfirst |
List directories before files. |
Project Overview:
tree-py -L 2 -I "node_modules|__pycache__" --dirsfirstFind specific files:
tree-py -P "*.json" --pruneFlat list with full paths:
tree-py -i -f