Transparent drop-in replacements for grep and find that use the faster Rust alternatives (rg and fd).
LLM coding agents like Pi default to using grep and find because they're universal POSIX tools. But modern Rust alternatives like ripgrep and fd are significantly faster.
greprip solves this by providing grg and fnd commands that:
- Accept
grep/findsyntax - Translate arguments to
rg/fdequivalents - Execute the faster tool transparently
This gives you the speed benefits of modern tools without requiring the LLM to know about them.
# Install rg and fd (macOS)
brew install ripgrep fd
# Install greprip
uv tool install git+https://github.com/kaofelix/grepripAdd to ~/.pi/agent/settings.json:
{
"shellCommandPrefix": "grep() { grg \"$@\"; }; find() { fnd \"$@\"; };"
}Start a new session. Now when the agent runs grep or find, it transparently uses rg/fd.
Verify it's working:
type grep # Should show: grep is a function
grep --version # Should show: ripgrep X.X.X| Category | Flags |
|---|---|
| Basic | -i, -n, -v, -w, -l, -c, -o, -h, -H |
| Recursive | -r, -R (dropped - rg default) |
| Regex | -E (dropped - rg default), -F, -P |
| Context | -A NUM, -B NUM, -C NUM, -NUM |
| Patterns | -e PATTERN, -f FILE |
| Filters | --include=, --exclude=, --exclude-dir= |
| Output | --color, -q, -s |
| Category | Options |
|---|---|
| Name | -name, -iname |
| Type | -type f/d/l |
| Depth | -maxdepth, -mindepth |
| Output | -print, -print0 |
| Exclude | ! -name, -path ... -prune |
| Execute | -exec {} \;, -exec {} + |
| Symlinks | -L |
Without Pi integration, you can use the tools directly:
grg -ri "pattern" src/ # like: grep -ri "pattern" src/
fnd . -name "*.py" -type f # like: find . -name "*.py" -type fOr add shell aliases:
alias grep='grg'
alias find='fnd'fddoesn't include the search root directory in output (find does)fd -xruns commands in parallel by default (find -exec is sequential)
uv sync # Install dependencies
uv run pytest # Run unit tests (68 tests)
# Acceptance tests
GRG="uv run grg" ./tests/acceptance/test_grg.sh # 21 tests
FND="uv run fnd" ./tests/acceptance/test_fnd.sh # 11 testsMIT