@4rcadia/opencode-rtkOpenCode plugin that proxies shell commands through rtk to reduce LLM token consumption.
3
37
近 7 天 10
29.5
生态多维模型
3 个月前
2026-05-13
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@4rcadia/opencode-rtk@0.1.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@4rcadia/opencode-rtk@0.1.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @4rcadia/opencode-rtkopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
rtk (Rust Token Killer) proxies and filters shell commands to condense their output (less LLM token consumption). E.g., rtk git diff returns the same information with less formatting and noise. This OpenCode plugin automatically proxies supported shell commands through rtk without any extra prompting or instructions for the LLM.
Installation
Install
rtkAdd the following (or similar) to your OpenCode config file:
// opencode.json { "$schema": "https://opencode.ai/config.json", "plugin": [ "@4rcadia/opencode-rtk@latest" ] }
How It Works
The plugin intercepts OpenCode bash tool calls and rewrites supported shell commands so they run through rtk first. Unlike a regular rtk installation, using this plugin requires no extra prompting or instructions to the LLM.
The plugin is syntax-aware. It analyzes commands with unbash and tree-sitter. Complex, piped, nested commands can be handled gracefully.
Supported shells:
bashzshpowershell
Caveat
The model is not aware that commands are being proxied. There is a risk that the model may be confused if rtk fails and returns an error. However, it is observed that most mid to large models can self-correct by retrying with the command's absolute path (e.g., /usr/bin/ls instead of ls).
Use with discretion.
A standalone no_rtk_bash tool was once considered but not eventually implemented, as extra tool registration would take up more context window and might be excessive just to handle rtk's occasional failures.'