The doctor verb
rf doctor [path] [--json]
doctor reports the environment a search will run in, so a surprising result
can be explained rather than guessed at.
What it reports
engine— the linked in-process engine (theignorewalker andgrepsearcher), confirming there is no subprocess in the hot path.git_repo— whetherpathis inside a git work tree.ignore_mode— whether.gitignore/.ignorerules are active here.recommended_action— a short next step.
The context-flip it catches
.gitignore rules apply only inside a git work tree. The exact same corpus
searched in a plain scratch directory and in a real repository can return
different results, because outside a repo ripgrep does not honor .gitignore at
all.
This is the trap doctor exists to surface. An agent that validates a query in
a temporary directory and then runs it against a real project may silently get a
different answer. doctor makes the active mode explicit before you rely on a
result.
Example
rf doctor . --json
{
"ok": true,
"data": [{
"rf_version": "0.0.4",
"engine": "in-process (ignore + grep crates)",
"path": ".",
"git_repo": true,
"ignore_mode": "gitignore-ACTIVE (git work tree; ignore files applied)",
"recommended_action": { "…": "…" }
}]
}
Outside a repo, ignore_mode reads gitignore-INACTIVE (not a git repo; ignore files not applied) — your cue that results here will not match those from
inside the repository.