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 宿主提供的核心工具包。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-bash-win(zimzaza4/dsh-bash-win)
仓库:https://github.com/zimzaza4/dsh-bash-win
本站详情页:https://www.yhbd.top/plugins/zimzaza4-dsh-bash-win/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 12 · 最近提交 2026-08-14 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 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 →
jigjoy-ai/baro
cyanseek/dsh-native-playbook
23swccp/dsh-undo
kenryu42/cc-safety-net
hyhmrright/brooks-lint
zhu1090093659/dsh-trading
lire1131/dsh-undo-savepoint