DSH Plugins Marketplace

DSH Plugins

Plugins

/

Security & Audit

/

dsh-github

C

dsh-github

Manifest valid★ 3

DeepSeek Harness (DSH) GitHub Integration Plugin: After a single authentication (GITHUB_TOKEN or OAuth Device Flow), the model can directly invoke 45 github_* tools to create a repo, push, open a PR, manage issues, search code, and more; routine read/write operations are allowed through, while dangerous operations (delete/force push/merge PR/close issue) keep an approval gate; tokens are stored in the DSH credentials service and never written to logs. Comparable to opencode's GitHub MCP.

hasBundlePatch

dsh-github — DeepSeek Harness 的 GitHub 集成插件

对标 opencode 的 GitHub MCP server:一次配置认证,长期可用。模型在对话中直接调用 github_* 工具完成建仓、推送、提 PR、管 issue、搜索代码等 GitHub 事务,不再每次操作 都要求临时授权。

  • 零依赖(只用 Node 22+ 内置模块),45 个工具,全部走 GitHub REST API v3
  • 认证持久化:GITHUB_TOKEN(环境变量 / DSH credentials 服务)或 OAuth Device Flow (浏览器授权一次,token 自动写入 $DSH_HOME/.credentials.yaml,重启 DSH 依然有效)
  • 审批策略:读操作 + 常规写操作直接放行;删除仓库/文件/分支、force push、合并 PR、 关闭 issue/PR 保留审批门
  • DNS 韧性:系统解析(hosts)把 github 域名指向 127.0.0.1(屏蔽/坏条目)时自动改用 DNS 直查绕过,github_* 工具不因 hosts 文件被改坏而失效
  • 安全:token 只进 Authorization 请求头,绝不落日志;错误信息与工具输出做防御性脱敏

快速开始

1. 安装插件(web + desktop 两个 profile)

powershell -ExecutionPolicy Bypass -File .\install.ps1
# 只装一个 profile:powershell -ExecutionPolicy Bypass -File .\install.ps1 -Profiles desktop

安装脚本会:

  1. 把插件包复制到 %USERPROFILE%\.dsh\profiles\node_modules\dsh-github\
  2. 在 web 与 desktop 两个 profile 的 cordis.patch.yml 追加注册条目(幂等)

重启 DSH Desktop(或重载 web profile)后生效。

2. 配置认证(二选一,均持久生效)

方式 A — Personal Access Token(推荐先试这个)

# 1) 在 GitHub → Settings → Developer settings → Personal access tokens 生成
#    (需要 repo、read:org、user 权限)
# 2a) 环境变量(最简单)
setx GITHUB_TOKEN "ghp_xxx"        # 新开的终端/重启 DSH 后生效
# 2b) 或写入 DSH credentials($DSH_HOME/.credentials.yaml,密码学托管、不落日志)
#     DSH 设置页 → 凭据 → 新增 GITHUB_TOKEN → 粘贴 token

