truelove-dreamer/dsh-plugin-git-workflow
DeepSeek Harness插件:为模型提供一流的Git工作流工具——仓库状态、差异、带验证消息的提交创建、最近历史记录及分支。无裸shell git调用;每次调用均为无shell的execFile,并带有路径和消息验证。
Project Overview项目介绍
This is a native plugin built specifically for DeepSeek Harness that adds a first-class set of Git workflow tools to the DSH agent environment. Before this plugin, DSH had no built-in Git tools, so the LLM could only interact with Git via raw bash or PowerShell calls. This approach resulted in messy, hard-to-parse output, was prone to errors, and carried a significant risk of shell injection if user input was improperly handled into commands. The plugin wraps all Git interactions into a structured, safe, and parseable toolset.
The plugin includes five core tools that cover common daily Git operations: git_status for checking branch and working tree state, git_diff for viewing changes, git_log for browsing commit history, git_commit for making validated commits, and git_branch for listing local branches. To install the plugin, you can run the one-liner command dsh plugin --profile web add dsh-plugin-git-workflow directly from your DSH terminal, or add it manually to your cordis patch profile or agent preset. Every tool accepts an optional workdir parameter to specify the target repository, defaulting to the current session’s working directory if not set.
All Git calls are run through DSH’s built-in shell executor, with every parameter properly quoted to eliminate shell injection risk, and inherits DSH’s sandbox and approval semantics. Write operations like git add and commit are automatically blocked in read-only sessions, and input validation checks block path traversal attempts and invalid commit messages. The plugin currently does not support network operations like push, pull, or rebase, and commit operations require that the target repository already has user.name and user.email configured for Git.
这是一款专为 DeepSeek Harness 开发的原生插件,为模型代理提供了结构化的 Git 工作流工具集。它解决了 DSH 原生未内置专用 Git 工具的问题,原先代理只能通过 bash/powershell 手动调用 Git,输出原始易错、难以解析,还存在 shell 命令注入的安全风险。
插件提供 5 款核心 Git 工具,分别可查看仓库状态、差异对比、提交历史、分支列表,还支持规范校验后的提交操作。所有工具都支持指定工作目录,默认使用当前会话的工作目录,相对路径会自动基于会话目录解析,满足日常开发中绝大多数 Git 操作需求。
插件可通过 DSH 插件命令一键安装,也可手动在配置文件中挂载。它做了零 shell 注入、输入校验等安全设计,路径不允许跳出仓库,只读会话会禁止提交操作。目前不包含 push、pull、rebase 等网络操作,提交还依赖仓库本身预先配置好 Git 用户信息。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-plugin-git-workflow(truelove-dreamer/dsh-plugin-git-workflow)
仓库:https://github.com/truelove-dreamer/dsh-plugin-git-workflow
本站详情页:https://www.yhbd.top/plugins/truelove-dreamer-dsh-plugin-git-workflow/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 2 · 最近提交 2026-08-17 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-plugin-git-workflow
把 truelove-dreamer/dsh-plugin-git-workflow 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-plugin-git-workflow
DeepSeek Harness 插件:给模型提供一等公民的 Git 工作流工具 —— 仓库状态、diff、规范 commit、历史、分支,不再需要裸 bash/pwsh 手搓 git。
背景
DSH 内置没有任何 git 工具。模型只能通过 bash/pwsh 调用 git,输出原始、易错、难解析,还容易把用户输入拼进 shell 命令(注入风险)。这个插件把 Git 变成结构化、安全、可解析的工具集。
工具
| 工具 | 作用 |
|---|---|
git_status |
分支、upstream、ahead/behind、staged / unstaged / untracked / conflicts 清单(porcelain 解析) |
git_diff |
工作区 diff 或 staged diff(--cached),支持 --stat 摘要、路径过滤、行数截断 |
git_log |
最近提交(hash/日期/subject),可选 files 列出每个提交改动的文件 |
git_commit |
校验 message 后 git add(可选路径)+ git commit -m;清晰报出 "nothing to commit" |
git_branch |
本地分支列表,标记当前分支 |
安装
dsh plugin --profile web add dsh-plugin-git-workflow
挂载(profile cordis.patch.yml 或 agent preset):
- insert:
- id: git-workflow
name: dsh-plugin-git-workflow
使用
git_status # 看当前仓库状态
git_diff # 看未暂存改动
git_diff staged: true # 看已暂存改动
git_commit message: "fix: ..." # 提交(全部已暂存内容)
git_commit message: "feat: ..." paths: ["src/a.js"] # 先 add 再提交
git_log count: 20 files: true # 最近 20 条 + 改动文件
git_branch # 分支列表
所有工具都接受 workdir(默认会话工作目录,相对路径按会话目录解析)。
设计说明
- 零 shell 注入:所有 git 调用经 harness 的 shell 执行器(
ctx.shell)运行,参数逐个引号转义,用户输入不可能被解释为 shell 语法——同时继承沙箱与审批语义(read-only 会话无法 commit)。 - 输入校验:commit message 非空、≤2000 字符、无 NUL;路径拒绝绝对路径与
..穿越(反斜杠归一化后检查),保证不越出仓库。 - 纯逻辑可单测:解析(porcelain / diff-stat / log / branch)与校验全部在
lib/git.js纯函数里,npm test零依赖。 - 结构化输出:每个工具返回带 schema 的 JSON,render 输出可读文本;失败返回
{ ok:false, exitCode, message }而非裸报错。
诚实边界
- git 调用经 harness 的 shell 执行器(
ctx.shell)运行,继承沙箱与审批语义;路径校验是词法级的,符号链接/工作树外路径依赖 git 自身约束。read-only 模式下写操作(git add / commit)会被沙箱拒绝。 - commit 需要仓库已配置
user.name/user.email(git 自身报错会透传)。 git_log的files解析假设--name-status输出格式;非常规编码的路径可能显示不完整。- 不含 push / pull / rebase 等网络操作(后续版本可加,需审批语义配合)。
本地开发
cd plugins/dsh-plugin-git-workflow
npm test # node --test,零依赖
接线集成测试(需 harness checkout 的 Cordis):见仓库根 test-wiring.mjs。
omdsh-dev/DSH-better-sidebar
LiPu-jpg/Openwrite
cocode-agency/cocode
drewnekota/cetus
cosyncing/cosyncing
UNLINEARITY/dsh-code
Cerbur/clutch-dsh
cofy-x/dsh-console