retree π²
retree β a modern GNU tree-compatible utility for displaying directory structures.
Written in Rust. Optimized for Windows. Runs on Windows, Linux, and macOS.
π·πΊ Π ΡΡΡΠΊΠ°Ρ Π²Π΅ΡΡΠΈΡ
π― Why retree?
- β
GNU
treecompatibility - β‘ Parallel traversal (up to 6Γ faster on large trees)
- π¨
LS_COLORSandTREE_COLORSsupport - π€ Icons (Nerd Font / Unicode / ASCII)
- π¦ Export to JSON / XML / HTML
- πͺ Full NTFS support (ADS, junctions, long paths)
- π English and Russian interface
π¦ Installation
Binary releases
Download the prebuilt binary from GitHub Releases, extract it, and add to PATH.
Cargo
Build from source
The binary will be at target/release/rt.
π Release verification
Every release includes SHA256SUMS.txt with checksums, signed via Sigstore cosign.
Linux / macOS:
# Download the binary, SHA256SUMS.txt and SHA256SUMS.txt.bundle from Releases
# Verify checksum
# Verify signature (requires cosign)
Windows PowerShell:
# Verify checksum
() |
Note: β οΈ The Windows .exe is not yet Authenticode-signed. Use SHA256 + cosign verification to confirm integrity.
π Quick start
π‘ Note: For maximum typing speed in the terminal, the utility uses the short command
rt(adjacent keys on the keyboard).
# Show current directory
# Show hidden files
# Limit depth
# Directories only
# Colors and icons
# JSON output
# Pretty-printed JSON
# Parallel mode (auto-detect threads)
# Parallel mode with explicit thread count
π Usage
rt [OPTIONS] [PATH...]
Common options
| Flag | Description |
|---|---|
-a |
Show hidden files |
-d |
Directories only |
-L N |
Limit depth |
-P PATTERN |
Filter by glob |
-I PATTERN |
Exclude by glob |
-h |
Human-readable sizes |
-D |
Show modification date |
-J |
JSON output |
--json-pretty |
Pretty-printed JSON output |
-C |
Always use color |
--icons always |
Enable icons |
--parallel |
Parallel traversal |
--threads N |
Number of worker threads |
π Full documentation
- π CLI Reference
- π¨ Color configuration
- π€ Icons
- β‘ Performance
- βοΈ Configuration
- πͺ Windows specifics
- π οΈ Troubleshooting
β‘ Performance
retree uses Rayon (work-stealing), lazy metadata loading, optimized sorting, and streaming output.
Real benchmark results (median time, Criterion, release mode, Windows/NTFS, end-to-end):
| Files | Sequential | Parallel (auto) | Streaming |
|---|---|---|---|
| 100 | ~54 ms | ~14 ms | ~54 ms |
| 10 000 | ~5.3 s | ~861 ms | ~5.7 s |
| 100 000 | ~51.5 s | ~9.4 s | ~53.5 s |
| 1 000 000 | ~576 s | ~102 s | ~622 s |
πΎ Memory usage (PeakWorkingSet64):
| Files | Sequential | Streaming | Savings |
|---|---|---|---|
| 10 000 | 15.6 MB | 6.6 MB | 58% |
| 100 000 | 100.2 MB | 10.4 MB | 90% |
Parallel mode is effective starting at ~1 000 files (up to 6Γ speedup). Streaming mode does not build the tree in memory β 90%+ savings on large trees.
π‘ Tip: to quickly preview the first N entries of a large tree, use
--streaming --max-entries Nβ traversal stops immediately after outputting N entries. In standard mode, the full tree is built first, then truncated.
More details: π Benchmarks
π Comparison with GNU tree
| Feature | GNU tree | retree |
|---|---|---|
| Colors | β | β |
| JSON | β | β |
| XML | β | β |
| HTML | β | β |
| Parallel traversal | β | β |
| Icons | β | β |
| NTFS ADS | β | β |
| Junction points | β | β |
| Long paths | β | β |
| Streaming output | β | β |
| Multilingual UI | β | β |
πΊοΈ Roadmap
- Stable release on crates.io
- Config file (
~/.retreerc.toml) -
.gitignore/.treeignoresupport - Directory size aggregation (
--du) - Interactive mode
- Homebrew / Scoop / Winget packages
π€ Contributing
PRs and issues are welcome.
Details: π Development Guide
π License
Made with β€οΈ and π¦ Rust