RTK integration
The rtk extension rewrites compatible Bash tool calls to use the Rust Token Killer binary. Selesai reuses a valid system installation or provisions a verified managed binary, reducing noisy command output without changing Selesai’s own rewrite behavior.
Bundled with Selesai
Loaded automatically with Selesai; no per-extension npm install is required.
Setup and prerequisites
- The extension is bundled with Selesai and provisions the pinned RTK release into Selesai’s managed binary directory when no usable system binary is available.
rtkmust report version0.23.0or newer (rtk rewritewas introduced in0.23.0).- Selesai also runs
rtk gainto reject the unrelated Rust Type Kit binary that uses the same command name. - Set
PI_OFFLINE=1to prevent downloads; the extension then remains disabled if no valid RTK binary is available.
What it sets up
- Reuses a valid system
rtkor downloads the pinned official release into Selesai’s managed binary directory with checksum verification. - Probes
rtk --versionandrtk gainat extension load time and bails out if the binary is missing, unrelated, or too old. - Registers a
tool_calllistener that intercepts Bash tool calls and delegates command rewriting tortk rewrite. - Applies the rewritten command only when
rtk rewriteexits0or3and returns a non-empty stdout that differs from the original command.
What you can configure
RTK is managed by Selesai when needed. The extension rewrites commands when a verified rtk binary is available and not disabled.
No user configuration
This capability does not expose user-editable settings. Its behavior is controlled by the commands and runtime rules documented below.
Command, tool, and shortcut controls
| Key / path | Description |
|---|---|
automatic bash rewrite | Transparent; no user command required. |
RTK_DISABLED=1 | Set this environment variable to disable RTK command rewriting and managed installation for the session. |
PI_OFFLINE=1 | Set this environment variable to disable startup network operations, preventing managed binary downloads. |
Source evidence
src/extensions/rtk.tsRTK source
What you can do
- Start Selesai normally; it provisions RTK when needed. Compatible
bashtool calls are rewritten automatically. - Set
RTK_DISABLED=1before launching Selesai to bypass the rewriter and managed installation. - Set
PI_OFFLINE=1to run without network provisioning. - Inspect the rewritten command in the tool output if the model asks for the exact shell behavior.
Commands, tools, and shortcuts
There are no slash commands, tools, or shortcuts. The extension only rewrites Bash tool calls.
| Mechanism | Description |
|---|---|
rtk rewrite <cmd> | External subprocess that returns a quieter equivalent or signals no rewrite. |
| Bash tool call hook | Intercepts bash tool calls before execution. |
Limits and safety
- Only
bashtool calls are rewritten; other tools are untouched. - Commands that already start with
rtkare skipped to avoid recursion. - Rewrites are advisory: if
rtk rewriteexits with an unexpected code, times out after 2 seconds, or throws, the original command runs unchanged (fail-open). - The extension does not add new tools or change model behavior; it only mutates the command string passed to Bash.
- Selesai does not run
rtk init; its own Pi hook handles command rewriting and avoids duplicate RTK configuration.