让智能体直接调 API、批量提交文件并建仓库
29/100
综合分
0
GitHub 星标
—
npm 周下载
—/5
用户评分
数据截至 2026/11/2 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add KNLCXY/dsh-github该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)
状态速览
判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态信任档位:仅索引
是什么
dsh 原生插件 · market
装得上吗
本站尚未做安装检查
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
活跃:最近一次提交在 12 天前
档位由哪些信号合成
本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。
社区实装还没有人打卡 · 装过的第一个就是你
安全扫描自动 · 静态分析源码v2.7.0🔵 扫描:含敏感能力尚无人工评估展开查看扫描说明与证据 ↓
安全扫描自动 · 静态分析源码
v2.7.0静态扫描发现插件具备触达本地系统的能力:执行外部命令、读写/删除本地文件、读取剪贴板或密钥类环境变量(至少其一)。这是能力清单,不是危险判定——具体能力项与证据见下方,安装前请自行判断是否需要。
读写/删除本地文件发起外部网络请求
查看扫描证据(共 18 处,展示前 18 条)
- 读取本地文件lib/index.js:41
return JSON.parse(readFileSync(SETTINGS_PATH, 'utf8')) - 写入本地文件lib/index.js:50
mkdirSync(STORE_DIR, { recursive: true }) - 写入本地文件lib/index.js:51
writeFileSync(SETTINGS_PATH, JSON.stringify(next, null, 2), 'utf8') - 读取本地文件lib/index.js:92
for (const p of readdirSync(profiles)) { - 读取本地文件lib/index.js:95
try { pkgs = readdirSync(base) } catch { continue } - 发起网络请求lib/index.js:216
const req = http.request({ - 发起网络请求lib/index.js:256
const res = await fetch(url, { - 发起网络请求lib/index.js:268
const req = https.request({ - 发起网络请求lib/index.js:303
const res = await fetch(url, { method: 'POST', headers, body, signal: AbortSignal.timeout(timeoutMs) }) - 发起网络请求lib/index.js:310
const req = https.request({ - 读取本地文件lib/index.js:744
buf = readFileSync(file) - 发起网络请求lib/client.js:67
fetch(ENDPOINT, { headers: { accept: "application/json" } }) - 发起网络请求lib/client.js:85
fetch(ENDPOINT, { - 发起网络请求lib/client.js:124
fetch("/_dsh-github/git-auth", { headers: { accept: "application/json" } }) - 发起网络请求lib/client.js:132
fetch("/_dsh-github/git-auth", { - 读取本地文件lib/detect-chrome.mjs:16
const names = readdirSync(dir) - 读取本地文件lib/detect-chrome.mjs:102
try { entries = readdirSync(dir, { withFileTypes: true }) } catch { continue } - 读取本地文件lib/detect-chrome.mjs:123
try { if (existsSync(candidate)) return candidate } catch {}
扫描于 2026/11/3(1 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库
静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-tools给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个
DeepSeek Harness 的 GitHub 工具:调用 REST API、一次提交多个文件、创建仓库。token 放在插件设置里(只是示例占位符,绝不设默认值),不进仓库,也不出现在工具输出中。
README
由 DeepSeek 最新模型翻译生成dsh-github
给 DeepSeek Harness(DSH)用的 GitHub 工具插件。装上之后智能体可以直接:调 GitHub REST API、一次提交多个文件(一个 commit)、建仓库、查这个 token 是谁的。
token 你自己填 —— 在 设置 → GitHub 里粘一次,之后每个会话都能用。设置里那格只有示例占位符,没有默认值;插件源码、cordis.patch.yml、任何工具输出里都不会出现你的 token。
github_status 这个 token 是谁的、有什么权限、还剩多少配额(不回显 token) github_api 直接调 REST API(相对路径或完整 URL) github_push_files 一批文件 = 一个 commit(blob → tree → commit → 更新 ref) github_repo_create 建仓库,顺手设 topics github_release_create 建 Release 并上传附件(tgz 等),可标 draft / prerelease github_fix_git_auth 诊断并修 git 凭据弹窗(CredentialHelperSelector)
下载
展开完整文档(README 剩余 1 节)
dsh-github
给 DeepSeek Harness(DSH)用的 GitHub 工具插件。装上之后智能体可以直接:调 GitHub REST API、一次提交多个文件(一个 commit)、建仓库、查这个 token 是谁的。
token 你自己填 —— 在 设置 → GitHub 里粘一次,之后每个会话都能用。设置里那格只有示例占位符,没有默认值;插件源码、cordis.patch.yml、任何工具输出里都不会出现你的 token。
github_status 这个 token 是谁的、有什么权限、还剩多少配额(不回显 token) github_api 直接调 REST API(相对路径或完整 URL) github_push_files 一批文件 = 一个 commit(blob → tree → commit → 更新 ref) github_repo_create 建仓库,顺手设 topics github_release_create 建 Release 并上传附件(tgz 等),可标 draft / prerelease github_fix_git_auth 诊断并修 git 凭据弹窗(CredentialHelperSelector)
下载
不想 clone 就直接去 Release 页拿安装包(每个版本都带 .tgz 和 SHA256SUMS.txt):
→ 全部 Release
版本口径:0.x 一律是预发布(Pre-release,不算 Latest);1.x 起才算正式版。
dsh plugin --profile <你的 profile> add "file:<下载路径>/dsh-github-<版本>.tgz"
校验:同页附件 SHA256SUMS.txt(sha256sum -c SHA256SUMS.txt)。
安装
从 git 装
dsh plugin --profile <你的 profile> add github:KNLCXY/dsh-github
或从目录装(要改代码时)
dsh plugin --profile <你的 profile> add "file:/绝对路径/dsh-github"
装完重启 DSH(插件的宿主半和 client 半都在进程启动时组装一次)。
填 token(唯一的配置步骤)
打开 设置 → GitHub,把 token 粘进第一个输入框,点保存。
| 输入框 | 说明 |
| GitHub token | 只有示例占位符 ghp_xxxxxxxxxxxxxxxxxxxx,没有默认值;不填就是没配 |
| API 地址 | 留空用 https://api.github.com;只有 GitHub Enterprise 才需要改 |
| 代理 | 留空 = 直连。GitHub 直连超时的网络填 http://127.0.0.1:7897 |
也可以直接写文件(等价,改完下一轮工具调用即生效,不用重启):
// ~/.dsh/storages/dsh-github/settings.json
{
"token": "ghp_xxxxxxxxxxxxxxxxxxxx",
"apiBase": "https://api.github.com",
"proxyUrl": "http://127.0.0.1:7897"
}
token 怎么建、要什么权限
| 你想干什么 | 最小权限 |
| 只读仓库、看 issue / PR | Contents: Read(+ Issues: Read) |
| 提交文件(github_push_files) | Contents: Read and write |
| 建仓库、设 topics | 再加 Administration: Read and write |
| 用 classic token 图省事 | 勾一个 repo 就全有了 |
- fine-grained:<https://github.com/settings/personal-access-tokens/new> → 选仓库 → 配上面几项 → Generate
- classic:<https://github.com/settings/tokens/new> → 勾 repo → Generate
建议设过期时间(7–30 天)。不用了随时在同一个页面 Revoke。
工具参考
github_status
不带参数。返回登录名、token 掩码(ghp_…9c31)、scopes、API 配额余量。没配 token 时给一句提示,不报错。
✅ token 可用:KNLCXY token:ghp_…9c31 · 代理:http://127.0.0.1:7897 scopes:repo 配额:4986/5000
github_api
| 参数 | 说明 |
| path | 必填。/repos/owner/repo 这样的相对路径,或完整 https://api.github.com/... |
| method | GET(默认)/ POST / PUT / PATCH / DELETE |
| body | JSON 字符串,只对写操作有意义 |
| max_chars | 返回体上限,默认 6000,超了截断并告诉你原长 |
github_api({ path: "/repos/KNLCXY/dsh-github" })
github_api({ path: "/search/repositories?q=dsh-plugin&sort=stars" })js
github_api({ path: "/repos/KNLCXY/x/issues", method: "POST", body: '{"title":"hi","body":"…"}' })
错误会翻译成人话:401(token 无效或过期)、403(权限不足或限流)、404(仓库不存在或无权访问)。
github_push_files
| 参数 | 说明 |
| repo | 必填,"owner/name" |
| message | 必填,commit message(多行只取第一行做摘要) |
| files | 必填。数组 [{path, content, encoding?}],或对象 {path: content} |
| branch | 默认仓库的 default_branch |
js
github_push_files({
repo: "KNLCXY/scratch",
message: "docs: 补 README",
files: [
{ path: "README.md", content: "# hi\n" },
{ path: "docs/a.md", content: "…" }, { path: "logo.png", content: "<base64>", encoding: "base64" }, ], })
返回 ✅ 已提交 N 个文件 … commit abc1234 … https://github.com/owner/repo/commit/…。
行为说明:
- 空仓库也能用:没有 main 时会自动建第一条 commit 和分支
- 只在 base_tree 上叠加,不会顺手删掉仓库里别的文件
- 一个调用 = 一个 commit,不是 N 个
- 401/403 会明确告诉你是 token 权限问题
github_repo_create
| 参数 | 说明 |
| name | 必填,只写名字(不带 owner/) |
| description | 一句话描述(≤350 字符,会进搜索结果) |
| private | 默认 false |
| topics | 逗号分隔,例如 "dsh,dsh-plugin,deepseek-harness" —— 决定能不能被搜到 |
| owner | 组织名;不填就是自己的账号 |
安全边界
| 事项 | 做法 |
| token 存在哪 | ~/.dsh/storages/dsh-github/settings.json(本机,不进 git) |
| 会不会进 repo | 不会。仓库里的 cordis.patch.yml 写的是 token: '' |
| 会不会进工具输出 | 不会。只有 github_status 显示掩码(首 4 + 末 4) |
| 设置接口返回什么 | hasToken / tokenHint / 占位符,没有 token 字段 |
| 明文出现在哪 | 只有设置文件本身和 github_api 发出去的 Authorization 头 |
想再稳一点:给 token 设 7 天过期,用完 Revoke;或者用只含目标仓库的 fine-grained token(不要 "All repositories")。
scripts/:三个可复用的旁路工具
这三个脚本也单独发了一个仓库(不装插件也能用,仓库里同样不含任何 key): KNLCXY/dsh-github-scripts
主流程用 token 走 API,这三个脚本是没有 token 时的旁路(也是本插件诞生的原因):
| 脚本 | 干什么 |
| gh-web-commit.mjs | 不依赖 token,用浏览器里已登录的 GitHub 会话提交单个文件(驱动 GitHub 网页编辑器) |
| gh-device-login.mjs | 走 OAuth 设备流,用已登录的浏览器会话换一个 gho_ token(scope 自己定) |
| chrome-probe.mjs | 用指定启动参数起内核、导航、跑 JS —— 排查「页面在自动化下不渲染」这类问题 |
bash
ELECTRON_RUN_AS_NODE=1 "<DSH 目录>/DeepSeek Harness.exe" scripts/chrome-probe.mjs \
"https://github.com/<you>/<repo>/new/main?filename=README.md" \
--flag "--disable-blink-features=AutomationControlled" \
--js "document.querySelectorAll('.cm-content').length"
两个入口都认环境变量:DSH_CHROME(内核路径)、DSH_GH_PROFILE(浏览器 profile 目录)。
踩过的坑(值得写下来):GitHub 的文件编辑器在 navigator.webdriver === true 时整块不渲染,页面只剩 "Files main" 骨架。加 --disable-blink-features=AutomationControlled 才正常。这也是 gh-web-commit.mjs 默认带这个参数的原因。
排错
| 现象 | 原因 / 修法 |
| 还没有配置 GitHub token | 去 设置 → GitHub 粘一个;或者写进 settings.json |
| 401 Bad credentials | token 打错、已 Revoke、或复制时带了空格 |
| 403 Resource not accessible by personal access token | 权限不够。fine-grained 要给 Contents: Read and write(推文件)或 Administration(建仓库/设 topics) |
| 403 API rate limit exceeded | 未认证限流 60/小时,认证后 5000/小时;等一会儿或用别的 token |
| 404 Not Found | 仓库名拼错,或 token 没有这个仓库的访问权(fine-grained 要显式选仓库) |
| 请求超时 / fetch failed | 这个网络到 GitHub 不稳,在设置里填代理(http://127.0.0.1:7897),或用 github_status 对比直连与代理 |
| 设置页没有「GitHub」 | client 半在进程启动时组装:重启 DSH |
| 反复弹 CredentialHelperSelector | git 的 system 配置把 credential.helper 设成了 helper-selector。用 github_fix_git_auth({ apply: true }),或在「设置 → GitHub」点「修复」——只改 git 凭据存储,不碰 token |
开发 bash
纯逻辑冒烟(不联网、不需要 DSH)
node test/smoke.mjs
用 DSH 自带 Node 也一样
ELECTRON_RUN_AS_NODE=1 "<DSH>/DeepSeek Harness.exe" test/smoke.mjs
覆盖:4 个工具是否注册、设置路由的校验(坏 token 400 / 好 token 200 且只回显首末 4 位 / 明文不出现在响应里 / 清除 / 坏代理 400)、没 token 时的提示、repo 格式校验。
改完源码要生效:bump package.json 的 version → 重新 dsh plugin add → 重启 DSH。
(pnpm 是把包复制进 node_modules,版本号不变会说 "Already up to date"。)
实现要点见 lib/index.js 顶部注释:代理是自实现的 CONNECT 隧道(Node 的 fetch 不读代理环境变量),所以 proxyUrl 一填,连 api.github.com 也能走隧道。
git 凭据弹窗(CredentialHelperSelector)
Windows 上如果每次 git 要凭据都弹一个「Select a credential helper」的框,成因是: bash
git config --system --get-all credential.helper # → helper-selector
git config --global --get credential.credentialStore # → 空
helper-selector 这个 helper 的职责就是弹选择框;store 没配,它每次都问。
修法(注意 helper 是多层叠加的,只写 global manager 顶不掉 system 的那条): bash
git config --global credential.credentialStore wincred
git config --global --unset-all credential.helper
git config --global --add credential.helper "" # 空值 = 重置此前累积的列表
git config --global --add credential.helper manager
插件里做成了一条命令: js
github_fix_git_auth({}) // 只检查
github_fix_git_auth({ apply: true }) // 写入 ~/.gitconfig
或在「设置 → GitHub」点 修复(写 ~/.gitconfig)。只影响 git 的凭据存储位置,不读取、不修改你的 GitHub token。
许可
MIT © KNLCXY预览分享卡片长什么样 ↓
分享 · DeepSeek Harness Hub
KNLCXY/dsh-github
让智能体直接调 API、批量提交文件并建仓库
相关插件 · 市场 / 管理
插件精选列表awesome-dsh-plugin/awesome-dsh-plugin
DeepSeek Harness(dsh)插件精选列表
★ 22,225未汉化DSH
73.6
新词雷达zhuyansen/new-term-radar
new-term-radar新词雷达
★ 2,049已汉化MCP
72.8
插件生态导航0xsline/awesome-deepseek-harness
安装 贡献指南 DeepSeek Docs 公开插件目录 Issues
★ 1,188已汉化DSH
72.6
技能注册中心iflytek/skillhub
企业级开源智能体技能注册中心——发布、发现并管理组织内可复用的技能包。
★ 5,370已汉化DSH
71.9
插件市场目录imsai-sh/awesome-deepseek-harness-plugins
面向 DeepSeek Harnessdsh生态的社区插件目录,共收录 13941 个插件含 PR 收录与…
★ 355已汉化DSH
71.8
插件精选清单Anil-matcha/awesome-dsh-plugin
DeepSeek Harnessdsh精选指南——DeepSeek…
★ 1,013已汉化DSH
71.7
这是你的仓库?认领条目