zimzaza4/dsh-bash-win 预览 preview

zimzaza4/dsh-bash-win

在Windows环境中为DeepSeek Harness提供Git Bash与WSL 2 bash工具,包含bwrap沙箱、审批模式与后台任务功能。

Project Overview项目介绍

This is a native Cordis plugin built exclusively for DeepSeek Harness (DSH) running on Windows systems. It adds two new executable command tools, git_bash and wsl_bash, to DSH, which by default disables native bash tools on Windows and only ships PowerShell out of the box. The plugin spawns bash.exe for Git Bash or wsl.exe for WSL2 directly via the DSH ctx.subprocess API, bypasses Windows restricted token layers, and implements a custom sandbox and approval system for all command execution.

The plugin follows a layered security model for all command execution. By default, commands run with full user permissions without a sandbox, but for WSL2 users, you can enable a bwrap sandbox that marks system directories as read-only and only allows write access within the current workspace. Approval prompts are only triggered when you explicitly enable the require_approval flag or when a command attempts out-of-bounds access, following DSH’s official escalation approval workflow. It also supports timeouts for foreground tasks and background job management, and command output is capped at 256 KiB before being truncated and written to a spill file.

The plugin is published on npm, and you install it using DSH’s official dsh plugin command targeted to your specific DSH profile. After installation completes, you must fully restart DSH for the plugin to load correctly. You can customize the paths to your Git Bash and WSL executables, as well as your default WSL distribution, with configuration that follows a priority order of plugin config > environment variables > automatic detection. The plugin is open source under the MIT license, and relies on core DSH tool packages provided by the DSH host environment.

这是一款专为 Windows 平台 DeepSeek Harness(DSH)开发的原生 Cordis 插件,为 DSH 新增了 git_bash 和 wsl_bash 两个工具。它解决了 DSH 在 Windows 上默认禁用原生 bash 工具、仅提供 PowerShell 的问题,通过 ctx.subprocess 直接启动 bash.exe 或 wsl.exe,绕开受限令牌层,同时内置自定义沙箱和审批机制。

插件提供分层安全模型,默认无沙箱全权限运行,WSL 模式下可启用 bwrap 沙箱限制系统目录只读、仅工作区可写。仅在显式开启审批要求或越界访问后触发升权审批请求,遵循 DSH 官方审批流程,支持前台任务超时终止和后台任务管理,输出收集到内存,超限自动写入溢出文件。

插件发布在 npm,可通过 DSH 官方 dsh plugin 命令按 profile 安装,安装后需重启 DSH 生效。支持自定义 bash/WSL 路径和 WSL 发行版,定位优先级为插件配置>环境变量>自动探测,采用 MIT 许可证开源,依赖 DSH 宿主提供的核心工具包。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 12 stars - an early-stage project星标 12,属于早期项目
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 @zimzaza4/dsh-bash-win

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

READMEREADME

dsh-bash-win

在 Windows 上为 DeepSeek Harness(DSH)提供 Git Bash 与 WSL2 两个 bash 工具的 Cordis 插件。

这个项目解决什么

  • DSH 在 Windows 上禁用了官方 bash 工具(只有 pwsh)

本插件通过 ctx.subprocess 直接 spawn bash.exe / wsl.exe,绕开受限令牌层, 把 Git Bash 或者 WSL2 带进 DSH,并自建有效沙箱(WSL 内 bwrap)与审批请求。

安全模型

维度 机制 说明
默认执行 无沙箱,全权限 git_bash / wsl_bash 默认直接跑,可读写任意路径(绕开沙箱的代价)
沙箱 WSL 内 bwrap(sandbox: true) 系统目录只读、workspace 可写、/mnt/c 其余只读;越界写入被拒并报 [sandbox: file access denied under workspace-write mode]
审批 ctx.approval require_approval: true 执行前弹窗;升权请求(sandbox_permissions + justification)弹窗;ask 策略弹窗、never 自动拒绝

关键概念:

  • 操作路径本身不触发审批——沙箱对越界的处理是"拒绝"(报错,不弹窗);
  • 审批只出现在两处:显式批准模式(require_approval)和越界后的升权请求;
  • 升权阶梯:workspace-write(bwrap 受限)→ danger-full-access(去掉 bwrap), 走官方 approveEscalation 流程,必须严格加宽且经用户批准。

工具

工具 后端 UI 标题 能力
git_bash 本地 Git Bash(MSYS2) Git Bash 批准模式(require_approval)、官方沙箱接入(sandbox,Windows 受限模式报 Cygwin 限制)、后台任务
wsl_bash WSL2(Linux) WSL Bash bwrap 真沙箱(sandbox: true)、升权审批(sandbox_permissions + justification)、后台任务

共性能力:

  • 前台执行:timeoutMs 超时终止整个进程树、调用取消
  • 后台任务:run_in_background: true 返回 job id,配合 job_output / job_kill (非零退出码如实上报,kill 分类为 killed)
  • 输出收集:内存上限 256 KiB,超限截断并落 spill 文件
  • Web 终端卡片:终端图标、可展开输出、退出码状态,与内置 bash/pwsh 卡片一致

支持与限制

Git Bash(git_bash)

  • 自动探测安装位置:C:\Program Files\Git\bin\bash.exe、 C:\Program Files\Git\usr\bin\bash.exe、C:\Program Files (x86)\Git\bin\bash.exe
  • MSYS2 完整语义(管道、重定向、Unix 风格命令),Windows/Unix 路径混用
  • 每次调用全新进程,状态不跨调用
  • 无文件沙箱:受限令牌下 Cygwin 无法启动,默认以完整权限运行; sandbox: true 会尝试走 windows-acl 沙箱,受限模式下如实报告 runner 失败 (这是平台限制,不是绕过)
  • 适合:需要 Windows 侧工具、msys 语义、或"全权限 + 人工批准把关"的场景

WSL2(wsl_bash)

  • 自动探测 C:\Windows\System32\wsl.exe;发行版默认 Ubuntu(可指定)
  • --cd 自动转换 Windows 路径(C:\Users\... → /mnt/c/Users/...),也可直接传 Linux 路径
  • 真 Linux 环境:apt、gcc、python 等,Linux 退出码语义;以 WSL 默认用户身份运行
  • VM 未启动时首次调用有数秒冷启动延迟(可用 timeoutMs 控制等待)
  • 默认无沙箱(ext4 不受 Windows ACL 约束,Windows 侧沙箱管不住它)
  • sandbox: true 时在 WSL 内用 bwrap 包装命令:系统目录(/usr /lib /bin /etc 等)只读、/tmp 临时可写、workspace 可写、/mnt/c 其余只读; 要求发行版已安装 bubblewrap(apt install bubblewrap)
  • 实现细节:bwrap 参数逐个传递(避免 wsl.exe 的 Windows→Linux 参数字符串 序列化损坏引号);命令经 base64 编码传递(避免引号注入)

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

← 上一个 Prev marisa-distro 下一个 Next dsh-agnes-studio →