MAXeaglet/dsh-bash-terminal ↗★ 21

dsh-bash-terminal

支持在Web端切换默认终端的Shell工具 适合在Windows上需要AI调用特定终端执行命令的用户。

套件
dsh-bash-terminal
相容性
待驗證
Harness 依賴範圍
^0.1.5-rc.1
Cordis 依賴範圍
^4.0.2
版本
0.3.15
授權
MIT
最近更新
2026年9月11日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:MAXeaglet/dsh-bash-terminal

使用

用户在 Web UI 设置默认终端:打开设置(齿轮)→ 通用 →「默认终端」下拉,选择 PowerShell / Git Bash / WSL 之一。改动即时生效并持久化。

模型看到 shell 工具后,执行命令时自动使用你选择的终端(工具不暴露终端参数,模型无法更改你的选择):

  • 默认终端 = Git Bash 时:shell(command: "git status") 走 Git Bash
  • 默认终端 = WSL 时:shell(command: "ls -la /mnt/d/WorkSpace") 走 WSL;传 distro: "Ubuntu" 可指定发行版
  • 默认终端 = PowerShell 时:shell(command: "Get-Process node") 走 PowerShell

模型使用示例

  • 一次性命令(默认终端):shell(command: "git status", description: "查看 git 状态")
  • 跨轮保持状态(交互式):terminal(action: "open") → 记下 sessionId → terminal(action: "send", sessionId, input: "cd /d/project\n") → terminal(action: "send", sessionId, input: "npm run dev\n") → terminal(action: "close", sessionId)
  • 中断正在运行的程序:terminal(action: "signal", sessionId, signal: "SIGINT")
  • 查看活动会话:terminal(action: "list")
  • 沙箱拒绝后升级:shell(command: ..., sandbox_permissions: "workspace-write", justification: "...")

配置

Web UI 设置(推荐):设置 → 通用 →「默认终端」。

插件 row 的 config(覆盖默认,作为设置的 composition 基准):

键默认说明
defaultShellpowershell设置未覆盖时的后端
timeoutMs120000默认超时
maxTimeoutMs600000调用方 timeoutMs 上限
pwshPath自动探测固定 pwsh.exe 路径
gitBashPath自动探测固定 git bash.exe 路径
wslPath自动探测固定 wsl.exe 路径