A grep-like text search tool that highlights matches instead of filtering lines. Built in Rust for speed and reliability.
Unlike traditional grep which hides non-matching lines, crepe shows you the full context with matches beautifully highlighted in color. Perfect for reading logs, searching code, and understanding data in context.
- π Multiple pattern highlighting - Each pattern gets a different color
- π Full regex support - All the power of Rust's regex engine
- β‘ Parallel processing - Automatically uses all CPU cores for multi-file searches
- π Smart file discovery - Respects .gitignore, filters by patterns, skips binaries
- π― Context-aware - Show lines before/after matches (like grep's
-C) - π Multiple output modes - Normal, count-only, only-matching, inverted
- π§ Highly configurable - But simple by default
Download the latest release for your platform:
Linux (amd64)
curl -L https://github.com/brunoribeiro/crepe/releases/latest/download/crepe-VERSION-linux-amd64 -o crepe
chmod +x crepe
sudo mv crepe /usr/local/bin/macOS (Apple Silicon/ARM)
curl -L https://github.com/brunoribeiro/crepe/releases/latest/download/crepe-VERSION-macos-arm64 -o crepe
chmod +x crepe
sudo mv crepe /usr/local/bin/macOS (Intel)
curl -L https://github.com/brunoribeiro/crepe/releases/latest/download/crepe-VERSION-macos-intel -o crepe
chmod +x crepe
sudo mv crepe /usr/local/bin/Replace VERSION with the latest version number (e.g., 0.1.0) from the releases page.
git clone <repository-url>
cd crepe
cargo install --path .The crepe binary will be installed to ~/.cargo/bin/.
cargo run -- [OPTIONS] -e PATTERN [FILE...]# Highlight all occurrences of "error" in a file
crepe -e "error" app.log
# Case-insensitive search
crepe -i -e "warning" app.log
# Multiple patterns with different colors
crepe -e TODO -e FIXME -e HACK src/
# Search recursively through a directory
crepe -r -e "function" src/# Show line numbers and 2 lines of context
crepe -n -C 2 -e "fn main" src/
# Count matches in all Rust files
crepe -r -c --include "*.rs" -e "struct" .
# Search hidden files, exclude node_modules
crepe -r --hidden --exclude "node_modules/*" -e "import" .
# Only show the matched parts (not full lines)
crepe -o -e "\d+\.\d+\.\d+" CHANGELOG.md
# Show lines that DON'T match the pattern
crepe -v -e "debug" app.log
# Match whole words only
crepe -w -e "cat" file.txt # matches "cat" but not "concatenate"
# Limit to first 10 matches
crepe -m 10 -e "error" large-file.log# Email addresses
crepe -e "\w+@\w+\.\w+" contacts.txt
# IP addresses
crepe -e "\d+\.\d+\.\d+\.\d+" server.log
# Function definitions in JavaScript
crepe -e "function \w+\(" src/*.js
# Hexadecimal colors
crepe -e "#[0-9a-fA-F]{6}" styles.css-e, --regexp PATTERN- Specify multiple patterns (can be used multiple times)-i, --ignore-case- Case-insensitive matching-w, --word-regexp- Match whole words only-v, --invert-match- Show lines that DON'T match
-n, --line-number- Show line numbers-o, --only-matching- Show only the matched parts-c, --count- Show only count of matching lines-A NUM- Show NUM lines after each match-B NUM- Show NUM lines before each match-C NUM- Show NUM lines before and after each match
-r, --recursive- Search directories recursively--include GLOB- Only search files matching pattern (e.g.,*.rs)--exclude GLOB- Exclude files matching pattern--hidden- Search hidden files and directories--max-depth NUM- Maximum directory depth--follow- Follow symbolic links--binary- Search binary files (skipped by default)
-H, --with-filename- Show filename with output--no-filename- Don't show filename--heading- Group output by filename
-m, --max-count NUM- Stop after NUM matches-j, --jobs NUM- Number of threads (default: auto)
--color WHEN- When to use colors (auto/always/never)--no-color- Disable colors
Crepe is built with a modular architecture:
- Pattern matching: Uses Rust's
regexcrate for fast, reliable regex - Highlighting: Terminal colors via
coloredcrate - 12 colors that cycle for multiple patterns - File discovery:
ignorecrate for gitignore support,walkdirfor traversal - Parallelization:
rayonfor automatic multi-core processing - CLI parsing:
clapfor robust argument handling
Each pattern gets a unique color in this order:
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- Bright Red
- Bright Green
- Bright Yellow
- Bright Blue
- Bright Magenta
- Bright Cyan
After 12 patterns, colors cycle back to the beginning.
| Feature | grep | crepe |
|---|---|---|
| Filter non-matching lines | β (default) | β Shows all lines |
| Highlight matches | β (--color) | β (default) |
| Multiple pattern colors | β One color | β Different color per pattern |
| Parallel processing | β | β Automatic |
| Respects .gitignore | β | β Automatic |
| Binary file detection | β | β |
| Context lines | β | β |
| Regex support | β | β |
Use grep when: You want to filter and reduce output Use crepe when: You want to see everything with highlights
# Run tests
cargo test
# Run with debug output
cargo run -- -e pattern file
# Build release version
cargo build --release
# Run linter
cargo clippy
# Format code
cargo fmt# Highlight different log levels in different colors
crepe -e ERROR -e WARN -e INFO app.log# Find all TODO/FIXME/HACK comments in your codebase
crepe -r -n -e TODO -e FIXME -e HACK src/# Find all uncommented lines in a config file
crepe -v -e "^#" config.conf# Extract all URLs from a file
crepe -o -e "https?://[^\s]+" document.txtBuilt by Claude (Anthropic) - An AI assistant that writes production-quality code.
This entire tool, from architecture to implementation to documentation, was created through an interactive conversation with Claude. The result is a well-structured, tested, and fully-functional Rust application built in minutes.
This project is provided as-is for educational and practical use.
Feel free to open issues or submit pull requests!
- Built with β€οΈ and Rust π¦
- Powered by industry-standard crates: clap, regex, rayon, ignore, colored
- Inspired by grep, ripgrep, and the need for better context in search results