jgrep
grep for what code does, not what it's called.
Gate PRs on it. Run only the tests a diff can affect.
jgrep "catches an error and silently ignores it" src/

No index. No embeddings. No LLM round-trips. A whole src/ tree in ~2 s for about a cent.
On five OSS repos, --tests picked 12% of the test files and still caught over 90% of the
tests each commit's author changed, for $0.11 across 60 commits (bench).
Not @dzhng/jevgrep (jg), a separate code-discovery CLI.
This project is jgrep, published on npm as jevgrep.
Why
| you want to find… | grep / rg | embeddings | an LLM | jgrep |
|---|
| an exact name or string | ✅ instant | meh | 🐢 $$ | use grep |
| "code that swallows errors" | ❌ | ❌ fuzzy | ✅ slow | ✅ 2 s |
| "endpoint with no auth check" in my diff | ❌ | ❌ | ✅ $$ | ✅ ¢ |
| needs an index / vector DB | no | yes | no | no |
jgrep runs on Jev, through TypeSafe or
OpenRouter, a System One model: it never
generates text, it answers typed yes/no questions with calibrated
probabilities, in parallel, at $0.042 per million input tokens with output free.
jgrep packs 16 code chunks and 16 questions into one request and turns the
probabilities into file:line hits.
Install
npm i -g jevgrep # installs the `jgrep` command
jgrep init # paste a TypeSafe or OpenRouter key, pick where to keep it, done
jgrep init verifies the key against the API, stores it with chmod 600,
and optionally teaches Claude Code / Codex to use jgrep. Get a key at
console.typesafe.ai, or use an OpenRouter key
(openrouter.ai/keys); see Other endpoints.
No credits yet? An OpenRouter key works the same (Other endpoints),
and jgrep --estimate ... shows what a run would cost before spending anything.
Prefer not to run init?
export TYPESAFE_API_KEY=... # env
echo 'TYPESAFE_API_KEY=...' >> .env # per project
mkdir -p ~/.config/jgrep && echo 'TYPESAFE_API_KEY=...' > ~/.config/jgrep/env # global
export OPENROUTER_API_KEY=sk-or-... # or an OpenRouter key
Other endpoints
Got Jev through OpenRouter instead of TypeSafe? Set OPENROUTER_API_KEY
(sk-or-... — jgrep init detects it) instead of TYPESAFE_API_KEY; jgrep
sends requests to OpenRouter's System One endpoint with the matching model
id. Answers are cached by logical model name, so results are shared with the
TypeSafe endpoint. Requests to openrouter.ai also carry OpenRouter's
app-attribution headers (HTTP-Referer, X-OpenRouter-Title and its older alias
X-Title, both jgrep, X-OpenRouter-Categories: cli-agent) so jgrep appears in its app rankings;
no other endpoint gets them.
export OPENROUTER_API_KEY=sk-or-...
jgrep "reads a CSV file" src/
JGREP_ENDPOINT overrides the URL for either key — point it at a local stub
for tests or CI, without touching typesafe.ai or openrouter.ai:
export TYPESAFE_API_KEY=test-key JGREP_ENDPOINT=http://127.0.0.1:8765
jgrep "reads a CSV file" src/
JGREP_MODEL overrides the model id, so any server that speaks the System One
protocol works, including local ones. A loopback JGREP_ENDPOINT needs no key:
export JGREP_ENDPOINT=http://127.0.0.1:11434/v1/systemone JGREP_MODEL=nimble # e.g. Ollama
jgrep --tests HEAD~1
Answers are cached per model id, so switching models never reuses another
model's answers. jev-latest is an alias TypeSafe moves to each new release, and
cached answers stay with the alias: delete ~/.cache/jgrep after a move, or pin a
version with JGREP_MODEL=jev-1.14.0 (on OpenRouter, typesafe/jev-1.14).
Use
Find code by behavior