Docs/Tools
Search: find & grep
gray find and gray grep answer from a resident, watcher-backed file index — the same answers as fd and rg, without the spawn cost.
Source: crates/gray/src/search.rs
Gray keeps a watcher-backed index per search root. gray find and gray grep answer from it when it can be exact, and fall through to fd and rg when it cannot. The contract: whatever fd or rg would have answered, these answer. The index is a faster way to ask the same question, never a different answer.
$gray find "*.rs"$gray find "crates/**/mod.rs" --limit 20$gray grep "fn main" crates --glob "*.rs"$gray grep -F "TODO(" --context 2$gray grep -i "error" # case-insensitive goes straight to rg
| Flag | find | grep |
|---|---|---|
| PATH | directory to search | file or directory |
| --limit N | max results (100) | max matches (100) |
| --glob GLOB | — | basename filter, e.g. *.rs |
| -i, --ignore-case | — | case-insensitive (served by rg) |
| -F, --literal | — | literal text, not regex |
| --context N | — | lines around each match |
The index declines — and rg answers — for a non-git directory, case-insensitive search, a negated or depth-anchored glob, an invalid pattern, or a single-file target. Inside a session the bash tool serves these commands in-process, so the agent pays nothing to spawn them.
Join the Discord
Chat with the people building and running Gray. Show what you made with it.
Join Discord →