dsh-rtk
DSH 的 Rust Token Killer 原生插件,通过官方工具执行钩子自动将 shell 命令重写为 RTK 过滤版本,在输出到达大模型上下文前进行压缩。
AI 分析
核心用于压缩工具输出以节省Token。适合需要频繁执行Shell命令并希望减少LLM上下文消耗的用户,需本地配置RTK二进制路径。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dd2673/dsh-rtk說明文件
閱讀完整 README ↗使用发布后的不可变 commit;首次安装会提示 pnpm 允许执行 prepare。
dsh plugin --profile demo add github:dd2673/dsh-rtk#
配置
| 键 | 类型 | 默认 | 说明 |
|---|---|---|---|
enabled | boolean | true | 插件总开关 |
announceToAgent | boolean | true | 是否向 Agent 宣告插件 |
rtkBin | string | rtk | RTK 二进制路径(可用绝对路径) |
askMode | 'rewrite' | 'passthrough' | rewrite | rtk rewrite 退出码 3(ask)时的处理 |
excludeCommands | string[] | [] | 前缀匹配、永不重写的命令 |
interceptedTools | string[] | ['pwsh'] | 被拦截改写的工具名 |
defaultTimeoutMs | number | 120000 | 模型未指定 timeoutMs 时的超时 |