跳到正文

inmny/dsh-git-bash

30最近提交 2026年8月14日

dsh-git-bash DSH 插件

该插件配置 DeepSeek Harness (DSH) 在 Windows 上使用 Git for Windows Bash 代替 PowerShell。它通过原生守卫在受限模式下维持 DSH 的权限模型,危险模式则直接运行 Bash。可通过 GUI、环境变量或配置文件设置 Git Bash 路径。

如何安装 dsh-git-bash DSH 插件

dsh plugin --profile web add dsh-plugin-git-bash@0.3.0

复制不会执行命令。安装 dsh-git-bash DSH 插件前请核对仓库和版本。

dsh-git-bash DSH 插件数据来源

dsh-git-bash DSH 插件快照日期:2026年8月16日

discovered

dsh-git-bash DSH 插件能做什么

  • 在 standard、code、cordis 和 minimal 预设中将 PowerShell 替换为 Git Bash。
  • 保留 DSH 的只读、工作区写入和危险完全访问权限语义。
  • 自动检测 Git Bash 安装位置(Program Files、用户安装、Scoop),并允许手动配置路径。
  • 支持通过 Web GUI、环境变量 DSH_GIT_BASH_PATH 或 profile YAML 配置。
  • 受限模式下使用原生守卫 (msys-token-guard) 强制沙箱限制。
  • Web 界面可展开 Bash 工具详情,显示命令、工作目录、标准输出/错误和退出状态。

dsh-git-bash DSH 插件适合哪些场景

  • 在 Windows 的 DSH 中运行 Bash 脚本,无需切换出标准环境。
  • 在 DSH 任务中使用 Git Bash 工具(如 grep、sed、awk),同时遵守权限控制。
  • 在 Windows DSH 环境中使用 Bash 开发和测试跨平台脚本。
  • 使用危险完全访问模式进行无限制的自动化任务。

dsh-git-bash DSH 插件适合谁

  • Windows 上使用 DeepSeek Harness 且偏好或需要 Bash 的用户。
  • 需要严格权限隔离(只读/工作区写入)同时使用 Bash 的开发者。
  • 团队统一使用 Git for Windows Bash 作为 DSH 工作流标准。

dsh-git-bash DSH 插件的限制

  • 仅支持 Windows x64(原生守卫仅适用于 win32-x64;其他架构返回 SANDBOX_UNAVAILABLE)。
  • 需要 Node.js 24 或更高版本以及 DSH 0.1.0-rc.6 或更高版本。
  • 必须安装 Git for Windows x64,插件不附带 Git。
  • 插件安装路径需能用当前系统代码页无损表示且不超过 MAX_PATH(否则守卫会失败关闭)。
  • 危险完全访问模式直接运行 Git Bash,不经过原生守卫,绕过沙箱限制。

dsh-git-bash DSH 插件的仓库 README 摘录

以下文字摘自 dsh-git-bash DSH 插件的上游仓库 inmny/dsh-git-bash 的 README,版权归原作者,仅作引用。

让 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 在 Windows 上默认使用 Git for Windows Bash,并保留 DSH 的 `read-only`、`workspace-write` 和 `danger-full-access` 权限语义。 ![Git Bash 在 DeepSeek Harness 中运行](assets/teaser.png) ## 使用方法 插件安装到 profile 后,`standard`、`code`、`cordis` 和 `minimal` preset 会使用 Git Bash 代替 PowerShell。前台命令、后台命令和 Web Agent preset 共用同一个 executor。 新建会话后可以运行以下命令确认 shell: ```sh printf 'shell=%s\nversion=%s\nmsystem=%s\n' "$BASH" "$BASH_VERSION" "$MSYSTEM" ``` `MSYSTEM` 应为 `MINGW64` 或 `MINGW32`。 Web 界面中的 Bash 工具行可以展开查看 command、cwd、stdout/stderr 和 exit status。`run_code` 内的 nested Bash 调用使用同一套 terminal 详情;过长的 command 会自动换行,output 则保留终端横向滚动,以维持日志和表格的列对齐。 插件只作为 bundle layer 安装到目标 profile,不修改 DSH 安装目录。 ## 安装或更新 从 npm 安装固定版本到 Web profile: ```sh dsh plugin --profile web add dsh-plugin-git-bash@0.3.0 ``` 更新现有安装时使用同一条命令。安装完成后重启 `dsh web`,让 Host 和浏览器 client 同时加载新版本,然后新建会话。 安装最新版时可以省略版本号: ```sh dsh plugin --profile web add dsh-plugin-git-bash ``` 开发本地版本时传入 checkout 路径: ```powershell dsh plugin --profile web add C:\path\to\dsh-git-bash ``` ## 权限模式 ### `read-only` 和 `workspace-write` 受限命令仍由 DSH Windows ACL sandbox 创建 `WRITE_RESTRICTED` token。插件在 sandbox 内先运行

阅读完整 README仓库许可: MIT

dsh-git-bash DSH 插件常见问题

如何安装 dsh-plugin-git-bash 到 DeepSeek Harness?

在命令行中运行 `dsh plugin --profile web add dsh-plugin-git-bash@0.3.0`,将插件安装到 web profile。也可以省略版本号安装最新版,或传入本地开发路径。安装后重启 `dsh web` 并新建会话即可生效。

如何确认已经使用了 Git Bash 而不是 PowerShell?

新建会话后,运行 `printf 'shell=%s\nversion=%s\nmsystem=%s\n' "$BASH" "$BASH_VERSION" "$MSYSTEM"`,应看到 shell 显示为 Git Bash,MSYSTEM 为 MINGW64 或 MINGW32。

如果自动检测不到 Git Bash 路径,如何手动配置?

在 Web GUI 中进入 设置 → 插件 → 插件配置 → Git Bash 卡片,可以直接输入 bash.exe 路径,或通过“选择 Git 安装目录”调用系统路径选择窗口。也可以启动 DSH 前设置环境变量 `DSH_GIT_BASH_PATH`,或在 profile 的 `cordis.patch.yml` 中配置 provider 的 `executable` 字段。

插件的权限模式是什么意思?对 Git Bash 有何影响?

插件支持三种模式:只读模式(不能写入工作区)、工作区写入模式(只能写入授权的工作区和临时目录)和危险完全访问模式(无限制)。在只读和工作区写入模式下,插件使用原生守卫 msys-token-guard 来强制沙箱限制;在危险完全访问模式下,Git Bash 直接运行,不经过守卫。

这个插件能在 Linux 或 macOS 上运行吗?

不能,插件仅支持 Windows x64。原生守卫只编译了 win32-x64 版本,其他架构的受限模式会返回 SANDBOX_UNAVAILABLE,且不会降级到未隔离执行。该插件专门用于在 Windows 上替换 PowerShell,因此不适用于其他平台。