runrat
v0.3.1
Published
π Dev-tool scavenger & command translator β finds tools, validates commands, fixes LLM mistakes before they hit the shell.
Maintainers
Readme
π runrat
The dev-tool scavenger rat. Sniffs, hoards, remembers. Fixes commands before they break.
The problem
LLM coding agents (Claude, Copilot, Cursor) are OS-blind. They generate commands that work on the machine they were trained on β usually Linux with bash. On your actual machine:
Agent: apt-get install postgresql && pip install django && export SECRET=foo
User: β 'apt-get' is not recognized
β 'export' is not recognized
β pip uses wrong PythonThe agent doesn't know you're on Windows with PowerShell and scoop. It doesn't know flutter test needs --no-pub not --coverage. It doesn't know sudo doesn't exist here.
Every failed command costs you:
- Time (agent retries with another wrong command)
- Trust (you stop believing the agent can do anything)
- Sanity
The solution
Runrat sits between the agent and the shell. Before any command runs, runrat checks and translates it:
runrat check "apt-get install postgresql && flutter test --coverage"β‘ apt-get β scoop install (Windows has no apt)
β‘ && β ; if ($?) { } (PowerShell has no &&)
β --coverage β --no-pub (valid Flutter flag)
corrected: scoop install postgresql; if ($?) { flutter test --no-pub }How it works
Three knowledge files that grow over time:
| File | What it knows | Size |
|------|--------------|------|
| translation-rules.json | LLM mistake patterns β correct equivalents | 20 rules |
| tool-map.json | Where every tool lives (auto-discovered) | per machine |
| command-recipes.json | Correct CLI syntax and flags per OS | 28 recipes |
Install
# Full bootstrap
npx runrat
# Or via skills.sh
npx skills add k0r81/runratRestart opencode. The dev-runner subagent is now active.
CLI
runrat check "apt-get install foo" # Translate & validate any command
runrat setup # Bootstrap on this machine
runrat recipes # List all known command recipes
runrat rules # List active translation rulesExamples of what it fixes
| LLM writes | OS | Corrected to |
|-----------|-----|-------------|
| apt-get install X | Windows | scoop install X |
| apt-get install X | macOS | brew install X |
| brew install X | Windows | scoop install X |
| scoop install X | macOS/Linux | brew install X |
| cmd1 && cmd2 | Windows | cmd1; if ($?) { cmd2 } |
| export VAR=val | Windows | $env:VAR = "val" |
| pip install X | All | python -m pip install X |
| sudo npm -g X | macOS/Linux | npm install -g X |
| ls -la | Windows | Get-ChildItem |
| rm -rf dir | Windows | Remove-Item -Recurse -Force dir |
| python3 | Windows | python |
| which X | Windows | where.exe X |
| touch file | Windows | New-Item -ItemType File file |
| cat file | Windows | Get-Content file |
| grep foo | Windows | Select-String foo |
| flutter test | All | flutter test --no-pub |
| dart format . | All | dart format --set-exit-if-changed lib/ test/ |
Platforms
Windows (PowerShell + scoop), macOS (brew), Linux (apt/brew).
License
MIT
