inmny/dsh-git-bash ↗★ 16

dsh-plugin-git-bash

Use Git for Windows Bash as the default DSH shell with restricted-mode support

套件
dsh-plugin-git-bash
相容性
待驗證
Harness 依賴範圍
^0.1.6-alpha.0
Cordis 依賴範圍
^4.0.1
版本
0.3.3
授權
MIT
最近更新
2026年9月20日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-plugin-git-bash@0.3.3

使用方法

插件安装到 profile 后,standard、code、cordis 和 minimal preset 会使用 Git Bash 代替 PowerShell。前台命令、后台命令和 Web Agent preset 共用同一个 executor。

新建会话后可以运行以下命令确认 shell:

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 安装目录。

配置 Git Bash 路径

插件会自动探测 Program Files、用户安装目录和 Scoop 中的 Git Bash。Web GUI 中打开 设置 -> 插件 -> 插件配置,展开 Git Bash 卡片后可以直接输入 bash.exe 路径,或通过 选择 Git 安装目录 调用系统路径选择窗口。保存后,后续 Bash 命令会立即使用新路径;恢复默认值会回到 profile 配置或自动探测结果。

无 GUI 场景可以在启动 DSH 前设置 DSH_GIT_BASH_PATH:

$env:DSH_GIT_BASH_PATH = 'D:\Apps\Git\bin\bash.exe'
dsh web

也可以直接在 profile 的 cordis.patch.yml 中为 provider 配置 executable:

- id: git-bash-shell
  name: dsh-plugin-git-bash
  config:
    executable: D:\Apps\Git\bin\bash.exe