codel6i/dsh-shell-switch ↗★ 0

dsh-shell-switch

Shell switch panel for the dsh Windows desktop: run the agent's commands through PowerShell or Git Bash, chosen from Settings → Shell. 适合需要在PowerShell与Git Bash之间灵活切换以执行Agent命令的用户。

패키지
dsh-shell-switch
호환성
미검증
버전
0.1.8
라이선스
MIT
최근 업데이트
2026. 10. 2.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:codel6i/dsh-shell-switch

使用

面板有两个入口,内容相同:

  • 设置 → Shell:左下角账户/设置入口打开设置面板,左侧导航里的 Shell;
  • 插件 → dsh-shell-switch → 点开 dsh-shell-switch 这一行:该行的配置页就是同一个面板 (即 dsh 的 plugins.row.config 槽,key 为 dsh-shell-switch#shell-switch)。

面板内容:

  1. 当前 shell 二选一:PowerShell / Git Bash;
  2. (可选)Git Bash 可执行文件:留空即自动探测;探测失败时在这里填 bash.exe 绝对路径;
  3. (可选)隐藏未启用的 shell 工具:默认开;关掉则两个工具都留在列表里,未启用的那个仍会拒绝调用。

面板下半部分随选择变化:选中哪一项,就换成那一项的说明卡片——执行器(含解析到的路径与来源)、 路径风格、环境变量、模型当前拿到的工具,以及另一个工具的下场(已隐藏 / 仍列出但会被拒绝); 再下面是只影响 Git Bash 的路径设置与隐藏开关,最后一行是宿主实时状态。

面板下方那行是宿主实时状态(面板从 GET /shell-switch/status 读取,经 dsh 的连接鉴权), 例如 已找到 Git Bash:D:\Application\DevTool\Git\bin\bash.exe(来自 git --exec-path)· 模型当前拿到的 shell 工具:pwsh。 它直接回答"到底认没认出来":路径、来源、以及此刻模型手上的 shell 工具;读不到时明确写"读不到宿主状态",不猜。

插件页里那行 cordis:group(id 是 shell-switch-bash)是容器行,它自身没有插件实现, 所以点它的启用开关会报"找不到该插件"——这是正常的,不影响功能; 真正在运行的是它下面两行:@deepseek-ai/dsh-bash-sandbox(执行器)和 @deepseek-ai/dsh-tool-bash(bash 工具)。 需要隔离 realm 才能让第二个 shell 服务与 dsh 自带的 pwsh-sandbox 共存,所以这一层容器去不掉。

写入落在 profile 的 cordis.patch.yml:

- id: shell-switch
  name: dsh-shell-switch
  config:
    activeShell: gitbash      # pwsh | gitbash
    gitBashPath: ''           # 留空 = 自动探测
    hideInactiveTool: true

怎么确认切换生效

  • 让模型跑一条命令:pwsh 档会走 PowerShell,gitbash 档会走 Git Bash(uname -s 返回 MINGW64_NT-...);
  • 切换后模型手里的工具名会立刻换挡,系统提示词里也会写明当前 shell 与 Git Bash 的真实路径。

配置项

字段类型默认说明
activeShellpwsh | gitbashpwsh当前 shell,面板写入的就是它
gitBashPathstring''bash.exe 绝对路径;留空自动探测
hideInactiveToolbooleantrue是否把未启用的 shell 工具从模型工具列表中隐藏