dsh-gitbash
让 bash 工具在 Windows 上运行 Git Bash 并禁用 pwsh。 适合 Windows 上需用 Git Bash 执行 shell 与 git 命令的用户。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yunuo110/dsh-gitbash說明文件
閱讀完整 README ↗使用
- 新会话或旧对话里让模型执行 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 路径 |
timeoutMs | 120000 | 单条命令默认超时 |
maxTimeoutMs | 600000 | 超时上限 |
maxOutputBytes | 64000 | stdout 内存保留字节数,溢出写入 spill |
maxSpillBytes | 67108864 | spill 文件上限 |
graceMs | 3000 | SIGTERM → SIGKILL 宽限 |