Provides a Windows variant for DSH minimalist mode, using Git for Windows MSYS bash instead of standard bash, and fixes compatibility issues on Windows.
- Language
- JavaScript
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add @icelily/dsh-gitbash-presetRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin liceses/dsh-gitbash-preset for me: review the repository at https://github.com/liceses/dsh-gitbash-preset first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-Line Description
Provides a Windows-compatible variant for DSH minimal mode: redirects bash tool invocations from persistent PTY (which cannot start on Windows) to Git for Windows' bundled bash (MSYS), solving the issue where the official minimal mode fails to run on Windows.
Core Capabilities
- On startup, copies the bundled "Minimal Mode (Git Bash)" preset to the user preset root directory; skips if already exists to avoid overwriting user files
- Automatically locates Git for Windows bash path: prioritizes
GIT_BASHenvironment variable, then scans common installation directories and PATH, and skips Windows' built-in WSL launcher to avoid misuse - Executes bash commands as
bash -c <command>by spawning a new shell each time, uniformly handling timeout, background execution, output truncation, and error diagnosis - Security guaranteed through sandbox policy gating: refuses execution under non-"full-access" sandbox, and prompts to use
sandbox_permissions: "danger-full-access"for one-time upgrade - Retains the minimal mode's persona and str_replace_editor tool surface, providing the same user experience as the official minimal mode
Technical Implementation
- Language: JavaScript (ESM, native Node.js)
- Key Dependencies: Uses only Node built-in modules (
node:fs/node:path/node:os/node:url); preset consists of host's existing@deepseek-ai/dsh-persona/dsh-tool-bash/dsh-fs-local/dsh-tool-str-replace-editor - Architecture Pattern: Injects plugin via
cordis.patch.ymlinto web profile;apply(ctx, config)inlib/index.jscopies preset files to user directory on startup; preset internally uses entry-local realm to registershellservice andbash/str_replace_editortools - Entry Files:
lib/index.js(installer) +agent-presets/minimal-gitbash/agent.cordis.yml(preset composition) +agent-presets/minimal-gitbash/gitbash-executor.mjs(bash executor)
Use Cases
When Windows users use "Minimal Mode" on DSH Web, the persistent bash fails due to PTY limitations and missing bash. This plugin provides a one-click installable alternative preset, enabling Windows to use bash tools in minimal mode just like macOS/Linux.
Prerequisites and Compatibility
| Dependency | Minimum Version | Description |
|---|---|---|
| DSH | Not declared | Runs via @deepseek-ai/dsh-* host package; no version range declared in manifest |
| Node.js | >=20 | From package.json engines.node |
| Operating System | Windows | Preset is directly disabled with process.platform !== 'win32', only active on Windows; executor falls back to bash on non-Windows but preset itself won't activate |
| Git for Windows | Recommended | When not installed, executor falls back to PATH or bare bash name, may fail to start |
| Native Modules | None | Uses only Node built-in modules, no npm native dependencies |
Installation
dsh plugin --profile web add github:liceses/dsh-gitbash-preset
Configuration Options
| Config | Type | Description | Default |
|---|---|---|---|
shellPath | string | Explicitly specify bash.exe path, empty for auto-detection (GIT_BASH → common install dirs → PATH) | Auto-detect |
timeoutMs | milliseconds | Default timeout for single command | 120000 |
maxTimeoutMs | milliseconds | Maximum allowed timeout for single command | 600000 |
maxOutputBytes | bytes | Maximum bytes retained per stream (stdout/stderr), overflow written to spill file | 64000 |
maxSpillBytes | bytes | Total size limit for spill files | 67108864 (64MB) |
graceMs | milliseconds | Grace period from SIGTERM to SIGKILL when terminating process | 3000 |
force | boolean | Plugin-level config: whether to overwrite existing preset with bundled files | false |
FAQ
Q: Who is this plugin for?
A: Primarily ordinary Windows users using DSH minimal mode. The official minimal mode doesn't run on Windows, and this plugin provides an alternative preset variant.
Q: Do macOS or Linux users need to install this?
A: No. The preset is internally disabled with process.platform !== 'win32', so even if installed on other systems, it won't activate. The official minimal mode will continue to be used.
Q: What do I need to do after installation?
A: Restart DSH to let the plugin write the preset to user directory (approx ~/.dsh/.agent-presets/minimal-gitbash/), then when creating a new session in the Web UI, select "Minimal Mode (Git Bash)".
Q: Can I use it when the session sandbox is workspace-write?
A: Not directly. The bash tool will refuse to execute due to sandbox restrictions; either switch the session to "full-access" sandbox mode, or have the model use sandbox_permissions: "danger-full-access" with justification for a one-time upgrade as prompted by the error.
Q: Will it modify the bash tools already on my computer?
A: No. It only replaces the shell provider within the scope of sessions that select "Minimal Mode (Git Bash)"; other sessions and system bash are completely unaffected.
Q: How do I force overwrite an already installed preset?
A: Set force to true in the plugin configuration. The plugin will overwrite the version in the user directory with the bundled preset files (it won't delete files you added separately).
Q: How do I uninstall it?
A: Use dsh plugin --profile web remove to remove the plugin, then manually delete the minimal-gitbash folder in the user directory.
Q: What's the difference between this and the official minimal mode?
A: The persona and str_replace_editor tool surface are completely identical; the only difference is that the bash tool spawns a new shell for each invocation and doesn't preserve cd / export state. This is a compromise after being unable to use persistent PTY on Windows.
Difficulty Level
Beginner — Install the plugin, restart DSH, select the preset, and it's ready to use. No code or config changes needed; only advanced users who want to fix the bash path or adjust timeouts need to look at agent.cordis.yml.
Known Issues and Limitations
- When session sandbox is workspace-write or stricter, Git Bash cannot start within Windows restricted token sandbox (MSYS runtime cannot create signal pipe). Need to switch to "full-access" or use one-time upgrade — this is a sandbox boundary, the plugin doesn't bypass it
- Each bash invocation spawns a new shell and does not preserve session state like
cd/export(different from official minimal mode's persistent PTY shell). Models need to include full paths in each command or maintain working directory themselves - Preset is only enabled on Windows platform; even if installed on macOS/Linux, it will be disabled by the
disabledcondition inagent.cordis.yml - Preset disables background tasks (
enableRunInBackground: false); long-running tasks need to be managed via single command timeouts - In extreme cases, when both Git Bash and WSL launcher (bash.exe in System32) exist in PATH, the executor actively skips WSL launcher directory to avoid getting a non-existent distribution stub
DeepSeek Harness 插件:一键安装「极简模式 (Git Bash)」agent preset —— 把 DSH 自带极简模式中的 bash 调用映射到 Git for Windows 的 bash(MSYS),让 Windows 上的极简模式真正可用。
About
DSH 自带的极简模式在 Windows 上无法使用,失败有两层原因:
- PTY 平台限制:极简模式的持久 bash 依赖 PTY 后端,而
@deepseek-ai/dsh-subprocess-local在 win32 上直接拒绝(terminal inspection is unsupported on platform win32),与 bash 是否存在无关; - shell 缺失:即便绕过 PTY,
@deepseek-ai/dsh-bash-local硬编码从 PATH 找bash,Windows 上默认没有。
本插件交付一个可安装的预设变体:同一套极简 persona + str_replace_editor 双工具表面,但 bash 工具每次命令执行 <git bash> -c <command>,并通过沙箱感知门控保证不绕过安全边界。
特性
- 幂等安装:插件启动时把打包的预设复制到用户预设根(
${DSH_HOME:-~/.dsh}/.agent-presets/minimal-gitbash/),已存在则跳过,force: true才覆盖; - 自动探测 bash:
GIT_BASH环境变量 → 常见安装目录(ProgramFiles / ProgramFiles(x86) / LOCALAPPDATA)→ PATH 中的bash.exe→ 兜底bash,无需硬编码路径; - 沙箱感知门控:MSYS 运行时无法在 Windows 受限令牌沙箱内启动(无法创建 signal pipe),因此命令仅在"完全访问"策略下执行——不绕过沙箱,受限时给出明确升级指引;
- 极简不变:固定 persona、
str_replace_editor、无上下文压缩,与原极简模式一致。
工作原理
| 环节 | 说明 |
|---|---|
| 插件行 | cordis.patch.yml 在 web profile 组合中插入 dsh-gitbash-preset,启动时安装预设文件 |
| 预设组合 | agent.cordis.yml 中 gitbash-shell 组以 entry-local realm 提供 shell 服务,tool-bash 注册模型工具 |
| 执行器 | gitbash-executor.mjs 通过 host 的 subprocess 服务执行 bash -c,处理超时、后台、输出截断与错误诊断 |
| 沙箱门控 | run/start 校验策略:仅 danger-full-access(或部署无沙箱)放行,否则抛出带指引的错误 |
安装
dsh plugin --profile web add @icelily/dsh-gitbash-preset
或手动合并 cordis.patch.yml 到 profile patch 层。重启 DSH 后生效;重启后插件会自动安装预设(已存在则 no-op,不会覆盖你已有的版本)。
也可以不装插件,直接把 agent-presets/minimal-gitbash/ 目录复制到 ~/.dsh/.agent-presets/。
使用
- Web 界面新建会话,选择 极简模式 (Git Bash);
- 二选一启用 bash:
- 把会话沙箱切到完全访问,之后所有 bash 调用直接走 git bash;
- 或保持 workspace-write,让模型在第一次调用失败后按提示用
sandbox_permissions: "danger-full-access"+ justification 单次升级(走正常审批流程)。
配置
预设配置(agent-presets/minimal-gitbash/agent.cordis.yml 中 gitbash-executor):
| 字段 | 默认 | 说明 |
|---|---|---|
shellPath | 自动探测 | 显式指定时优先(如 'C:\\Program Files\\Git\\bin\\bash.exe') |
timeoutMs | 120000 | 单次命令默认超时(上限 maxTimeoutMs) |
maxTimeoutMs | 600000 | 超时上限 |
maxOutputBytes | 64000 | 单流保留字节数(溢出写入 spill 文件) |
graceMs | 3000 | 终止进程的 SIGTERM→SIGKILL 宽限 |
插件配置(cordis.patch.yml 插入行):
| 字段 | 默认 | 说明 |
|---|---|---|
force | false | 预设已存在时是否用包内文件覆盖(保留用户额外文件) |
开发
npm run check # 三个文件语法检查(插件、执行器、测试)
npm run test # 单元测试:路径转换 / 探测优先级 / 配置校验,10 个用例
限制
- 会话沙箱为 workspace-write(或更窄)时,git bash 无法启动(MSYS 受限令牌限制),需切换完全访问或单次升级——这是沙箱边界,插件不绕过;
- 与原极简模式不同,bash 为每次调用新 shell(不保持 cd/export 状态)——Windows 上 PTY 持久会话不可用,此为替代设计。
License
MIT
Read the usage guide →
Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.
Listing badge
[](https://deepseek-plugin.org/plugins/liceses/dsh-gitbash-preset)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.