← 返回列表
⚠ 装前注意
管理多平台 Git 账号,按项目授权并拦截越权推送
基本兼容但装前注意:未发布到 npm registry,仅可从源码安装 · 最近上游提交 2026/9/8 · 已提供中文文档
DSH 社区插件:GitHub/Gitea 账户、项目授权、推送策略(better-sidebar)
综合分
34.9
GitHub 分
34.9
用户评分
—
★ Stars
1
周下载量
—
兼容 / 相关生态插件(非 dsh 原生,请按其对应运行时安装)
git clone https://github.com/thirsty5034/dsh-git-forge.git数据截至 2026/9/16(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
安装兼容性检查⚠ 装前注意
以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。
✗npm 包dsh-git-forge(未发布到 npm,仅可源码安装)
✓Node 引擎要求 >=18 · 基线 Node 22.19 满足
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明
未发布到 npm registry,仅可从源码安装
验证方式:npm registry 存在性 + package.json 静态校验 · 最后验证 2026/9/18 02:58:21
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动
README
dsh-git-forge
DeepSeek Harness 社区插件:在 dsh-better-sidebar 中提供 Forge 账号库 + 按项目授权 + push 策略。
- 账号库:GitHub / Gitea / GitLab / Gitee / Bitbucket
- 按项目授权(projectPathKey = 工作区 cwd)
- push 拦截:已授权项目下,bash 的 git push / git remote add|set-url 指向未授权 host 会被拒绝
- Token 存 $DSH_HOME/git-forge/secrets.json(0600),不进模型上下文
- 模型工具 GitForge(只读策略)
- Agent HTTPS git:侧栏授权后,agent bash 中的 git fetch/push 等可通过 Host credential helper 使用对应账号(token 永不进模型;同 host 多 token 账号时需只保留一个授权 = R1)
- UI 对齐 dsh-ssh-tunnel
SSH 远程与系统 gh auth 仍走本机 SSH/gh。HTTPS 在 DSH agent shell 下由本插件 helper 按项目授权注入;插件同时负责「这个项目允许推到哪」(push guard)。
环境要求
- 已安装 dsh-better-sidebar(≥ 0.12)的 web profile
- Node.js 18+
安装
macOS / Linux(Windows 可用 Git Bash / WSL):
curl -fsSL https://raw.githubusercontent.com/thirsty5034/dsh-git-forge/main/scripts/install.sh | bash
Windows(PowerShell 5.1+ / pwsh):
irm https://raw.githubusercontent.com/thirsty5034/dsh-git-forge/main/scripts/install.ps1 | iex
或直接用 DSH CLI(在发布到 npm 之前默认走 GitHub 源):
export DSH_HOME=${DSH_HOME:-$HOME/.dsh}
dsh plugin --profile web add "dsh-git-forge@github:thirsty5034/dsh-git-forge"
dsh --profile web --dump-config | grep git-forge
装完后:重启 dsh web,浏览器 硬刷新(Cmd/Ctrl+Shift+R)。
可选参数 / 本地 link / 日后 npm
curl -fsSL .../install.sh | bash -s main --restart
bash scripts/install.sh --from npm 0.1.1
dsh plugin --profile web add "dsh-git-forge@link:/path/to/dsh-git-forge"
可发现性
- GitHub topics:dsh-plugin、deepseek-harness、dsh(dsh.so 自动收录所需)
- 当前请从 GitHub 安装:见上文 安装
- 商店目录可能滞后于爬虫;以本仓库为准
数据目录
$DSH_HOME/git-forge/(建议 0700):
| 文件 | 用途 |
|------|------|
| accounts.json | 账号元数据(无 token) |
| secrets.json | token(0600) |
| grants.json | projectPathKey → accountIds[] + enforce / unbound 策略 |
侧栏
1. 项目授权 — 当前项目可用账号 + 是否 enforce push
2. 账号库 — 增删改、探测 API token
3. 策略状态 — 当前允许的 gitHost;全局「未绑定项目」策略
模型工具
GitForge action=list_accounts
GitForge action=get_policy
GitForge action=list_project_accounts
GitForge action=check_remote url=git@github.com:org/repo.git
Agent HTTPS 与项目路径
- 授权 key = DSH 会话工作区(shell 注入 DSH_GIT_FORGE_PROJECT),不是子仓路径
- helper:env → cwd 精确匹配 → /workspace 下向父目录 walk
- R1:同 host 仅当恰好 1 个已授权 token 账号时自动注入
- push guard:命令中的 URL 以及 裸 git push/git push origin(解析 remote)
安全
- API / 工具结果不得包含 token
- push 策略在 Host tools.guard 中硬拦截
- Agent HTTPS:credential helper 仅在 Host 内读 secrets.json;同 host 多 token 账号时不自动选号(R1)
- 未给项目配置任何授权时,push guard 默认 不拦截(便于渐进启用);helper 也不会凭空给凭据
开发
npm test
npm run check
./scripts/sync-to-dsh.sh
许可证
MIT — 见 LICENSE。同作者(thirsty5034)的其他插件
扫码进群