# rtk Rewrites Pi `bash` tool calls through RTK. ## Install / load Loaded through the root `pi-ext` package. See [../../README.md](../../README.md). Requires `rtk >= 0.23.0` on `PATH`. If missing or old, the extension prints one warning and stays idle. ## Commands / tools / settings Pi commands: none. Pi tools: none. Pi hooks: - `tool_call`: watches builtin `bash` calls and may replace `input.command` with `rtk rewrite` output. Pi settings: none. Env vars: ```text RTK_DISABLED=1 ``` Prefix one command with `RTK_DISABLED=1` to bypass rewriting. ## UI The bash tool widget is the indicator. When RTK applies, Pi shows the rewritten `rtk ...` command. ## Behavior `rtk` does one thing: 1. probes `rtk --version` on extension load 2. warns once and registers nothing if `rtk` is missing or too old 3. ignores non-bash tools 4. ignores empty, already-`rtk`, and disabled commands 5. calls `rtk rewrite ` with a 2s timeout 6. applies exit `0` and `3` rewrites 7. locally maps missing `journalctl`, `systemctl status`, `hyprctl clients`, and `ps` filters to `rtk summary` 8. leaves other exit `1`, exit `2`, timeouts, errors, and empty output untouched No prompt injection. No status widget. No command gating. No output compaction. No shell-specific helpers.