dshbase

插件目录 / Developer / dsh-plugin-git-workflow

dsh-plugin-git-workflow

未验证 truelove-dreamer

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
语言
2026-08-17最近推送
跨平台平台

功能简介

DeepSeek Harness plugin: first-class Git workflow tools for the model — repo status, diffs, commit creation with validated messages, recent history, and branches. No bare-shell git calls; every invocation is a shell-free execFile with path and message validation.

我们的评价
未验证 — 尚未实测

DeepSeek Harness plugin: first-class Git workflow tools for the model — repo status, diffs, commit creation with validated messages, recent history, and branches. No bare-shell git calls; every invocation is a shell-free execFile with path and message validation. 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

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_logfiles 解析假设 --name-status 输出格式;非常规编码的路径可能显示不完整。
  • 不含 push / pull / rebase 等网络操作(后续版本可加,需审批语义配合)。

本地开发

cd plugins/dsh-plugin-git-workflow
npm test          # node --test,零依赖

接线集成测试(需 harness checkout 的 Cordis):见仓库根 test-wiring.mjs

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-git-workflow」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:truelove-dreamer/dsh-plugin-git-workflow

Headless(CLI)profile:

dsh plugin --profile headless add github:truelove-dreamer/dsh-plugin-git-workflow

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →