deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yunuo110/dsh-gitbash
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English · 中文
DeepSeek Harness(DSH)bundle 插件:不新增模式、不新增工具,在 Windows 上把 DSH 现有的 bash 工具直接指向 Git for Windows Bash,并隐藏/禁用 pwsh,让模型自然使用 Git Bash。
参考了 Reasonix 的做法。
gitbash 工具,模型看到的还是 DSH 原生的 bash 工具。bash 工具通过 Git\bin\bash.exe -lc <command> 执行。pwsh 从 prompt 中隐藏,并且即使旧缓存尝试调用也会被 guard 拒绝。bash 工具描述被改写为 Git Bash/MSYS2 规则,模型按 bash 语法写命令。dsh-gitbash/
├── package.json
├── cordis.patch.yml # 插入 dsh-gitbash,禁用 pwsh,启用 bash
├── lib/
│ ├── index.js # shell provider + prompt 改写 + guard
│ └── gitbash-core.mjs # 纯函数:路径探测/argv/渲染/校验
└── test/
└── gitbash-core.test.mjs
在插件仓库根目录执行。如果你是从 GitHub clone 的,先进入 clone 出来的目录:
cd dsh-gitbash
新版 DSH 的
dsh plugin命令会把参数转发给pnpm。安装前请先确认本机已有pnpm(例如执行pnpm --version);没有的话先运行npm install -g pnpm。
dsh 已经在 PATH 里直接执行:
dsh plugin --profile web add .
npx @deepseek-ai/dsh web 启动 DSH很多人的 DSH 不是全局安装的,dsh 命令并不在 PATH 里。如果你平时是这样启动的:
npx @deepseek-ai/dsh web
那么安装插件也要通过 npx 调用:
npx @deepseek-ai/dsh plugin --profile web add .
注意:这条命令要在插件仓库根目录下执行,因为 add . 的 . 指向当前目录。
如果你希望以后能直接使用 dsh 命令,可以先把 DSH 装到全局:
npm install -g @deepseek-ai/dsh
之后就能直接:
dsh plugin --profile web add .
安装会:
dsh-gitbash 作为 bundle 加入 ~/.dsh/profiles/web;shell executor;tool-bash;pwsh-sandbox / tool-pwsh。然后完整重启 DSH。之后新建会话和旧对话都会使用同一个 bash 工具,但它实际执行 Git Bash。
如果你不想依赖本地源码目录,可以直接从 GitHub 安装:
dsh plugin --profile web add github:yunuo110/dsh-gitbash
如果你之前装过本地版本,先移除再安装:
dsh plugin --profile web remove dsh-gitbash
dsh plugin --profile web add github:yunuo110/dsh-gitbash
建议锁定版本,避免以后仓库变更悄悄影响你(当前最新 tag:v0.1.1):
dsh plugin --profile web add github:yunuo110/dsh-gitbash#v0.1.1
这样 profile 里保存的是 GitHub 依赖,而不是本地 link 依赖,DSH 更新不会把它刷掉。
bash 工具,描述会说明它运行 Git Bash。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 宽限 |
bash.exe -lc:不保留 cd / export / alias 状态。$VAR、export、ls、grep、find、sed、awk、管道、&&/||、命令替换。/d/WorkSpace 或 C:/WorkSpace;避免未加引号的反斜杠。$VAR / ${VAR},不要用 PowerShell 的 $env:VAR。bash 工具的 workdir、timeoutMs、run_in_background、sandbox_permissions + justification。只对比原版 DSH 配置与本插件的差异:
| 配置 | 可见 shell 工具 | 额外系统提示 | 每轮 token 影响 |
|---|---|---|---|
| 原版 DSH(Windows) | pwsh |
无 | 基准 |
| 本插件 | bash(实际执行 Git Bash) |
无 | 基本持平(只是用 bash schema 替换 pwsh schema,没有新增额外工具) |
npm run check
当前测试覆盖:Git Bash 路径探测、argv 构造、环境变量合并、参数校验、超时钳制、workdir 解析、结果渲染、配置校验、shell 工具过滤。
0.1.2-rc.1(兼容 0.1.0-rc.6 起的同一套 shell/工具 seam)本工具完全由 DSH 制作而成。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。