tianxingdao/dsh-shell-switch ↗★ 0
dsh-shell-switch
提供本地Shell选择器以切换运行环境 适合Windows等平台下,需要自由切换Git Bash、MSYS2等不同终端执行命令的用户。
同名包的其他仓库
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tianxingdao/dsh-shell-switch说明文档
阅读完整 README ↗使用
bash 工具
bash: {
command: "git status --short && npm test",
workdir: "", // 可选,默认会话工作目录
timeoutMs: 120000 // 可选,受配置上限约束
}
- 每次调用都是全新 shell,
cd/ 变量 / 函数不跨调用保留; - 结果末尾是机器可读标记:
[exit code: N]、[killed by signal]或[timeout after N ms]; - 输出超限会截断并提示,完整流在 spill 文件里;
- 与官方 bash 工具一样支持
run_in_background(配合job_output/job_kill)。
设置 → Shell 选择器
- 下拉框分两组:可用于 bash(可选择)与 已检测到,但不是 bash 方言(WSL bash、PowerShell、cmd、Niubash 的
winuxsh.exe,禁用并标注原因); - 每个 bash 显示版本(如
5.3.0)与完整路径; - 卡片显示当前生效 shell、已保存选择、回退配置、沙箱模式;
- 保存:写入
%DSH_HOME%\shell-switch.json,下一条命令生效; - 恢复默认:清除选择,回落到插件配置的
shell/shellPath/ 自动检测; - 重新扫描:忽略 15 秒缓存重新检测(装了新 shell 后点一下)。
隐藏 pwsh(Windows)
本插件启用期间,Windows 下每个 Agent 的工具列表都会去掉 pwsh。这不是改组合、也不是卸载官方插件,而是在 Agent 作用域上加一条 deny 过滤,随插件卸载释放。
- 现存与新建 Agent 都生效,下一条模型请求即可看到新工具列表;
- 想恢复:停用或卸载本插件。
配置
profile patch 中的 shell-switch 行:
- id: shell-switch
name: dsh-shell-switch
config:
shell: auto
| 字段 | 默认 | 说明 |
|---|---|---|
shell | auto | 预设 shell id:niubash、git-bash、msys2、cygwin、bash、wsl 等;auto 取第一个 bash 兼容项 |
shellPath | 空 | 显式可执行文件路径,优先于 shell |
timeoutMs | 120000 | 前台命令默认超时 |
maxTimeoutMs | 600000 | 单次 timeoutMs 上限 |
maxOutputBytes | 64000 | 单流输出内存上限,超出转存 spill 文件 |
maxSpillBytes | 67108864 | spill 文件上限 |
graceMs | 3000 | 终止到强杀的宽限期 |
选择优先级:设置页保存的路径 → shellPath → shell → 自动检测。
%DSH_HOME%\shell-switch.json(设置页保存的值):
{
"shell": {
"path": "",
"at": "2026-01-01T00:00:00.000Z"
}
}