dsh-rtk-plugin
v0.2.0
Published
RTK (Reusable Token Kompressor) tool for DeepSeek Harness — token-optimized CLI proxy exposing read/ls/git/grep/err/test/json and more through the standard shell sandbox.
Downloads
100
Maintainers
Readme
dsh-rtk-plugin
RTK (Reusable Token Kompressor) tool for DeepSeek Harness — a high-performance CLI proxy that filters and compresses command output before it reaches the model context, saving substantial tokens.
This bundle exposes RTK as a model-facing rtk tool through the standard
ctx.shell capability seam, so every call inherits the harness's sandbox
policy, timeout handling, and cancellation exactly like the native bash
tool.
What the tool does
The model (and you, via @) gets one tool, rtk, that runs any RTK
subcommand with token-optimized output:
| Subcommand | Use |
| --- | --- |
| read <file> | Read a file with intelligent filtering (-n line numbers, -m N max lines, --tail-lines N, -l minimal\|aggressive) |
| ls / find | Compact directory listing / file finding |
| git <args> | Compact git output (status, log, diff, branch…) |
| grep / rg | Compact search, grouped by file |
| err -- <cmd> | Run any command, show only errors/warnings |
| test -- <cmd> | Run tests, show only failures |
| json <file> | Compact JSON (-d depth, --keys-only for structure only) |
| deps | Summarize project dependencies |
| diff / log / wc | Condensed diff / deduplicated logs / compact counts |
| smart <file> | 2-line technical summary of a file |
| summary -- <cmd> | Heuristic summary of command output |
Plus wrappers for tree, gh, glab, aws, psql, pnpm, docker, kubectl, jest,
vitest, prisma, tsc, next, lint, prettier, cargo, npm, npx, ruff, playwright,
dotnet, wget, env, curl, format.
The tool's command parameter takes the subcommand without the leading
rtk (e.g. read -n -m 50 package.json, git status, err -- npm run
build).
Prerequisites
- RTK installed and on the
PATHthe shell executor uses (brew install rtk/rtk --versionto check). If it lives elsewhere, see Configuration.
Install
Into a profile (recommended — survives restarts):
dsh plugin --profile web add dsh-rtk-plugin # from npm (once published)
dsh plugin --profile web add /path/to/dsh-rtk-plugin # from a local checkoutThen restart dsh web (or the profile's host) for the composition to pick
up the new bundle row.
Uninstall / disable
dsh plugin --profile web remove dsh-rtk-pluginOr disable just the row in the profile's cordis.patch.yml:
- id: rtk
disabled: trueDefault routing (enforced)
By default (guardBash: true) every single bash command whose first word
maps 1:1 to an RTK wrapper (grep, rg, ls, cat→read, git, wc,
find) is denied at the tools/guard layer. The denial message tells the
model to retry through the rtk tool:
Route 'grep' through the rtk tool ... Retry as rtk command 'grep …'
Compound or piped commands (|, &&, ;, `, $(, >, <, () and
multi-line scripts are exempt — RTK cannot wrap them, so they run raw.
Explicit opt-out: when the model really needs raw output, it appends a shell comment that the guard checks for:
grep pattern file.txt # no-rtk # or: # rawEither marker lets the call through.
Configuration
The bundle row accepts options via the profile's cordis.patch.yml:
- id: rtk
name: 'dsh-rtk-plugin'
config:
rtkPath: /opt/homebrew/bin/rtk # default: 'rtk' (PATH resolution)
guardBash: true # default: true — set false to keep rtk opt-inNotes and limitations
rtk gain(savings history) may fail under a file sandbox because its tracking DB lives outside the session workspace — expected, not a tool bug.- RTK output is already token-optimized; avoid piping it through additional filters.
- Non-zero exits are reported as
[exit code: N]markers; sandbox denials as[sandbox: file access denied under <mode> mode]— the same vocabulary as the native bash tool.
Development
npm test # smoke tests (no harness needed)Pure JavaScript, no build step — index.js is the published source.
