inmny/dsh-git-bash3

dsh-plugin-git-bash

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

AI Analysis

核心用途是统一 Windows 下的命令行执行环境。适合习惯类 Unix 命令行工具、希望 AI 智能体在 Windows 上使用 Bash 执行任务的用户。

Package
dsh-plugin-git-bash
Version
0.3.0
License
MIT
Last updated
Aug 16, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:inmny/dsh-git-bash

使用方法

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

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

printf 'shell=%s\nversion=%s\nmsystem=%s\n' "$BASH" "$BASH_VERSION" "$MSYSTEM"

MSYSTEM 应为 MINGW64MINGW32

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