dsh-plugin-github
DeepSeek Harness plugin: GitHub repository/issue search, repo and issue details, and file reading tools (github_search / github_get). Anonymous by default; an optional read-only fine-grained token unlocks code search and raises the rate limit.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:moxingovo/dsh-github说明文档
阅读完整 README ↗dsh-plugin-github
English | 中文
为 DeepSeek Harness 打造的 GitHub 检索插件。安装后 Agent 获得两个工具:
github_search—— 用 GitHub 原生搜索语法查找仓库与 issue/PR(例如repo:vercel/next.js is:issue)。github_get—— 完整读取一项资源:仓库元数据、issue 或拉取请求正文、或文件解码内容。
默认匿名可用(每 IP 每小时 60 次)。配置只读 fine-grained token 后解锁代码搜索并提升到每小时 5000 次。只读设计:插件不会创建 issue、发评论或写代码。
安装
dsh plugin --profile web add dsh-plugin-github
# 或直接从 Git 安装:
dsh plugin --profile web add git+https://github.com/moxingovo/dsh-github
重启 dsh web,新会话自动获得 github_search 与 github_get。
可选 token
创建 fine-grained token(Repository access 选 Public Repositories 只读),写入环境变量或 $DSH_HOME/.env:
GITHUB_TOKEN=github_pat_...
不配置 token 时全部功能仍可匿名使用;只有代码搜索和更高速率需要 token。
配置
| 键 | 默认 | 含义 |
|---|---|---|
tokenEnv | GITHUB_TOKEN | 存放可选 token 的环境变量名。 |
requestTimeoutMs | 30000 | 单请求超时(毫秒)。 |
searchMaxPerPage | 30 | github_search 页大小上限(API 上限 100)。 |
fileMaxChars | 200000 | github_get 文件字符上限(值层截断并带 truncated 标记)。 |
可在 profiles/web/cordis.patch.yml 中覆盖任意字段——按行后层覆盖前层。
错误码
工具以结构化错误失败并携带下列代码:GITHUB_UNAUTHORIZED(401,通常是无 token 的代码搜索)、GITHUB_FORBIDDEN(403,速率或权限)、GITHUB_NOT_FOUND(404)、GITHUB_API_ERROR(422 或其他非 2xx)、GITHUB_BAD_RESPONSE(非 JSON 响应体)、GITHUB_REDIRECT_REFUSED(凭据安全保护)、(网络)、(API 不下发超过 1MB 的文件内容)。