dsh
Akimiya-z/codex-guard在 DeepSeek Harness 内做提交前的 Pull Request 卫生检查:扫描当前改动中的 TODO 残留、硬编码密钥与非规范提交信息。
在对话框左下角一键连接你的 GitHub 账号(OAuth 设备流或 Personal Access Token),之后 AI 可通过 github_api 工具读取和操作你的 GitHub。
便携式 GitHub 连接插件:在 DeepSeek Harness 对话框的左下方放一个 GitHub 按钮, 一键让 DeepSeek 等 AI 连接你的 GitHub 账号;连接后,AI 可以直接通过 github_api 工具读取和操作你的 GitHub(Issues、PR、仓库、Gist、Actions 等)。
Portable:连接流程使用 GitHub OAuth 设备流(或粘贴 PAT),不需要自建回调
服务器,不经过任何第三方中转,令牌只保存在本机 DSH home 里。整个文件夹拷到
另一台机器装上就能用。
github.com/login/device → 输入验证码 → 自动轮询直到授权完成;
显示「最近验证」时间;网络异常时保留令牌不误登出。
api.github.com 发 REST 请求,并自动附带 system prompt 引导。
$DSH_HOME/.dsh-github-connect/auth.json(不在插件目录里,所以插件更新不会丢失连接;同一 DSH home 下的所有 profile 共用一份连接)。
@deepseek-ai/* 官方包的运行时导入,peer 只声明 @deepseek-ai/cordis;profile 安装(含桌面版内置插件管理器)开箱即用。
__ModuleLoader__ 模块。最省事的方式是用它内置的插件管理器:
https://github.com/Moon-shiyue/dsh-github-connect(或 git 源 github:Moon-shiyue/dsh-github-connect);命令行等价做法(需要机器上有独立安装的 dsh CLI):
# 直接按 git 源装进桌面版 profile(等价于插件管理器的做法)
dsh plugin --profile desktop add github:Moon-shiyue/dsh-github-connect
# 或先克隆源码再以本地路径安装(便于改代码)
git clone https://github.com/Moon-shiyue/dsh-github-connect.git
cd dsh-github-connect; pnpm install
dsh plugin --profile desktop add link:<本目录绝对路径>桌面版的 profile 名是 `desktop`(见环境变量DSH_PROFILE),与命令行版的web是两个独立 profile。
一次连接在本机是共享的:凭据在 DSH home 下,两个 profile 都能直接用。
在 DSH 对话里对 AI 说一句话:
请你安装这个插件:https://github.com/Moon-shiyue/dsh-github-connect
或复制下面这一行命令(Windows,任选其一执行):
powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/Moon-shiyue/dsh-github-connect/master/install.ps1 | iex"(macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/Moon-shiyue/dsh-github-connect/master/install.sh | bash一键脚本会自动完成:选定 profile(自动识别桌面版/命令行版)→ 克隆代码 → pnpm 安装依赖 → 注册进 profile → 打印对应的重启方式。重复执行是安全的(幂等,会自动更新代码)。
高级用法:install.ps1 -Profile desktop -FromGit、install.ps1 -Dir/
bash install.sh [profile] [dir] [--from-git]卸载:dsh plugin --profile remove dsh-github-connectgit clone https://github.com/Moon-shiyue/dsh-github-connect.git
cd dsh-github-connect
pnpm install
dsh plugin --profile web add link:<本目录绝对路径>
dsh web验证 composition:
dsh --dump-config --profile web # 应包含 dsh-github-connect 行卸载:
dsh plugin --profile web remove dsh-github-connect插件自带独立的受信网络层(lib/net.js,基于 undici),默认自动走代理, 无需设置任何环境变量:
proxy(见下);HTTPS_PROXY / HTTP_PROXY / ALL_PROXY(含小写形式,macOS/Linux 常见);NO_PROXY 与配置项 noProxy 都会生效(支持 *、host:port、.domain 后缀),默认豁免 localhost/127.0.0.1。
macOS/Linux 读取标准 CA 包路径(/etc/ssl/certs/ca-certificates.crt 等)。 解决“unable to verify the first certificate”(本地 TLS 拦截代理的根证书 不在 Node 内置证书库)以及直连被重置的问题。
手动指定代理(在 profile 的 cordis.patch.yml 里给该行加配置):
- id: dsh-github-connect
name: dsh-github-connect
config:
proxy: http://127.0.0.1:7890 # auto(默认)| direct | http(s)://host:port
noProxy: # 可选:这些主机不走代理
- localhost
- 127.0.0.1
authFile: D:\secrets\gh-auth.json # 可选:把凭据放到别处注:.github-ca-cache.pem 是本机生成的 CA 缓存(已 gitignore),换机器后会自动重新生成,无需手工处理。
创建,无需回调地址),按需调整 scopes,点「开始连接」,在打开的页面输入验证码;
$DSH_HOME/.dsh-github-connect/auth.json(Windows 默认 C:\Users\.dsh.dsh-github-connect\auth.json),除直接发送到 api.github.com 外不经过任何其他服务器;请勿分享该文件。
/.github-auth.json);0.2.0 起会读取旧位置并自动迁移到 home,旧文件随后被清空——插件更新(pnpm 会替换整个包目录)因此不会 再丢失连接。
Settings → Applications / Tokens 里直接 revoke。
repo gist read:org workflow,可在面板中修改。
dsh_my_plugin/
├── package.json # 包元数据 + dsh.bundle / dsh.client 声明(peer: @deepseek-ai/cordis)
├── cordis.patch.yml # bundle patch 层(insert 一行)
├── install.ps1 / .sh # 一键安装(自动识别桌面版 desktop / 命令行版 web profile)
├── lib/
│ ├── index.js # host 半:设备流 / PAT / 凭据存储 / /dsh-github/* 路由 / github_api 工具
│ ├── net.js # 跨平台受信网络层:代理解析 + 系统 CA(Windows/macOS/Linux)
│ └── client.js # browser 半:左下角按钮 + 连接面板(conversation.input.left / overlay)
├── tests/smoke.mjs # host 半冒烟测试:node tests/smoke.mjs
└── .github-ca-cache.pem # 运行时生成:系统 CA 缓存(gitignore,可随时删除)OAuth App,授权完全发生在“你的 App ↔ 你的账号”之间。
先点左下角 GitHub 按钮授权,不会卡死。
Bad credentials → 令牌确实被 GitHub 拒绝(过期/撤销/复制不完整);无法连接 GitHub API:UNABLE_TO_VERIFY_LEAF_SIGNATURE 或