DEV Community

tikrack
tikrack

Posted on • Edited on

🔹 Peek: A Fast, Colorful, Tree-Based ls Alternative Built in Rust

Peek: A Fast, Colorful, Tree-Based ls Alternative Written in Rust

Have you ever wished that ls had more colors, better layout, or tree-like display built-in?

Let me introduce Peek — a blazing-fast, customizable ls replacement built in Rust, supporting:

  • ✅ Color configuration via command line
  • ✅ Tree-style file listings
  • ✅ File size and metadata output
  • ✅ Regex-style path filters (*.rs, **/src, etc.)
  • ✅ Persistent color settings
  • ✅ Cross-platform support (Linux and Windows)

🚀 Why Peek?

Peek was built out of frustration with ls limitations, and inspired by tools like exa, lsd, and the beauty of Rust's safety + performance.

It provides a developer-focused and theme-aware alternative to standard directory listing.


🛠 Features

  • peek — list current directory
  • peek -s or --size — show file sizes
  • peek -a or --all — include hidden files
  • peek -l or --long — show metadata (uid/gid/perm)
  • peek -t or --tree — display tree structure
  • peek -d 2 or --depth 2 — limit tree depth
  • peek -p "*.rs" — glob filtering
  • peek --set-folder-color "#FF8800" — persist folder color

And yes — the color persists across commands 😉


📦 Installation

🔧 Build from source

If you have Rust installed:

git clone https://github.com/tikrack/peek.git
cd peek
cargo install --path .
Enter fullscreen mode Exit fullscreen mode

Or just build manually:

cargo build --release
Enter fullscreen mode Exit fullscreen mode

✅ Cross-compile to Windows:

rustup target add x86_64-pc-windows-gnu
sudo pacman -S mingw-w64-gcc
cargo build --release --target x86_64-pc-windows-gnu
Enter fullscreen mode Exit fullscreen mode

📂 Example Usage

peek -a -t --depth 2 -p "**/*.rs"
Enter fullscreen mode Exit fullscreen mode

This will list all .rs files in tree format, including hidden files, up to 2 levels deep.


🖼 Screenshot

Peek CLI Demo


🧠 Tech Stack

  • Rust 🦀
  • clap for CLI parsing
  • walkdir for directory traversal
  • regex + globset for pattern matching
  • colored for styled output
  • dirs and serde_json for persistent config

📎 Repository

GitHub: github.com/tikrack/peek

Feel free to ⭐ star, fork, and contribute!


✨ Conclusion

Peek is a simple but powerful tool that aims to bring beauty, control, and clarity to your terminal experience.

If you're a Rust enthusiast or terminal nerd — give peek a try and share your thoughts!

I’d love feedback, ideas, or PRs. ❤️


🔗 Bonus

You can download releases for Linux and Windows directly from Releases


Thanks for reading 🙌
https://tikrack.ir

Top comments (0)