Introduction¶
When running shell commands in DeepSeek Harness (DSH), output tends to be verbose and consumes context tokens. RTK can compress the output of common commands into a more compact form, but integrating RTK into DSH typically involves inheriting harness-internal PwshLocalExecutor / SandboxPwshExecutor, or pinning peer dependencies to a specific rc version—whenever DSH iterates, such plugins tend to break.
Below is a community plugin, dsh-rtk (maintainer: Piracola, category: workflow): it does not touch DSH internal modules. Instead, it rewrites simple commands into rtk <cmd> at the shell service’s resolve() boundary, while leaving the remaining semantics (working directory, timeouts, environment variables, sandbox, result format) to the original executor.
What This Is¶
dsh-rtk is a thin RTK integration for DeepSeek Harness. The npm package name is dsh-rtk-thin (version 0.2.0 in the current materials), licensed under MIT, requiring Node.js ≥ 20.
The plugin only injects the shell service and wraps its resolve(). Switching executors or platforms theoretically requires no plugin code changes; in the worst case, rewriting silently does not take effect, and commands still execute as-is.
Differences from Existing RTK Plugins¶
The author’s stated motivation is straightforward: most existing dsh RTK plugins extends harness-internal executor classes or lock specific rc dependencies. dsh-rtk does not import any DSH internal modules; it relies on three external contracts:
ctx.shellexposesresolve(request) -> spec, andspec.commandis a string.rtk rewrite <cmd>: on successful rewrite, stdout outputs the rewritten command; if no rewrite applies, stdout is empty. The plugin only recognizes “non-empty stdout that differs from the original command” and does not depend on exit codes (the README states the exit code is 0, but it has been observed as 3 in practice).- Platform blacklist: on Windows,
rtk ls/tree/pwd/wc/grepfail because they proxy Unix programs that do not exist there, so commands are not rewritten into these subcommands by default; the check applies to the rewritten subcommand. On Linux/macOS, setdenySubcommandsto[]to lift the restriction.
Installation and Activation¶
Install from GitHub (recommended; upgrading requires just one update command):
dsh plugin --profile web add github:Piracola/dsh-rtk
dsh plugin --profile web update dsh-rtk-thin # for future updates
For local development (changes take effect immediately without reinstalling):
dsh plugin --profile web add "link:<absolute path to this repo>"
It takes effect immediately after installation: if your local web profile uses patchReload: live, dsh plugin add appends dsh-rtk-thin to dsh.profile.bundles. The README’s actual testing shows no dsh restart is needed—run a git status and if the output becomes rtk’s compact format, it is working; if not, restart.
If the pnpm supply chain policy blocks installation (ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION, common when other packages in the lockfile were published less than 24 hours ago), you can temporarily relax it:
dsh plugin --profile web add --config.minimumReleaseAge=0 github:Piracola/dsh-rtk
Configuration¶
Insert the bundle configuration via a Cordis patch. Example (adjust paths and the blacklist as needed):
- insert:
- id: rtk-thin
name: dsh-rtk-thin
config:
rtkExe: C:\Users\you\.cargo\bin\rtk.exe # default: RTK_EXE env var → PATH
denySubcommands: [ls, tree, pwd, wc, grep] # default value; only effective on win32
If rtkExe is not set, it falls back to the RTK_EXE environment variable, then to rtk on the PATH.
Typical Rewrite Behavior¶
The README has been tested on Windows with rtk 0.49.0 / 0.50.0, which serves as a reference for expectations:
| Input | Result |
|---|---|
git status / cargo test / npm run build |
rtk git status / rtk cargo test / rtk npm run build |
cat package.json |
rtk read package.json |
find . -name *.md |
rtk find . -name *.md |
ls -la / pwd / wc -l x / grep -rn foo . / tree . |
unchanged |
git status \| grep x / a && b |
unchanged (contains shell metacharacters; avoids changing pipeline semantics) |
echo hello |
unchanged (rtk has no equivalent form) |
You can also test the rewrite logic without launching dsh (replace the path with the absolute path to your local repo):
node -e "import('file:///<repo-path>/index.js').then(m=>console.log(m.rewriteWithRtk('git status')))"
Use Cases and Notes¶
Who it’s for: Users already using DSH’s web profile (or other profiles that enable this plugin bundle), with RTK installed locally, who want simple shell commands executed by the agent to automatically go through rtk rewrite, but do not want to maintain plugins coupled to harness-internal executors.
Notes:
- The plugin runs with the permissions of the current dsh process; before installing, review the GitHub source code and the MIT license yourself to confirm it meets your security policy.
- Commands containing pipelines,
&&, or other shell metacharacters are deliberately not rewritten to avoid semantic changes. - Windows and Linux/macOS differ in the default value of
denySubcommands; adjust configurations accordingly when cross-platform development is needed. - The DSH community plugin directory (e.g., SkillHub) is an independent ecosystem site and has no official affiliation with DeepSeek / High-Flyer; the facts in this article are based on the repository README and
package.json.
Links¶
- Directory page: https://www.skillhub.cn/plugins/Piracola/dsh-rtk
- Source code and documentation: https://github.com/Piracola/dsh-rtk
Through the steps above, dsh-rtk connects RTK at the shell resolution boundary without modifying the harness’s internal implementation: simple commands that can be rewritten are automatically prefixed with rtk, while those that cannot or should not be rewritten remain as-is, making it a lightweight token-saving connector in workflows.