The desktop profile of DeepSeek Harness (DSH) uses the native shell to execute commands by default, which can make tool output verbose and consume more tokens. dsh-pwsh-rtk-rewrite is a native rtk bridge plugin that replaces the desktop profile’s shell executor with an rtk rewrite subclass, transparently rewriting each pwsh command before execution.

This is a native rtk bridge plugin for DeepSeek Harness (DSH), maintained by mengqi1436. Through the rtk rewrite "<cmd>" mechanism, it converts shell commands that would otherwise be executed into rtk commands, saving tokens by leveraging rtk’s compact output format.

Core Features

  • Rewrite shell commands via rtk to save tokens: Convert standard tool calls into rtk calls and leverage its compact output format.
  • Preserve sandbox semantics: Rewrite only the command text without changing sandbox settings such as working directory and timeout.
  • Transparent rewriting: Invisible to callers; the command invocation logic remains unchanged.
  • Failure-safe fallback: If rtk rewriting fails (for example, no corresponding rtk command, rtk not installed, or a timeout), it automatically falls back to executing the native shell command without blocking execution.
  • Supports Windows + PowerShell: Supported only on the Windows platform with PowerShell.

Install and Enable

Prerequisites:
* DeepSeek Harness >= 0.1.7 (desktop edition)
* rtk >= 0.50.0
* Windows + PowerShell operating system

Install command:

dsh plugin --profile desktop add dsh-pwsh-rtk-rewrite@1.1.3 --registry=https://registry.npmjs.org/

After installation, restart the desktop application to load the new code.

Typical Usage

The plugin automatically rewrites input pwsh commands:

  • git status -> rtk git status
  • cat E:\CLI\dsh-web.log -> rtk read E:\CLI\dsh-web.log

For compound commands, the plugin rewrites them by segment:

  • "cat a.log; git status; grep -c x b.log" -> "rtk read a.log; rtk git status; rtk grep -c x b.log"

Notes

  • Dependency chain resolution issue: In v1.1.3, the plugin fixed dependency chain resolution issues in the desktop environment, ensuring it loads correctly in the desktop application.
  • Environment limitation: Limited to Windows + PowerShell environments; not applicable to Linux or other shells.
  • Exit code semantics: The exit code of rewritten commands is determined by rtk and may differ from that of the native command.

Summary

dsh-pwsh-rtk-rewrite uses a transparent rewriting mechanism to automatically enable rtk’s compact output mode when DSH invokes tools in a Windows + PowerShell environment, saving tokens while preserving sandbox semantics and failure safety.