RP Tree is a simple and fast CLI tool to generate directory tree diagrams.
pip install rptreerptree [ROOT_DIR]If no directory is provided, the current directory is used:
rptreeShow help:
rptree -h-h,--helpShow help message-v,--versionShow version
-d,--dir-onlyShow directories only-f,--files-onlyShow files only
-df,--dirs-firstList directories before files-ff,--files-firstList files before directories
Alphabetical order is always applied as base sorting.
-n,--no-pipesRemove vertical pipes between branches
-i,--ignore PATTERN [PATTERN ...]Ignore files/directories-gi,--gitignoreRespect.gitignorerules
-dl,--depth-level NLimit depth
-o,--output-file FILESave output to file (Markdown format)
Basic:
rptreeDirectories first:
rptree . -dfFiles only:
rptree . -fLimit depth:
rptree . -dl 2Ignore entries:
rptree . -i node_modules dist .gitUse .gitignore:
rptree . -giNo pipes mode:
rptree . -nSave to file:
rptree . -o tree.mdproject/
│
├── src/
│ ├── main.py
│ └── utils.py
│
├── tests/
│ └── test_main.py
│
└── README.md
project/
├── src/
│ ├── main.py
│ └── utils.py
├── tests/
│ └── test_main.py
└── README.md
- Clean and readable tree output
.gitignoresupport- Custom ignore patterns
- Depth limiting
- Flexible sorting
- Optional compact mode (
--no-pipes)
- Fixed
--no-pipesbehavior - Fixed
.gitignoredirectory handling - Improved tree formatting (matches classic
tree) - Added modern packaging (
pyproject.toml)
- Added filtering and ordering options
- Added
.gitignoresupport - Added depth control
- Initial release
Leodanis Pozo Ramos
^RP Tree^ is distributed under the MIT license. See LICENSE for more information.