A CLI tool for generating a clear, hierarchical view of a file system.
Project description
๐ณ File-System Tree Viewer
A lightweight command-line tool for generating a clear, hierarchical view of a file system โ combining the familiarity of the Unix tree command with rich colorization, glob-pattern exclusions, directory depth control, and cross-platform flexibility.
๐ Table of Contents
๐ Features
- ๐ Recursive tree output for viewing nested directories and files.
- ๐ Adjustable depth to limit how many directory levels are shown.
- ๐ซ Pattern exclusion to hide items using glob patterns (
*.pyc,venv). - ๐จ Colorization support with named colors and 24-bit RGB.
- โจ Bold tree branches for enhanced readability in the terminal.
- ๐ Directory-only mode to omit files from the view.
- ๐พ File export support to save your tree as a
.txtfile. - โ Cross-platform for Windows, macOS, and Linux.
๐งฉ Installation
Install via pip:
pip install file-system-tree-viewer
Or clone manually:
git clone https://github.com/RoyEshel/file-system-tree-viewer.git
cd file-system-tree-viewer
pip install .
๐ป Usage
After installation, run the CLI command:
fs-tree [OPTIONS]
Example:
fs-tree --root-dir . --exclude "*.pyc" "node_modules" "*-env" --dir-color red --file-color 255,255,0 --output-path output/tree.txt
๐ ๏ธ Options
| Option | Description | Default |
|---|---|---|
--root-dir |
Root directory from which the tree traversal begins | . |
--depth |
Maximum number of directory levels to show, including their contents (0 = show all levels) |
0 |
--exclude |
Space-separated list of glob patterns to exclude files or directories by name | None |
--dirs-only |
Show only directories | False |
--indent |
Number of spaces per indentation level | 4 |
--bold |
Use bold box-drawing characters for branches | False |
--dir-color |
Color for directory names | None |
--file-color |
Color for file names | None |
--output-path |
Directory or .txt file path for writing the tree output instead of printing to the terminal |
None |
๐จ Color Options
Directory and file names can be colorized using either:
-
Named colors:
black,red,green,yellow,blue,magenta,cyan,white -
RGB values in the form
R,G,B(no quotes needed):
Example:--file-color 255,128,0
Note:
Colorization is disabled automatically when writing output to a file.
Some terminals may not support 24-bit RGB sequences.
๐ชต Example Output
project-root
โโโ src
โ โโโ main.py
โ โโโ utils
โ โโโ helpers.py
โโโ tests
โ โโโ test_main.py
โโโ README.md
โ๏ธ License
This project is licensed under the GNU General Public License v3 or later.
See the LICENSE.txt file for details.
๐ง๐ปโ๐ป Maintainer
Roy Eshel
๐ GitHub: RoyEshel
๐ฌ Preferably contact via GitHub Issues for questions, bug reports, or feature requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file file_system_tree_viewer-1.0.0.tar.gz.
File metadata
- Download URL: file_system_tree_viewer-1.0.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d6285e26e75c5af7df1aa7ee9299af7d3e67f18b48828cf4f6d2e30ff37a03a
|
|
| MD5 |
6349de398aa1066877e495912be0077e
|
|
| BLAKE2b-256 |
5aa1e0aba9133f15091170e8bc10b6e1076b1037352e5ee7a1a1c2aa8822b7dd
|
File details
Details for the file file_system_tree_viewer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: file_system_tree_viewer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94295b0f92f2d80b7d7ff51ab60006b696d5cec46448f57165938072a11bd66
|
|
| MD5 |
e749ad205e26d92ebf97fdfe50cce654
|
|
| BLAKE2b-256 |
28cf966bc07a1e6ca9236d76b69822a27d7866ff2339aef95ffd432bb1022da6
|