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)