A fast, concurrent file search tool written in Go - like grep, but concurrent and easier to use.
β¨ Concurrent Search - Uses worker pools for fast parallel file searching
π― Case-Insensitive Search - Optional -i flag for case-insensitive matching
π¨ Colorized Output - Beautiful colored output (can be disabled)
π Configurable Workers - Adjust concurrency with -w flag
π‘οΈ Smart Filtering - Automatically skips binary files, hidden directories, and common paths like node_modules
β‘ Fast & Efficient - Handles large directory trees with configurable file size limits
π Graceful Shutdown - Handles Ctrl+C interrupts cleanly
git clone https://github.com/carlomunguia/grape.git
cd grape
go build -o grape ./grapego install github.com/carlomunguia/grape/grape@latest# Search for "TODO" in current directory
./grape TODO
# Search for "error" in specific directory
./grape error ./src# Case-insensitive search
./grape -i "hello" .
# Use 20 concurrent workers
./grape -w 20 "func main" .
# Disable colored output
./grape --color=false "import" .
# Verbose mode
./grape -v "package" .
# Combine flags
./grape -i -w 20 -v "error" ./logsUsage: grape [--workers WORKERS] [--ignore-case] [--verbose] [--color] SEARCHTERM [SEARCHDIR]
Positional arguments:
SEARCHTERM text to search for
SEARCHDIR directory to search (default: current directory)
Options:
--workers WORKERS, -w WORKERS
number of concurrent workers [default: 10]
--ignore-case, -i case-insensitive search
--verbose, -v show verbose output
--color, -c colorize output [default: true]
--help, -h display this help and exit
grape uses a concurrent worker pool pattern:
- Discovery Phase - Recursively traverses directories and adds files to a work queue
- Worker Pool - Multiple workers pull files from the queue and search concurrently
- Smart Filtering - Skips binary files, large files (>10MB), and common excluded paths
- Results Display - Matches are displayed as they're found
Directory Discovery β Work Queue β Worker Pool β Results Channel β Display
- Concurrent workers can be tuned based on your system (default: 10)
- Binary file detection prevents wasting time on non-text files
- UTF-8 validation ensures clean output
- Line length limits prevent memory issues with malformed files
- Smart directory filtering skips
.git,node_modules, and hidden directories
- Go 1.25.3 or higher
./grape "func " ./myproject./grape -i todo ../grape -w 50 "error" /var/logs./grape -v "import" .path/to/file.go[42]:matching line content
With colors enabled:
- π’ Green - File paths
- π‘ Yellow - Line numbers
- βͺ White - Line content
grape/
βββ grape/ # Main application
β βββ main.go # Entry point and orchestration
βββ worker/ # File searching logic
β βββ worker.go # Search implementation
βββ worklist/ # Thread-safe work queue
β βββ worklist.go # Queue implementation
βββ go.mod # Module dependencies
βββ README.md # This file
go build -o grape ./grapego test ./...Contributions are welcome! Please feel free to submit a Pull Request.
See LICENSE file for details.
Carlo Munguia
grape - Picking the ripest results from your codebase, one search at a time! Cultivating concurrent searches with vine-tastic performance. π