方式 B — OAuth Device Flow(浏览器授权一次)

  1. 在 GitHub 创建一个 OAuth App(Settings → Developer settings → OAuth Apps), Authorization callback URL 填任意合法 URL(如 https://github.com)
  2. 把 Client ID 填入插件配置(两个 profile 的 cordis.patch.yml):
- insert:
    - id: github
      name: dsh-github
      config:
        tokenRef: GITHUB_TOKEN
        approvalGate: true
        timeoutMs: 30000
        oauthClientId: Ov23liXXXXXXXX
        oauthClientSecretRef: GITHUB_OAUTH_CLIENT_SECRET   # 推荐:凭据引用
        # 或直接内联(不推荐明文):oauthClientSecret: xxxx
  1. 设置 Client Secret 凭据:DSH 设置页新增 GITHUB_OAUTH_CLIENT_SECRET (或环境变量 GITHUB_OAUTH_CLIENT_SECRET)。GitHub 的 device flow 换取 token 必须携带 client secret。
  2. 重启 DSH,新会话中对模型说「用 github_auth_login 登录 GitHub」, 浏览器打开返回的网址、输入用户码,授权一次即可;token 自动持久化,之后长期可用。

GitHub device-flow 的 access token 长期有效、没有 refresh token 机制; 若失效(表现为 401),调用 github_auth_logout 清除后重新登录即可。

3. 验证

新会话中让模型执行:

  • github_get_me —— 应返回当前 GitHub 用户(等价 opencode 的 get_me)
  • github_auth_status —— 认证来源与有效性

常用流程示例

一键上传项目(建仓 → 推送 → 开 PR 全流程,常规操作无审批弹窗):

github_upload_project(repo: "my-app", description: "我的应用",
  files: [{path: "README.md", content: "# my-app"}, {path: "src/main.js", content: "..."}],
  create_pull_request: true)

手把手流程(等价 opencode push 多文件的体验):

1. github_create_repository(name: "my-app", private: true)
2. github_create_branch(owner, repo, branch: "feature/init")
3. github_push_files(owner, repo, branch: "feature/init", message: "init", files: [...])
4. github_create_pull_request(owner, repo, title: "init", head: "feature/init", base: "main")
5. github_merge_pull_request(owner, repo, pull_number: 1, merge_method: "squash")  # 🔒 需审批

工具清单

见 TOOLS.md(45 个工具分 9 类,含危险操作清单)。

审批门规则

操作工具/参数审批
删除仓库github_delete_repository🔒
删除文件github_delete_file🔒
删除分支github_delete_branch🔒
force pushgithub_push_files + force: true🔒
合并 PRgithub_merge_pull_request🔒
关闭 issue / 关闭 PRgithub_update_issue / github_update_pull_request + state: closed🔒
其余读/写—✅ 直接放行

审批通过 tools/pre-execute → ctx.approval 实现(与 DSH 内置 dsh-user-approval 一致):allowed-once 才放行,拒绝/取消/无审批通道一律 fail closed。 config.approvalGate: false 可关闭审批门(不推荐)。

配置项

配置默认说明
tokenRefGITHUB_TOKENPAT 凭据引用名(env / credentials 键名)
oauthClientId—GitHub OAuth App Client ID(Device Flow)
oauthClientSecret—Client Secret(直接内联,不推荐)
oauthClientSecretRefGITHUB_OAUTH_CLIENT_SECRETClient Secret 凭据引用(推荐)
oauthScoperepo,read:org,userDevice Flow 申请的 scope
approvalGatetrue危险操作审批门开关
timeoutMs30000GitHub 请求超时

开发与测试

node tests/run-all.mjs    # 需要本机安装 DSH Desktop(loader 引用其 dsh-tools)

测试覆盖:

  • validate-tools.mjs — 45 个工具经 DSH 真实 dsh-tools 的 schema 编译/校验、render 健壮性
  • validate-apply.mjs — apply() 生命周期 + 审批门行为(危险→ask、常规→放行)
  • approval-gate.mjs — 危险操作分类单测
  • redaction.mjs — 验收:token 不出现在日志/错误/工具输出
  • push-upload.mjs — 内存版 GitHub API 上的多文件推送与一键上传流程(建仓→推送→开 PR)

架构

index.js                插件入口:apply() 注册审批门 + systemPrompt 引导 + 45 个工具
lib/client.js           GitHub REST 客户端(fetch、错误映射、token 脱敏)
lib/auth.js             PAT/credentials 解析 + OAuth Device Flow 状态机
lib/approval.js         危险操作分类 + tools/pre-execute 审批门
lib/push.js             共享推送实现(blob→tree→commit→ref)
lib/format.js           输出渲染 / presentCall 辅助
lib/tools/*.js          分域工具定义(auth/repos/issues/pulls/commits/search/releases/orgs/workflow)

许可

MIT

Compatibility

DSH 0.1.6-alpha.2: failedDSH 0.1.7-alpha.1: failedDSH 0.1.7-alpha.2: failed

Versions

Latest versionPublishedSize
0.1.0——

Comments

Loading…

From the same category

dsh-infinite-gen-3

System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status bad

Security & AuditManifest valid

★ 3.3k

MIT

C#

dsh plugin --profile web add dsh-infinite-gen-4

by ADWMC

DeepSeek Harness 破甲一体化安全分析插件:Android · Web · Native · Protocol · Malware · AI-Security 全领域聚合(9 bundle + 1 preset)

Security & AuditManifest valid

★ 1.1k

MIT

Python

Nov 4, 2026

Index only — not installable

by toby-bridges

Local security audit for AI API relays and LLM proxies: detects prompt injection, model substitution, tool-call rewriting, SSE anomalies, error leakage, and Web3 wallet risks.

Security & AuditManifest valid

★ 906

↓ 333/wk

AGPL-3.0

Python

Oct 27, 2026

dsh plugin --profile agent add dsh-api-relay-audit

by SeaOf0

基于dsh web实现的多种模式,目的是服务于redteam进行授权的安全研究,覆盖渗透测试、红队评估、代码审计等范围领域,请勿用于非法行为。(允许二开,赋予模块各位自己的业务逻辑,方法论只有自己熟练的才好用,好的方法论=好的生态)

Security & AuditManifest valid

★ 836

MIT

Python

Oct 27, 2026

dsh plugin --profile web add @dsh-external/dsh-redteam-model

by agentic-os-org

ANOLISA (Agentic Nexus Operating Layer & Interface System Architecture) | Agentic OS with runtime, security, observability, and Tokenless response compression for lower token usage and cost.

Security & Audit

★ 659

Apache-2.0

Rust

Nov 6, 2026

Index only — not installable

by howmp

面向 DeepSeek Harness(dsh)的渗透测试模式 @CloverSecLabs

Security & AuditManifest valid

★ 616

↓ 773/wk

NOASSERTION

JavaScript

Oct 9, 2026

dsh plugin --profile web add @howmp/dsh-pentest