AngelosZou/dsh-github-router ↗★ 2
dsh-github-router
DeepSeek Harness plugin: read-only GitHub access for agents (github_probe / github_pr / github_issue / github_file / github_api). Routes every request inside the tool — api.github.com (direct or proxy), gh CLI, git protocol (plugin-owned fetch cache plus read-only local repo reads), PR/issue page HTML with strict JSON embeddedData extraction, and optional user-configured raw mirrors — so agents never burn turns fighting sandbox TLS/proxy failures in a shell. No write/push capability exists anywhere in the plugin.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AngelosZou/dsh-github-router说明文档
阅读完整 README ↗Usage
Agent side:
| Tool | What it does |
|---|---|
github_probe | One-shot connectivity matrix (api direct/proxy, gh installed/authed, git ls-remote, page direct/proxy, mirrors, token presence) with timings and a recommended route chain. Call first when access fails or is slow. |
github_pr | Full PR view: metadata, description, discussion (issue + inline review comments), reviews, commits, changed files, and the unified diff, each with route attribution. Parts toggle (includeDiscussion/includeReviews/includeCommits/includeFiles/includeDiff) and cap (maxDiffBytes/maxItems). localRepo (or session-cwd auto-detection) reads commits/diff from a local clone with zero network. |
github_issue | Issue metadata, body, labels, and comments, with route attribution. |
github_file | File content (or directory listing) at a branch/tag/sha via api contents → raw → mirrors → git; returns size, truncation state, and the serving route. |
github_api | Validated GET-only escape hatch for any api.github.com endpoint; query values sanitized, responses cached, rate-limit headers surfaced, errors carry stable codes. |
github_probe # which routes are live right now
github_pr { owner: "o", repo: "r", number: 12 } # full PR view
github_pr { owner: "o", repo: "r", number: 12, localRepo: "C:/src/r" } # commits/diff from a local clone
github_issue { owner: "o", repo: "r", number: 34 }
github_file { owner: "o", repo: "r", path: "src/index.js", ref: "main" }
github_api { path: "/repos/o/r/commits", query: { per_page: 5 } }
Behavior notes:
- Route order is fixed per part type: API first (direct then proxy), then gh, then page HTML (proxy-first — machines with reset direct TLS usually reach pages through the proxy), then git, then mirrors. Each part records the route that served it.
- Anonymous API use is rate-limited (60 requests/hour per IP); configure a token (Settings or
GITHUB_TOKEN) for 5000/hour. Responses are cached to save quota;forceRefreshbypasses the cache. - Mirrors are off by default — they are third parties that see requested paths; enable them in settings only if you accept that.
- The git route never writes to user repositories: local clones are read with
git log/diff/showonly, and fetches happen exclusively in the plugin-owned cache under/storages/dsh-github-router/.
Configuration
Settings → Plugins shows the GitHub Router card on the configurable
tab (the framework's settings.plugin.item card slot keyed by the settings
namespace; requires DSH ≥ 0.1.0-rc.7): edits are staged locally and written
only on save, fields overridden by the user are badged, and blank fields
fall back to the defaults below. The token is a write-only field — a blank
save clears a configured token. The same values can be set in the
composition (profile cordis.patch.yml) as the plugin's base config; the
Settings UI overrides per user.
| Field | Default | Meaning |
|---|---|---|
token | — | Literal GitHub token (secret; redacted on the wire, write-only input). Prefer tokenEnv. |
tokenEnv | GITHUB_TOKEN | Environment variable / credential ref naming the token. |
proxy | '' | Proxy URL for proxy attempts. '' inherits ambient HTTP(S)_PROXY; direct never proxies. |
directTimeoutMs / proxyTimeoutMs | 8000 / 15000 | Per-attempt timeouts. |
retries | 1 | Retries for idempotent GETs on 429/5xx (honors Retry-After). |
routesApi / routesGh / routesGit / routesHtml / routesMirror | on / on / on / on / off | Route switches (the card shows them as checkboxes). |
mirrors | [] | Raw-content mirror bases, e.g. ["https://ghproxy.net"]. |
cacheTtlMeta / cacheTtlContent | 300 / 86400 | Response cache TTLs (PR/issue metadata vs immutable-ish content), in seconds. |
maxBytes | 1048576 | Byte cap for every response body read by the plugin. |
repos | [] | Local repositories granted for read-only git-route reads. |
gitCacheDir | '' | Plugin fetch-cache dir; '' = /storages/dsh-github-router/git. |