tree2-1.0.3 is not a library.
Tree2
A high-performance directory tree visualization tool written in Rust with colors, emojis, and gitignore support. Available as both CLI tool and library crate.

Features
- 🎨 Colorful Output: Beautiful colored output with emojis for better visualization
- 📊 File Sizes: Human-readable file sizes with color-coded values
- 🔒 Permission Handling: Gracefully handles permission denied errors
- 📋 Exclusion Support: Supports
.gitignorefiles and custom exclude patterns - ⚡ Blazing Fast: Optimized Rust implementation for maximum performance
- 📦 Library & CLI: Available as both command-line tool and Rust library
- 🦀 Memory Safe: Rust's safety guarantees ensure reliability
- 💻 Cross-Platform: Works on Windows, macOS, and Linux
Color Scheme
- Folders: Yellow (#FFFF00) with 📁 emoji
- Files: Cyan (#00FFFF) with 📄 emoji
- Size Values: Light magenta (red if size is 0)
- Size Units: Orange suffix
- Permission Denied: Red with 🔒 emoji
Installation
Method 1: Install from crates.io
Method 2: Install from source
Method 3: Build and run directly
Usage
Basic Usage
# Show current directory tree
# Show specific directory
With Exclusions
# Exclude patterns
# Using long form with space-separated patterns
Examples
# Typical Rust project directory
# With multiple exclude patterns
# Specific path with exclusions
Command Line Options
Usage: tree2 [OPTIONS] [PATH]
Arguments:
[PATH] Target directory [default: .]
Options:
-e, --exclude <EXCLUDE>... Exclude patterns or directory names
-h, --help Print help
-V, --version Print version
Output Example
📂 /home/user/project/
├── 📁 src/
│ ├── 📄 main.rs (12.45 KB)
│ └── 📄 lib.rs (0.00 B)
├── 📁 tests/
│ └── 📄 integration_test.rs (2.10 KB)
├── 📄 Cargo.toml (1.20 KB)
├── 📄 README.md (4.50 KB)
└── 🔒 [Permission Denied]
Library Usage
Add to your Cargo.toml:
[]
= "0.1.0"
Basic Example
use TreeBuilder;
Advanced Example
use ;
Project Structure
tree2/
├── Cargo.toml # Rust package manifest
├── LICENSE # MIT License
├── README.md # This file
└── src/
├── lib.rs # Library crate
├── main.rs # Binary crate
├── config.rs # Configuration structures
├── tree.rs # Tree generation logic
└── colors.rs # Color and styling utilities
Cargo.toml (for crates.io)
[]
= "tree2"
= "0.1.0"
= "2021"
= "A beautiful and feature-rich directory tree visualization tool with colors and emojis"
= ["Hadi Cahyadi <cumulus13@gmail.com>"]
= "MIT"
= "https://github.com/cumulus13/tree2"
= "https://docs.rs/tree2"
= "https://github.com/cumulus13/tree2"
= "README.md"
= ["tree", "directory", "filesystem", "visualization", "cli"]
= ["command-line-utilities", "filesystem"]
[]
= { = "4.0", = ["derive"] }
[]
= ["cli"]
= ["clap"]
[[]]
= "tree2"
= "src/main.rs"
[]
= ["x86_64-unknown-linux-gnu"]
Building from Source
Prerequisites
- Rust 1.60 or higher
- Cargo
Build Steps
# Debug build
# Release build
# Run tests
# Run benchmarks (if any)
Performance
The Rust version is optimized for performance:
- Zero-cost abstractions
- Minimal memory allocations
- Efficient directory traversal
- Lazy evaluation where possible
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Hadi Cahyadi
- Email: cumulus13@gmail.com
- GitHub: cumulus13
Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Contact: cumulus13@gmail.com
- Documentation: docs.rs/tree2
Enjoy blazing-fast directory visualization with Tree2 Rust! 🚀🦀
