dshbase

插件目录 / Developer / dsh-gitbash-shell

dsh-gitbash-shell

未验证 KannaKuron

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
语言
2026-08-23最近推送
跨平台平台

功能简介

DSH plugin: Git Bash shell for all agent modes on Windows (replaces pwsh executor)

我们的评价
未验证 — 尚未实测

DSH plugin: Git Bash shell for all agent modes on Windows (replaces pwsh executor) 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-gitbash-shell

Awesome DSH Plugin

让 DeepSeek Harness (dsh) 在 Windows 上全部使用 Git Bash 的官方风格插件
—— 以 Git for Windows 的 bash.exe 替换 PowerShell 执行器,并为所有模式
物化对应的 Git Bash 版 agent preset。

它解决什么

官方 Windows 组合默认把 dsh-pwsh-sandbox 作为 ctx.shell(PowerShell 执行器),
且各 preset 的 tool-bash 行在 win32 上被禁用——因为在 Windows 上裸 bash
会解析到 C:\Windows\System32\bash.exe(WSL 占位),本插件直接指定
C:/Program Files/Git/bin/bash.exe 并保留官方沙箱语义。

安装本插件后:

模式 preset id 说明
标准模式 · Git Bash standard-gitbash 完整编码 Agent,shell 为 Git Bash
极简模式 · Git Bash minimal-gitbash 持久 Git Bash 终端 + str_replace_editor
PTC 模式 · Git Bash code-gitbash PTC(Code Mode SDK)+ Git Bash
创造模式 · Git Bash cordis-gitbash 自引用 Cordis 工具集 + Git Bash

原有的 标准模式/极简模式/PTC 模式/创造模式(shipped,不可修改)在
Git Bash host 下会拿到"暗示 PowerShell 语法的工具",请改用上面的变体;
已装 dsh-ptc-cordis-preset 的话,PTC 创造模式 用户 preset 不受影响。

安装(公开 npm 插件,推荐)

npm: dsh-gitbash-shell
源码与 Release: github.com/KannaKuron/dsh-gitbash-shell

# web 图形界面
dsh plugin --profile web add dsh-gitbash-shell

dsh plugin add 会自动:① pnpm 安装 npm 包 dsh-gitbash-shell;
② 检测到包声明的 dsh.bundle 后把它追加进该 profile 的
dsh.profile.bundles重启该 profile 的 host 后生效。

它做了什么

bundle patch(cordis.patch.yml)应用三个改动:

  1. pwsh-sandboxdisabled: true —— 每进程只允许一个 ctx.shell;
  2. 插入 gitbash-executor(dsh-gitbash-shell/shell):继承官方
    @deepseek-ai/dsh-bash-sandbox,仅把内层 argv 换成
    <git-bash.exe> -c <command>。沙箱策略/拒绝分类/后台任务/超时/设置节
    全部沿用官方实现;full-access 分支单独接 Git Bash(父类那里硬编码裸 bash);
  3. 插入 gitbash-presets(dsh-gitbash-shell/presets):启动时把上表 4 个
    preset 物化到首个 user-trust preset 根目录,并写
    .plugin-managed.json(逐文件哈希)——未改动则随版本刷新;被用户改过就
    不再碰;卸载时(且仅当未改动)会清理。

环境变量:bash.exe 是 host 进程的直接子进程(不经 git-bash 登录壳),完整继承
系统环境变量与 DSH_* 快照,和原来 pwsh 拿到的完全一致。

配置

gitbash-presets 行支持 presets 数组,只物化你常用的模式(未列出的旧物化目录、
且未被用户修改过的,会自动清理):

- id: gitbash-presets
  config:
    presets: [standard-gitbash, minimal-gitbash]   # 默认物化全部 4 个

配合 agent-presetsdefault,新会话直接落在 Git Bash 模式,免去每次在
模式选择器里翻找(原版 shipped 模式无法替换或隐藏——部署级、只读):

- id: agent-presets
  config:
    default: ptc-cordis   # 或 standard-gitbash / minimal-gitbash

配置(执行器)

gitbash-executor 行支持:

config:
  bashPath: "D:/Tools/Git/bin/bash.exe"   # 默认 C:/Program Files/Git/bin/bash.exe
  timeoutMs: 60000                         # 默认 60s,可继续用 shell 设置节调整

验证

npm test

重启 host 后新会话:

  • 工具列表里出现 bash(不再有 pwsh),描述为 Git Bash;
  • echo \$BASH_VERSION 有输出、command -v bash 指向 Git 安装目录。

卸载

dsh plugin --profile web remove dsh-gitbash-shell

或删除 profilepackage.json 中依赖 + dsh.profile.bundles 中的条目后
dsh plugin --profile web install。卸载并重启后,未改过的 * -gitbash
preset 会被插件自动清理;宿主 shell 回退为 PowerShell。

与 dsh-ptc-cordis-preset 联动

本插件在 host 上发布 gitBash 能力服务({ active, bashPath },仅 Windows 为 active)。
dsh-ptc-cordis-preset v0.5.0+ 在物化
PTC 创造模式 时会检测该信号:两个插件都安装时,PTC 创造模式自动物化为 Git Bash 版
(tool-bash 启用、tool-pwsh 禁用),无需新增模式、无需手工修改 preset;
只装本插件时 PTC 创造模式保持原样(由它自己的插件管理)。

切换生效后若 ptc-cordis 目录已存在且被旧版本物化,删除
~/.dsh/.agent-presets/ptc-cordis 并重启,即由新逻辑重新物化。

与 dsh-better-sidebar 联动

装了 dsh-better-sidebar(v0.15.2+) 时,Windows 上本插件会通过它的官方设置补丁口(运行时 terminalShell 设置,对方文档明示"settings-page overrides win for terminals opened afterwards")把它打开的终端 shell 指向 Git Bash——UI 终端标签与模型侧 terminal_* 工具统一生效,不改对方一行代码、新开的终端即生效。此外,本插件的 bundle patch 还会给对方的行补上 config.shell(启动期解析,连 tab 标题也会显示 bash;对方未安装时该行无害跳过)。规则:

  • 插件全权接管:Windows 上每次启动都无条件把它的 terminalShell 设为 Git Bash——即使你在设置页/别处改过,下次插件启动也会改回来;
  • 卸载本插件 → 自动还原为你改之前的原值(回到它的默认解析:pwsh / powershell);
  • 想关掉本联动 → 本插件 row 配置加 betterSidebarShell: false

许可

MIT © KannaKuron。参考与致敬:dsh-ptc-cordis-preset

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-gitbash-shell」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:KannaKuron/dsh-gitbash-shell

Headless(CLI)profile:

dsh plugin --profile headless add github:KannaKuron/dsh-gitbash-shell

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-27 · 标记 webonly
备注:验证: web-only;待 L4 web CDP;L4 web CDP runtime-fail on dsh 0.1.0-rc.8. 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →