--max-depth / -d¶
The --max-depth
flag limits how deep the tree will traverse into directories.
This is useful for large projects where you want a high-level overview without listing every nested file.
Usage¶
Example¶
Full tree (default)¶
├── 📁 src
│ ├── 📁 module1
│ │ ├── file1.py
│ │ └── file2.py
│ └── 📁 module2
│ └── file3.py
├── 📁 docs
│ └── readme.md
└── LICENSE
With --max-depth 1
¶
With --max-depth 2
¶
Tips¶
- Combine with
--count
or--size
for a summarized view of folders at each depth. - Combine with
--format md
to generate Markdown documentation for only the top levels of a project. - Useful for quick project overviews, documentation snapshots, or CI-friendly output.