- Accueil
- Plugins
- Outils et capacités
- dsh-shell
Q
dsh-shell
qianwenxue1/dsh-shell
dsh-shell for DeepSeek Harness: runs cmd / PowerShell commands on Windows (and bash-like shells on POSIX) with a bash-inspired safety model — timeouts, output truncation, exit codes, background jobs and a cwd allowlist
Installer
dsh plugin --profile web add github:qianwenxue1/dsh-shellREADME
dsh-shell
A DeepSeek Harness (DSH) plugin that lets the model run cmd and PowerShell commands on Windows — with the safety model of the standard
bashtool.
Why
The stock bash tool of many agents fails on Windows (subprocess-local: terminal inspection is unsupported on platform win32). dsh-shell registers a shell_exec tool that understands Windows natively:
cmd.exe /d /s /c ...by defaultpowershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ...sh/bashfallback on Linux/macOS hosts
It mirrors the bash tool's safety contract:
| Feature | Behavior |
|---|---|
| Persistent cwd | cd persists across calls (per session, on disk) |
| Timeout | per-command timeout ms, capped by maxTimeout |
| Output truncation | per-stream maxOutputBytes cap with a marker (head + tail kept) |
| Exit codes | exit_code, timed_out, stdout, stderr, truncated |
| Background jobs | background: true returns a job_id; poll with shell_job_status |
| Denylist | refuses rm -rf /, format, drive-wide del/rd, shutdown, registry/service deletes |
| cwd allowlist | stays inside the session workspace unless allowAnyCwd |
Install
npm
dsh plugin --profile web add @qianwenxue1/dsh-shell
build soure
# from npm after publishing
dsh plugin --profile web add @qianwenxue1/dsh-shell
# or from a local checkout
git clone https://github.com/qianwenxue1/dsh-shell.git
cd dsh-shell
pnpm install
pnpm build
dsh plugin --profile web add .
Config
- id: dsh-shell
config:
stateDir: .dsh-shell # per-session state under the workspace
defaultShell: cmd # cmd | powershell
maxTimeout: 600000 # ms hard cap
maxOutputBytes: 30720 # per-stream cap (head + tail kept)
allowAnyCwd: false # true to allow cd/commands outside the workspace
allowDangerous: false # true to bypass the denylist
Tools
shell_exec
Run a command in the persistent shell.
{ "command": "dir /b", "shell": "cmd" } // simplest
{ "command": "Get-ChildItem -Name", "shell": "powershell" } // PowerShell cmdlets
{ "command": "npm test", "timeout": 180000, "background": true } // long-running
shell_job_status
Poll a background job:
{ "job_id": "job-1710000000000-abc123" }
Development
pnpm install
pnpm build
pnpm verify
License
MIT