| Crates.io | treee |
| lib.rs | treee |
| version | 0.1.1 |
| created_at | 2025-06-07 12:22:30.97685+00 |
| updated_at | 2025-06-07 12:24:09.150476+00 |
| description | A fast tree command with gitignore support and flexible filtering |
| homepage | https://github.com/Latias94/treee |
| repository | https://github.com/Latias94/treee |
| max_upload_size | |
| id | 1703960 |
| size | 28,842 |
A high-performance tree command-line tool written in Rust, featuring gitignore support and flexible filtering capabilities.
cargo install treee
git clone https://github.com/yourusername/treee.git
cd treee
cargo install --path .
# Display tree structure of current directory
treee
# Display specific directory
treee /path/to/directory
# Limit display depth
treee -L 3
# Show hidden files
treee -a
# Show only .rs files
treee --include "*.rs"
# Exclude target directory and .lock files
treee --exclude "target" --exclude "*.lock"
# Use filename pattern matching
treee --pattern "*.toml" --pattern "*.md"
# Show directories only
treee --directories-only
# Show files only
treee --files-only
# Disable gitignore rules
treee --no-git-ignore
# By default, .gitignore rules are automatically applied
treee # Automatically excludes files in gitignore
# Display full paths instead of tree format
treee --full-path
# Disable colored output
treee --no-color
Usage: treee [OPTIONS] [PATH]
Arguments:
[PATH] Directory to traverse [default: .]
Options:
-L, --depth <DEPTH> Maximum depth to traverse [default: 10]
-a, --all Show hidden files
--no-color Don't use colors
-d, --directories-only Show directories only
-I, --include <INCLUDE_PATTERNS> Include paths matching these glob patterns (can be used multiple times)
-E, --exclude <EXCLUDE_PATTERNS> Exclude paths matching these glob patterns (can be used multiple times)
-P, --pattern <FILE_PATTERNS> File name patterns to match (glob patterns, can be used multiple times)
--no-git-ignore Disable gitignore rules
-f, --files-only Show only files (opposite of --directories-only)
--full-path Print full paths instead of tree format
-h, --help Print help
-V, --version Print version
treee --include "*.rs" --full-path
treee --exclude "target" --exclude "node_modules" --exclude "*.lock"
treee --pattern "*.toml" --pattern "*.json" --pattern "*.yaml"
treee -L 5 --directories-only
treee --exclude "target" --include "*.rs" --include "*.toml" --depth 3
treee uses efficient file system traversal algorithms and parallel processing, delivering excellent performance on large codebases. Compared to traditional tree commands, it provides richer filtering options and better Git integration.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License