yunuo110/dsh-gitbash ↗★ 8

dsh-gitbash

让 bash 工具在 Windows 上运行 Git Bash 并禁用 pwsh。 适合 Windows 上需用 Git Bash 执行 shell 与 git 命令的用户。

套件
dsh-gitbash
相容性
待驗證
版本
0.1.1
授權
MIT
最近更新
2026年9月4日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yunuo110/dsh-gitbash

使用

  • 新会话或旧对话里让模型执行 shell/git 命令,例如“查看 git 状态”“运行 npm test”。
  • 模型看到的是 bash 工具,描述会说明它运行 Git Bash。
  • Windows 上模型看不到 pwsh,即使旧缓存尝试 pwsh 也会被拒绝并提示改用 bash。
  • 如果当前会话沙箱不是完全访问,第一次调用可能失败并提示升级。按提示让模型用:
    {
      "command": "git status",
      "description": "查看 git 状态",
      "sandbox_permissions": "danger-full-access",
      "justification": "Git Bash 无法在受限沙箱中启动,需要完全访问以执行 git 状态检查。"
    }
    
    或直接在设置里把会话权限切到完全访问。

配置

默认自动探测 Git Bash:GIT_BASH 环境变量 → Program Files / Program Files (x86) / ProgramW6432 / LocalAppData / Scoop → PATH(排除 System32 的 WSL bash)。

要固定路径,在 profile 自己的 cordis.patch.yml(~/.dsh/profiles/web/cordis.patch.yml)中覆盖插件行:

- id: dsh-gitbash
  config:
    shellPath: 'C:\Program Files\Git\bin\bash.exe'
    timeoutMs: 120000
    maxTimeoutMs: 600000
    maxOutputBytes: 64000
    maxSpillBytes: 67108864
    graceMs: 3000
字段默认说明
shellPath自动探测固定 Git Bash 路径
timeoutMs120000单条命令默认超时
maxTimeoutMs600000超时上限
maxOutputBytes64000stdout 内存保留字节数,溢出写入 spill
maxSpillBytes67108864spill 文件上限
graceMs3000SIGTERM → SIGKILL 宽限