Introduction¶
DeepSeek Harness (DSH) agents typically need to interact with GitHub when handling code, submitting PRs, or managing repositories. This plugin provides DSH with native GitHub REST API tools, along with a browser sidebar panel, resolving the cumbersome problem of agents calling APIs directly. It supports account binding, repository search, Issue/PR management, and cloning repositories into local workspaces.
Core Features¶
This plugin includes two types of core functionality: command-line tools for models (agents) and a browser sidebar panel for users.
Account Binding Tools¶
Used to establish an authenticated connection to GitHub in DSH.
* github_bind: Validates a GitHub personal access token and persists it to the credential store.
* github_whoami: Queries the currently bound GitHub account information and token source.
* github_unbind: Removes the account binding and deletes the stored token.
GitHub API Tools¶
Registers a series of github_* tools for direct use by agents.
* Query tools: github_repo (retrieve repository metadata, such as stars and language), github_search (search repositories, code, or Issues), github_my_repos (list repositories for the current account), github_issues (list Issues), github_prs (list Pull Requests).
* Action tools: github_create_issue, github_create_pr, github_content (read files or directories), github_comment (comment on an Issue or PR).
Workspace Integration Tools¶
Converts GitHub repositories into local DSH workspaces.
* github_workspace_add: Clones a repository locally and registers it as a workspace.
* github_workspace_list: Lists registered GitHub workspaces and their local paths.
Browser Sidebar Panel¶
Adds a GitHub icon to the sidebar of the dsh web interface.
* Status display: Shows the bound account and the list of registered workspaces.
* Repository management: Clicking a repository in the list clones it and registers it as a workspace.
* Action entry: Provides “Bind Account”, “Add Workspace”, and “Refresh” buttons.
Installation and Activation¶
Run the following command in the plugin directory to install:
dsh plugin --profile web add .
After installing or updating, restart the Web GUI (dsh web) to load the new plugin package. The client plugin discovery mechanism runs only at process startup and caches the determination of “non-client packages”, so a running GUI cannot automatically recognize newly installed plugins.
Configuration¶
The plugin supports configuring parameters via configuration files or environment variables. The token resolution priority for configuration items is: credential store > plugin config > environment variables.
Configure in ~/.dsh/cordis.patch.yml or under the corresponding Profile directory:
- id: tool-github
config:
token: "" # 可选,推荐使用 github_bind 或 GITHUB_TOKEN 环境变量
baseUrl: "https://api.github.com"
timeoutMs: 30000
maxResults: 10
workspaceRoot: "~/.dsh/github-workspaces"
Typical Usage¶
Call the above tools directly in a DSH conversation:
# 绑定账号
github_bind <your_token>
# 查询当前账号
github_whoami
# 添加 DeepSeek-Harness 仓库为工作区
github_workspace_add deepseek-ai DeepSeek-Harness
# 查看可用的 GitHub 工作区
github_workspace_list
# 获取仓库的 star 数
github_repo deepseek-ai DeepSeek-Harness
# 搜索 stars 超过 3000 的 Python PDF 库
github_search python stars:>3000 pdf
How It Works¶
Account Binding Mechanism¶
github_bind first validates token validity by calling GET /user. After successful validation, it stores the token under the GITHUB_TOKEN key via DSH’s credential interface (ctx.credentials), persisting the data in $DSH_HOME/.credentials.yaml. Subsequent tool calls automatically read this credential, eliminating the need for repeated input.
Workspace Integration Mechanism¶
github_workspace_add takes an owner/repo parameter. It first attempts to clone the repository using git clone into the workspaceRoot directory. If git TLS is unavailable, it falls back to downloading the GitHub CodeLoad tarball. After cloning completes, it calls ctx.workspaceRegistry.create to register the repository in the workspace registry, making it appear in the workspace selector. Agents can then use file operation tools in this directory.
Notes¶
- Environment requirements: The plugin requires Node.js >= 20.
- Restart required: After modifying configuration or installing the plugin, be sure to restart the
dsh webprocess. - TLS fallback: In certain network environments (such as restricted networks), the plugin automatically switches from
git clonetocodeloaddownload. - Permission scope: Token scopes determine the repositories accessible to the agent (including private repositories) and the actions it can perform (such as reading/writing files and creating PRs).
Ecosystem Context¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture. This plugin is an independent community-contributed tool designed to enhance DSH integration with the GitHub ecosystem. The plugin directory is not affiliated with DeepSeek officially.