DSH Hub

DeepTrial/dsh-bash-rtk

dsh-bash-rtk

BundleWorkflow6 GitHub stars· updated 2026-08-16

DeepSeek Harness bash executor plugin that routes eligible commands through rtk (Rust Token Killer) to compress tool output and save tokens.

Install

npx @deepseek-ai/dsh plugin --profile web add "<path-to-this-dir>"

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-bash-rtk DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-bash-rtk.svg)](https://dshhub.dev/plugins/dsh-bash-rtk)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from DeepTrial/dsh-bash-rtk, cleaned of badges and images.

dsh-bash-rtk

Route eligible shell commands through rtk (Rust Token Killer) inside the DeepSeek Harness (dsh) bash executor — compress tool output, save tokens, change nothing else.

中文版


Table of Contents


Quick Example

The plugin rewrites commands at the resolve() boundary — before anything runs:

Input (command)Resolved outputReason
git statusrtk git statusSimple + whitelisted
cargo build --releasertk cargo build --releaseSimple + whitelisted
git status | grep xgit status | grep xComplex shell — passthrough
ls -lals -laNot whitelisted — passthrough
git status (rtk absent)git statusBinary missing — identity fallback

Everything else — workdir, timeout, env, exit code, sandbox confinement — is inherited unchanged.

Requirements

  • Node.js: >= 20.0.0
  • rtk: rtk --version must exit 0 on PATH (install separately, e.g. cargo install rtk)

Why

LLM agents burn tokens on verbose tool output (git log, cargo build, pytest trails…). rtk already knows how to shrink those for 30–90%. This plugin bolts that filtering onto dsh's bash executor so every eligible command is auto-routed through rtkwith zero semantic change to what actually runs.

How it works

model → dsh bash tool → RtkBashExecutor.resolve()
                              │
              ┌───────────────┴────────────────┐
         eligible?                         not eligible
     (simple + whitelisted)           (complex / unknown)
              │                                │
      rtk <subcommand> …              command runs unchanged
   (rtk compresses output)            (byte-for-byte passthrough)

Three independent guards decide (see src/wrap.ts):

  1. Complexity — any shell metacharacter (| & ; < > \ $`) disqualifies the command. Wrapping those would silently alter what runs, so they pass through untouched.
  2. Whitelist — only known dev tools that rtk actually implements are eligible (map in wrap.ts).
  3. Availability — if the rtk binary is absent on PATH, the transform is the identity: the deployment behaves exactly like the stock local executor.

Versioning note

The plugin does not bundle or pin rtk. At dsh startup it probes rtk --version on PATH (see resolveRtk() in src/index.ts). Therefore:

  • When rtk ships a new release, any user who upgrades rtk on their machine automatically gets the new behavior — no plugin update required.
  • The plugin version (this repo) and the rtk version are independent; keep them separate. This README states the minimum rtk version tested against, not a lockstep number.

Requires: rtk on PATH (rtk --version exits 0). The plugin does not install or manage rtk — you must install and update rtk yourself (e.g. cargo install rtk or download a release binary). When rtk is absent the plugin is a silent no-op passthrough.

Install & enable

Related plugins