LoserFox/dsh-git-identity
DSH 插件:git 提交固定使用环境自身作者身份(优先 gh CLI 登录账号,GitHub noreply 邮箱),GIT_AUTHOR_*/GIT_COMMITTER_* 环境变量注入压过一切 git config
Project Overview项目介绍
This plugin is built exclusively for DeepSeek Harness (DSH) version 0812 and newer, running on DSH’s official profile bundle plugin system. It solves a common problem where DSH git commits end up with the wrong author identity because of hardcoded DSH Agent configuration in the agent session. The core feature forces all git commits made inside DSH to use the user’s correct git identity, following a fixed four-level priority order for identity resolution. To install the plugin, you check out the repository, then run DSH’s plugin add command to register it to your target DSH profile, such as web or headless.
The four priority levels start with explicitly configured name and email set by the user in the plugin’s config, which is the most reliable option for users not logged into the gh CLI. Next, it pulls the currently logged-in user from the gh CLI, taking the login as the name and using GitHub’s standard no-reply email format. Third, it picks up existing GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL variables from the DSH startup environment. Finally, it falls back to the user’s existing global git config name and email.
After installation, you need to restart the DSH process for your target profile because composition layer changes do not support hot module replacement. Once loaded, the plugin writes the resolved identity to four git environment variables that DSH passes to all child bash processes, and since git prioritizes these environment variables over all config files, every commit will use the correct identity. It also syncs the identity to the global git config idempotently to keep external terminal commits consistent. The plugin is pure ESM JavaScript with zero dependencies, so no build step is needed after editing.
这是一个专门为 DeepSeek Harness 0812+版本官方插件系统开发的原生配置包插件,核心作用是让DSH内所有git提交都使用正确的用户身份,避免因会话默认配置导致提交作者错误。它遵循固定的身份解析优先级:最高优先级是用户显式配置的信息,其次是gh CLI登录账号,接着是DSH启动环境变量,最后用全局git配置兜底,解析失败时只会告警,不会生成无效身份。
它的工作原理是,插件加载时会把解析好的身份写入GIT_AUTHOR_NAME、GIT_AUTHOR_EMAIL等四个环境变量,DSH的子进程层会把处理后的环境变量传递给每个bash子进程,而git本身的环境变量优先级高于所有配置文件,所以能保证DSH内任何路径发起的提交都使用正确身份。它还会幂等同步身份到全局git配置,让DSH外的普通终端提交也保持身份一致。
安装需要使用DSH的内置插件管理命令,将本仓库检出后通过dsh plugin --profile <名称> add命令添加到对应配置文件,安装完成后必须重启对应profile的DSH进程,因为组合层变更不支持热更新。用户可以通过YAML配置显式钉住姓名和邮箱,插件本身是零依赖的纯ESM代码,修改后直接生效不需要重新构建。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-git-identity(LoserFox/dsh-git-identity)
仓库:https://github.com/LoserFox/dsh-git-identity
本站详情页:https://www.yhbd.top/plugins/loserfox-dsh-git-identity/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 6 · 最近提交 2026-08-13 · 主语言 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 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
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 github:LoserFox/dsh-git-identity
把 LoserFox/dsh-git-identity 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
git-identity
DSH profile bundle(0812+ 的官方插件系统):让 DSH 内产生的所有 git 提交使用
环境自身的作者身份。优先读取 gh CLI 的登录账号(name 取 login,email 取 GitHub
noreply 地址 <id>+<login>@users.noreply.github.com),其次启动环境的
GIT_AUTHOR_*、git config --global 兜底。
为什么需要它
DSH 的 agent 会话通过 bash 工具执行 git commit。历史上一旦某个会话显式
-c user.name="DSH Agent" 或改掉了 git 配置,后续提交就会带着错误的作者。
本插件在加载时把解析到的身份写入 GIT_AUTHOR_* / GIT_COMMITTER_* 四个环境变量,
DSH 的 subprocess 层会把 process.env(剔除凭据)传给每个 bash 子进程,而 git 的
环境变量优先级高于一切 git config——所以 DSH 内任何路径发起的提交都必然使用该身份。
同时幂等同步回 git config --global,让插件进程外的普通终端提交也保持一致
(仅当 global 配置缺失或被改错时写回)。
安装(0812 profile bundle 系统)
# 从本仓库 checkout 安装到 profile(web / headless 等),bundle 声明自动加入组合层
dsh plugin --profile web add /path/to/dsh-git-identity
dsh plugin --profile headless add /path/to/dsh-git-identity
# 验证
dsh --profile web --dump-config | grep git-identity
安装后需重启目标 profile 的 DSH 进程(组合层变更不参与 HMR 热更新)。
身份解析优先级
- 插件配置
{ name, email }(显式钉死,最稳;未登录 gh 时可在此配置) - gh CLI 登录账号(
gh api user) - 启动环境的
GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL git config --global user.name/user.email兜底
全部解析不到时只告警、不注入,绝不凭空编造身份。
配置
# 在 bundle 的 patch 里给行加 config(可选;不配置则按上述优先级自动解析)
- insert:
- id: git-identity
name: '@loserfox/git-identity'
config:
name: LoserFox
email: 57448027+LoserFox@users.noreply.github.com
开发
编辑 index.mjs 后无需构建(纯 ESM,零依赖)。package.json 的
dsh.bundle.patch 声明本包是一个 profile bundle;cordis.patch.yml 是它贡献的
组合层。
yannicksong0106/dsh-550c-boot
omdsh-dev/dsh-advisor
shuguang1994/project-blueprint
SummerSec/AI-Inner-Os
wlj521/dsh-ui-tweaks
PelyDeng/dsh-plugin-manager
codeAnqiang-ma/dsh-superpowers