Introduction¶
DeepSeek Harness (DSH) acts as a plugin host and provides extension capabilities for developers. When developing agents or debugging workflows, directly executing Shell commands is a common requirement. DSH itself does not provide a native terminal, and traditional approaches often require external tools or manual logging. The dsh-agent-shell plugin addresses the separation between command execution and result display by registering tools and building a UI drawer.
Plugin Overview¶
This is a client-side plugin maintained by PastSheep. It provides bash and cmd command execution tools for DSH and pushes the execution process of external pwsh through a loopback RPC channel to the Shell drawer on the right in real time. The plugin does not depend on a complex build process and can be used directly by loading it via the npm or file protocol.
Core Features¶
1. Bash / Cmd Tools¶
The plugin registers two tools:
* bash: Executes commands using Git Bash (D:\Program Files\Git\bin\bash.exe) and supports POSIX syntax. The configuration options include workdir (working directory), timeoutMs (timeout), and maxOutputBytes (output byte limit). Output exceeding the byte limit is truncated and written to an overflow file.
* cmd: Invokes cmd.exe /d /s /c to execute commands.
* pwsh observation: By listening to the tools/result event, it pushes external pwsh tool execution records to the drawer uniformly.
2. Shell Drawer¶
The plugin mounts a drawer component on the right side of DSH through front-end code. The drawer is collapsed by default, and each execution record includes the exit code, elapsed time, stdout, and stderr.
* Users can control the drawer state through the shell_drawer tool (list, open, close, toggle, remove, clear).
* The front end polls the /agent-shell RPC channel to retrieve incremental records.
3. Architecture and Communication¶
- Node side: Registers tools in
lib/index.js, establishes the/agent-shellRPC channel, and maintains an in-memory ring buffer (up to 200 records). - Browser side: Mounts via
slots.inject('shell.overlay')inlib/client.js. It prioritizes registering intodockPanels(requiresdsh-right-drawer); if not found, it falls back to a standalone overlay. - Communication mechanism: Uses
connection.rpc.call('/agent-shell', ...), providing the record stream only through local loopback permission.
Installation and Enabling¶
Before installing this plugin, ensure that the host environment has dsh-right-drawer installed.
- Install the required drawer host:
dsh plugin --profile web add @deepseek-ai/dsh-right-drawer
- Install the plugin:
dsh plugin --profile web add @deepseek-ai/dsh-agent-shell
-
Restart DeepSeek Harness. After installation, a vertical “Shell” tab appears on the right side. Click it to expand the drawer and start using it.
-
Uninstall:
dsh plugin --profile web remove @deepseek-ai/dsh-agent-shell
Typical Usage¶
Execute a Bash Command¶
Invoke the bash tool directly in a DSH conversation:
// 示例:在指定目录执行命令
{
"tool": "bash",
"arguments": {
"workdir": "C:/project",
"command": "ls -la"
}
}
Execute a Cmd Command¶
Use native Windows commands:
{
"tool": "cmd",
"arguments": {
"command": "dir /s"
}
}
Control the Shell Drawer¶
Manually manipulate the drawer content through the tool:
// 查看列表
{
"tool": "shell_drawer",
"arguments": { "action": "list" }
}
// 展开指定 ID 的记录
{
"tool": "shell_drawer",
"arguments": { "action": "open", "id": 1 }
}
Notes¶
- Dependency check: The plugin depends on
@deepseek-ai/dsh-toolsand related UI plugins. Ensure version compatibility. - Permissions and security: The plugin runs Shell commands with the permissions of the current dsh process. Be sure to review the source code and license before use.
- Environment requirements: The bash tool requires Git Bash to be installed on the system; the cmd tool requires a Windows environment.
Summary¶
The dsh-agent-shell plugin provides DeepSeek Harness with lightweight command execution capabilities and a visual result feedback mechanism. Through loopback RPC and ring buffer design, it achieves seamless integration of local command streams. This is a practical toolkit for developers who need to perform automated testing or debugging in DSH.
Plugin catalog: https://www.skillhub.cn/plugins/PastSheep/dsh-agent-shell
Source repository: https://github.com/PastSheep/dsh-agent-shell