████████╗██████╗ ███████╗██╗ ██╗
██╔══╝██╔══██╗██╔════╝╚██╗██╔╝
██║ ██████╔╝█████╗ ╚███╔╝
██║ ██╔══██╗██╔══╝ ██╔██╗
██║ ██║ ██║███████╗██╔╝ ██╗
╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
Tree Explorer - a beautiful, fast directory tree viewer for your terminal
- Colorful output - directories, files, and symlinks each have distinct colors
- Smart sorting - alphabetical by default, with
--dirs-first/--files-first - Pattern filtering - show only files matching a glob pattern (e.g.
*.zig) - File sizes - human-readable sizes (B, K, M, G) with
--size - Hidden files - toggle visibility with
--all - Depth control - limit traversal with
--depth N - Unicode - use
--unicodefor Unicode box-drawing charcters - No dependencies - single binary, zero runtime deps
- Fast - written in Zig for native performance
- Cross-platform - Linux, Windows, macOS
./my-project
├── src/
│ ├── components/
│ │ ├── Button.zig [2.1K]
│ │ └── Modal.zig [4.8K]
│ ├── utils/
│ │ └── fmt.zig [1.2K]
│ └── main.zig [8.4K]
├── build.zig
└── README.md
2 directories, 6 files (16.5K total)
Download the latest binary for your platform from Releases:
| Platform | File |
|---|---|
| Linux x86_64 | trex-linux-x86_64 |
| Linux arm64 | trex-linux-arm64 |
| Windows x86_64 | trex-windows-x86_64.exe |
| Windows arm64 | trex-windows-arm64.exe |
| macOS x86_64 | trex-macos-x86_64 |
| macOS arm64 | trex-macos-arm64 |
Linux / macOS:
chmod +x trex-linux-x86_64
sudo mv trex-linux-x86_64 /usr/local/bin/trexWindows: Place trex-windows-x86_64.exe somewhere in your %PATH% and rename it trex.exe.
Requires Zig 0.13.0.
git clone https://github.com/Windneiro/trex.git
cd trex
zig build -Doptimize=ReleaseSafe
./zig-out/bin/trexCross-compile for all platforms:
# Linux / macOS
chmod +x build-all.sh && ./build-all.sh
# Windows
build-all.batBinaries are placed in ./dist/.
trex [OPTIONS] [PATH]
PATH defaults to the current directory if omitted.
| Flag | Short | Description |
|---|---|---|
--help |
-h |
Show help message |
--version |
-v |
Show version |
--depth N |
-d N |
Max traversal depth |
--all |
-a |
Show hidden files and directories |
--dirs-only |
-D |
Show only directories |
--size |
-s |
Show human-readable file sizes |
--pattern GLOB |
Filter files by pattern (e.g. *.zig) |
|
--dirs-first |
List directories before files | |
--files-first |
List files before directories | |
--full-path |
Print absolute path for each entry | |
--no-color |
Disable ANSI colors | |
--unicode |
Use Unicode box-drawing charcters | |
--count |
Show summary counts only |
# Explore current directory
trex
# Explore a path with max depth 2
trex /home/user/projects -d 2
# Show all files (including hidden) with sizes
trex . -a -s
# Directories only, dirs listed first
trex . -D --dirs-first
# Filter only Zig source files
trex src --pattern *.zig
# Clean output for scripts (no color, ASCII lines)
trex . --no-color --ascii
# Quick count summary
trex /var --counttrex/
├── src/
│ └── main.zig main source file
├── build.zig Zig build configuration
├── build-all.sh cross-compile script (Linux/macOS)
├── build-all.bat cross-compile script (Windows)
└── README.md
The default optimize mode is ReleaseSafe (safe optimizations + bounds checking).
For maximum performance:
zig build -Doptimize=ReleaseFastCross-compilation uses Zig's built-in support - no external toolchain required.
MIT - see LICENSE
Made with Zig by Windneiro