插件目录 / Developer / dsh-msys2-bash-executor
dsh-msys2-bash-executor
已验证 · 实测可装 3223698962
功能简介
Standalone configurable MSYS2/UCRT64 and Git Bash executor for DeepSeek Harness, with global or per-preset activation
可用 — 实测通过,早期项目
Standalone configurable MSYS2/UCRT64 and Git Bash executor for DeepSeek Harness, with global or per-preset activation 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-msys2-bash-executor
A standalone, configurable Bash executor for DeepSeek Harness on Windows. It can run agent shell calls through MSYS2/UCRT64 Bash or Git Bash, and adds a visual configuration card to the DSH Web settings page.
This package does not depend on dsh-anchored-standard or dsh-anchored-standard-bash. Its bundle registers one isolated global Bash tool and can expose it globally or only to selected preset IDs.
Features
- Direct
argvspawning through DSH's managedsubprocessservice. It does not use Node'sshell: truemode. - Automatic detection of MSYS2, UCRT64, Git Bash, and
bashonPATH. - Configurable executable, Bash arguments,
PATHprefixes, and environment variables. - Foreground timeouts, abort handling, bounded output, spill files, background jobs, incremental reads, and process-tree termination.
- DSH Web settings card with English and Chinese copy.
- Global activation or per-preset activation for Standard, Code, Cordis, Minimal, and custom preset IDs.
- Minimal-specific shadowing that bypasses DSH's unsupported Windows persistent-terminal inspection path.
- The Host PowerShell provider remains installed for presets where Bash is disabled.
Security
This executor is unsandboxed. Commands run with the full permissions of the DSH process, equivalent to danger-full-access. It does not provide the Windows ACL sandbox used by the stock PowerShell sandbox executor.
Only use it with trusted prompts, repositories, and tools.
Install from a local package
The package is not published to npm yet. Build and pack it locally:
npm.cmd run check
npm.cmd pack
dsh plugin --profile web add "C:\path\to\dsh-msys2-bash-executor-0.1.1.tgz"
To build from GitHub:
git clone https://github.com/3223698962/dsh-msys2-bash-executor.git
cd dsh-msys2-bash-executor
npm.cmd install
npm.cmd run check
npm.cmd pack --cache .npm-cache
dsh plugin --profile web add "C:\path\to\dsh-msys2-bash-executor-0.1.1.tgz"
Restart dsh web after installing or updating the plugin. Activation changes affect newly created sessions; running sessions keep the tool set they started with.
Configure in DSH Web
Open Settings, then Plugins, then the configurable plugins tab. The MSYS2 / Git Bash card provides:
- Use Bash for every preset: expose global
bashand hidepwshin all newly created sessions. - Preset activation: independently enable Standard, Code, Cordis, Minimal, or any custom preset ID when global mode is off.
- Bash executable: for example
C:\msys64\usr\bin\bash.exeorC:\Program Files\Git\bin\bash.exe. - Bash arguments: JSON array placed before the command. The normal value is
["-c"]. - PATH entries to prepend: one Windows path per line.
- Environment variables: a JSON object containing string values.
For UCRT64 when DSH was not started from an existing UCRT64 terminal, a typical configuration is:
Bash executable:
C:\msys64\usr\bin\bash.exe
PATH entries to prepend:
C:\msys64\ucrt64\bin
C:\msys64\usr\bin
Environment variables:
{"MSYSTEM":"UCRT64","CHERE_INVOKING":"1"}
Settings are stored in the package-owned msys2-bash namespace. This keeps Bash activation and launch configuration independent from the Host PowerShell provider. The Web card reads and writes that namespace through the plugin's own typed Remote, because DSH 0.1.0-rc.6 exposes only a fixed built-in namespace allowlist through its generic settings API.
When Bash is enabled for Minimal, the plugin registers the standalone Bash definition in the agent's nearest tool layer. That shadows Minimal's built-in persistent Bash tool and avoids subprocess-local: terminal inspection is unsupported on platform win32. Shell state is therefore not persistent between calls in this mode.
Activation model
The bundle mounts an isolated Bash executor and @deepseek-ai/dsh-tool-bash at the Host layer. For each newly created agent it reads the effective preset ID:
- enabled preset: expose global
bashand hide inheritedpwsh; - disabled preset: hide global
bashwhen it would otherwise be visible; - Minimal enabled: shadow the persistent terminal tool with the standalone Bash definition;
- Minimal disabled: leave its stock persistent tool untouched.
Set globalEnabled: true to cover every preset, or keep it false and list IDs in enabledPresets.
Manual preset mount
Add an isolated shell group to the preset's agent.cordis.yml:
- id: shell-bash
name: cordis:group
group: true
isolate:
shell: true
config:
- id: msys2-bash-executor
name: dsh-msys2-bash-executor/bash-executor
disabled: !!js process.platform !== 'win32'
- id: tool-bash
name: '@deepseek-ai/dsh-tool-bash'
The shell isolation is required because the executor provides ctx.shell. Mounting another shell provider in the same realm as the Host PowerShell provider causes a duplicate-service error.
On non-Windows systems, the recommended disabled expression leaves the executor off and lets tool-bash resolve the Host Bash provider. Remove the expression only when an unsandboxed local Bash executor is also desired there.
Resolution order
If the executable field is empty, the resolver checks:
DSH_BASH_PATH.MSYS2_ROOTandMSYS_ROOT.C:\msys64\usr\bin\bash.exeandC:\msys64\ucrt64\bin\bash.exe.- Git Bash under Program Files and Local AppData.
- Each Windows
PATHentry. - The command name
bash.
An explicitly configured executable is always used as-is, so a bad path fails visibly at spawn time.
Scope
This plugin changes DSH agent tool visibility inside the Web profile. It does not reconfigure external Codex CLI or Claude Code subprocess providers. Those products need their own shell or environment configuration, although they can independently invoke the same MSYS2/Git Bash executable.
Development
npm.cmd run build
npm.cmd test
npm.cmd run check
npm.cmd run pack:dry
src/client.js is the browser source. scripts/build-client.mjs generates lib/client.js in the window.__ModuleLoader__ format required by DSH Web.
Troubleshooting
- If Bash starts in the wrong MSYS2 subsystem, set
MSYSTEMand prepend the matching toolchain directory. - Use Windows paths in the settings card because the executable is spawned by Windows Node.
- Start DSH with Windows-native Node. The MSYS2 build of Node is not compatible with the current DSH Windows launcher.
- Node warning
DEP0190is not emitted by this executor: it passes a completeargvto DSH subprocess and never setsshell: true. Trace that warning to the plugin that callschild_process.spawnwith both an argument array andshell: true.
License
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-msys2-bash-executor」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:3223698962/dsh-msys2-bash-executor Headless(CLI)profile:
dsh plugin --profile headless add github:3223698962/dsh-msys2-bash-executor 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。