MAXeaglet/dsh-bash-terminal 预览 preview

MAXeaglet/dsh-bash-terminal

Plugin插件 Native原生 ⭐ 22 MIT Dev Workflow开发与代码工作流

Project Overview项目介绍

dsh-bash-terminal is a native DSH plugin built exclusively for the DeepSeek Harness ecosystem. It works only on Windows, and lets users unify command execution across three different terminal environments: PowerShell, Git Bash, and Windows Subsystem for Linux (WSL). It adds an extra multi-terminal entry point that does not conflict with DSH’s built-in shell tool, and always follows the user’s pre-selected default terminal that AI models cannot alter. It supports both one-shot command execution and persistent interactive terminal sessions. To install the plugin the standard way, you first install the package globally via npm, then add it to your DSH profile, run the provided PowerShell install script, and restart the DSH web interface.

After installation, users can set their preferred default terminal through the DSH Web UI settings menu, under the General tab. When an AI model calls the shell tool to run a command, the command will automatically execute in the user-selected terminal environment. For interactive sessions, users can let AI open a persistent terminal session, send input, read output, send signals like Ctrl+C to interrupt running processes, and close the session when done. Interactive sessions retain state like current working directory, environment variables, and aliases across multiple calls, and WSL sessions let you specify a custom distribution if needed. This plugin is intended for DSH users on Windows who need alternate terminal environments beyond DSH’s default PowerShell.

This plugin is released under the open-source MIT license, and has several known limitations. It only works on the Win32 platform, and requires DSH version 0.1.5-rc.1 or newer. For interactive terminal sessions, PowerShell 5.1 cannot start properly via ConPTY, so users need to install PowerShell 7 to use interactive PowerShell sessions. For local development installations, you need to use directory junctions to link source to your DSH profile, and you should not run a regular npm install in the project directory as it will break dependency links. Git Bash is not compatible with DSH’s Windows ACL sandbox, so it runs with the same permissions as the DSH process, and WSL interactive sessions can occasionally trigger RPC errors.

dsh-bash-terminal 是专为 DeepSeek Harness (DSH) 开发的原生 Shell 工具插件,仅支持 Windows 平台,可统一在 PowerShell、Git Bash、WSL 三种终端环境执行命令。它不占用 DSH 自带的 Shell 能力接口,作为额外的多终端入口提供服务,支持一次性命令和持久化交互式终端会话两种模式,用户可在 DSH Web UI 的设置页预先选择默认终端,AI 模型无法更改该选择。

标准安装需要先全局 npm 安装包,再通过 DSH 插件命令添加到 profile,然后执行安装脚本修改配置白名单,最后重启 DSH Web 即可生效。本地开发安装通过目录 junction 直连源码,修改后可即时生效,注意不要在项目内直接运行 npm install,避免破坏依赖链接。本插件要求 DSH 版本不低于 0.1.5-rc.1。

本插件采用 MIT 许可开源,仅在 Windows 平台注册可用,存在部分已知限制:交互式终端中 PowerShell 5.1 无法在 ConPTY 启动,需安装 PowerShell 7;Git Bash 不兼容 DSH 的 Windows ACL 沙箱,权限与 DSH 进程一致;WSL 交互式会话偶发 RPC 错误。它支持后台任务管理,可启动、输出、终止后台任务,符合 DSH 原生工具行为规范。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 22 stars - an early-stage project星标 22,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-bash-terminal

把 MAXeaglet/dsh-bash-terminal 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-bash-terminal

🌐 English · 社区交流:LINUX DO · GitHub

test

DSH(DeepSeek Harness)插件:一个 shell 工具,在 Windows 上统一执行 PowerShell / Git Bash / WSL 三种终端命令。

后端 实际执行 语法 / 路径 环境变量
powershell(默认) pwsh -NoLogo -NoProfile -NonInteractive -Command <cmd> PowerShell;C:\... $env:NAME
gitbash Git for Windows bash -lc <cmd> POSIX;/d/WorkSpace;PATH 含 /usr/bin、/mingw64/bin $NAME
wsl wsl [-d <distro>] -e bash -lc <cmd> Linux;/mnt/d/... $NAME(经 WSLENV)

每次调用都启动全新 shell:不保留状态(cwd / 变量 / 别名)——请传 workdir 而不是用 cd。

设计要点

  • 终端由用户决定,AI 无法更改:Web UI 设置页(设置 → 通用)出现"默认终端"下拉(PowerShell / Git Bash / WSL);shell 工具永远只使用该设置,不暴露终端参数给模型。设置通过 DSH settings 系统持久化(settings.yaml)。
  • 不占用 ctx.shell 能力接缝:DSH 自带的沙箱化 pwsh 工具保持原样可用;本插件的 shell 工具是额外的多终端入口。
  • 通过共享的 ctx.subprocess seam 派生进程:进程树终止(Windows taskkill /T)、SIGTERM→grace→SIGKILL、输出 spill 文件,与官方 dsh-tool-bash / dsh-tool-pwsh 行为一致。
  • 后台任务注册进通用 jobs registry,支持 run_in_background / job_output / job_kill。
  • 前端设置页的「默认终端」是枚举(UI 自动渲染为下拉),模型每次调用都只按该设置执行,无法自行切换终端。

安装(web profile)

标准安装(npm 发布后,官方 bundle 机制)

插件带官方 dsh.bundle manifest(包内 cordis.patch.yml),profile 列出本包时 DSH 自动应用挂载,无需手改 profile 配置:

# 1. 安装插件包
npm install -g dsh-bash-terminal
dsh plugin --profile web add dsh-bash-terminal   # 自动加进 profile 的 bundles 并应用 patch

# 2. patch DSH 设置白名单(DSH 限制,见下方说明)
powershell -ExecutionPolicy Bypass -File install.ps1 install

# 3. 重启 dsh web

已用临时 profile 实测:bundles: [dsh-bash-terminal] → dump-config 自动出现 tool-bash-terminal entry。

本地开发安装(junction 直连,改源码即时生效)

# 1. 链接插件包到 profile 的 node_modules(junction,改源码即时生效)
$profile = "$env:USERPROFILE\.dsh\profiles\web"
New-Item -ItemType Junction -Path "$profile\node_modules\dsh-bash-terminal" -Target "D:\WorkSpace\projects\dsh-bash-terminal" | Out-Null

# 2. 让插件能解析 @deepseek-ai/* 依赖(junction 到 profile 的依赖树,插件与宿主共用同一份模块实例)
New-Item -ItemType Junction -Path "D:\WorkSpace\projects\dsh-bash-terminal\node_modules\@deepseek-ai" -Target "$profile\..\node_modules\@deepseek-ai" | Out-Null

# 3. 让 profile 通过官方 bundle 挂载插件(install.ps1 install 会自动做;等价于在 dsh.profile.bundles 加 "dsh-bash-terminal")
# 4. (仅修改前端源码后)重新打包 client bundle:
#    cd D:\WorkSpace\projects\dsh-bash-terminal && node scripts/build-client.mjs
# 5. 重启 dsh web

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-recommend 下一个 Next dsh-ros2 →