@4fu/pi-bin-hints
v0.1.3
Published
Detect installed modern Unix-tool replacements (rg, fd, sd, ...) once per session and inject a single stable line into pi's system prompt
Downloads
503
Maintainers
Readme
pi-bin-hints
Detect installed modern Unix-tool replacement binaries (rg, fd, sd, bat, …) once per session and inject a single stable line into pi's system prompt:
Modern Unix-tool replacement binaries available on this machine: rg/fd/sd/bat/...Why
Models default to grep/find/sed/cat even when faster modern replacements are installed. Telling the model exactly which of these binaries exist steers it to the better tool — without the model having to probe PATH itself.
What it does
- On
session_start, scansPATHdirectly (no subprocess spawning — a few milliseconds) for a curated list of ~30 candidates:rg,fd/fdfind,sd,bat/batcat,eza/exa/lsd,delta,jq,yq,fzf,xh,hyperfine,dust,duf,procs,btm,zoxide,doggo,gping,hexyl,choose,sad,ast-grep,broot,tokei,watchexec,glow. - Caches the result and appends the same constant line to every turn's system prompt via
before_agent_start. - Injects nothing at all when no candidate binary is found.
Prompt stability
Detection runs exactly once per session. The injected line is constant, so the rendered system prompt is byte-identical across turns — no prompt-cache invalidation, no per-turn probing, no prompt churn. Binaries installed mid-session are picked up on the next session start.
Cross-platform
- Windows:
PATHEXT-aware name matching (rg.exe,fd.cmd, …). - macOS / Linux: exact name match plus executable-bit check.
Installation
With pi:
pi install npm:@4fu/pi-bin-hintsOr link locally for development:
pi config set extensions./path/to/bin-hintsDevelopment
npm install
npm run typecheckNo build step — pi loads src/index.ts directly.
License
MIT
