dsh-github-manager: Full-Access GitHub Management Within DSH

Introduction

In DeepSeek Harness (DSH), a common approach to let agents modify repositories, check CI, and manage secrets is to install the gh CLI separately, apply for a PAT independently, and then inject the token into environment variables. Authorization scopes, switching between multiple accounts, and persisting local credentials—every step requires manual handling. Below is an introduction to the community plugin dsh-github-manager (maintainer wanan8396, category admin-security): it runs browser OAuth inside DSH, uses an encrypted vault to store Tokens, and covers repositories, code, secrets, and Actions via a set of gh_* tools, without requiring GitHub credentials to be shipped with the package.

What is it

@local/github-manager (npm package name, version 2.0.0, MIT license) is designed for DeepSeek Harness. Its positioning is “Full-Permission GitHub Management inside DSH”: complete the authorization code flow for the OAuth App you register yourself, and once agreed, you can use the scopes listed in the README (including repo, delete_repo, workflow, admin:public_key, etc.); the agent invokes approximately 58 gh_* tools to operate the API; it does not depend on the gh CLI, nor does it require users to maintain a PAT separately.

The plugin also includes skills/github-manager/SKILL.md, explaining how the agent should chain these tools.

Core Features

Login and Multi-Account

  • OAuth: The package does not contain Client ID / Client Secret; you need to create an OAuth App in GitHub Developer Settings.
  • Callback: Authorization callback URL is http://<your-dsh-host>:3080/plugins/github-oauth/callback (same path as the old version @local/github-oauth; do not enable both at the same time).
  • Vault: AES-256-GCM encryption, data directory $DSH_HOME/github-manager; the main key is a separate 0600 file. Supports storing multiple GitHub accounts in the same vault, switching, and removal.
  • Settings Page: Settings → GitHub Management, you can view connection status, authorized scopes, account list, and custom OAuth App.

OAuth state is 256-bit, single-use, and expires in 10 minutes.

Agent Tools (By Domain)

Domain Representative Tools
Accounts and Configuration gh_auth_status, gh_auth_start, gh_auth_setup, gh_auth_logout, gh_accounts, gh_account_switch, gh_preferences
Repositories and Code gh_repos, gh_repo_create, gh_repo_delete, gh_file, gh_file_write, gh_push, Issues/PR, gh_search
Secrets and CI Account SSH/GPG, Repository Deploy keys, Actions secrets, gh_workflow_run, gh_ci_runs, gh_ci_jobs, gh_ci_logs, gh_ci_artifacts
Escape Hatch gh_api arbitrary method + path

Tools return a unified envelope: ok, code, text, data, rateLimitRemaining, etc.; failures do not throw exceptions, facilitating multi-step calls to continue within the same round.

gh_push: Push without a git client

gh_push publishes a local directory via the Git Data API: it compares blob SHA and only uploads changed files; it supports dryRun and deletion by path; it skips .git, node_modules, etc. by default, and blocks suspicious credential files (such as .env, *.pem, content containing ghp_ / github_pat_, etc.). The settings page provides “Push local directory to repository” and a dry-run. The README explains that in scenarios like mobile networks, a relatively complete git TLS handshake can reduce round trips.

Tokens and OAuth client configuration are written to the encrypted vault; Client ID/Secret can be injected via environment variables at startup without being written to disk (see configuration below). Before installing and enabling, you should review the source code and the MIT license according to DSH conventions—the plugin runs with the current DSH process permissions.

Installation and Enablement

The steps provided in the materials are to get the plugin directory and then add a local plugin in the DSH interface (not the dsh plugin add github:owner/repo concatenated command):

git clone https://github.com/USERNAME/dsh-github-manager.git

Then in DSH: Plugins → Add plugin → Select that directory, and enable the github-manager row. The runtime environment requires Node >=20.

If the old bundle @local/github-oauth is already installed, keep only one of this product and the old one enabled to avoid OAuth callback path conflicts.

Configure OAuth App

  1. Open https://github.com/settings/developers → New OAuth App.
  2. Homepage URL: http://<your-dsh-host>:3080.
  3. Authorization callback URL: http://<your-dsh-host>:3080/plugins/github-oauth/callback.
  4. Copy Client ID, generate Client Secret.

Give the credentials to the plugin, choose one of the following:

a) Environment variables (read at startup, not written to disk)

export GITHUB_MANAGER_CLIENT_ID=Iv1.xxxxxxxx
export GITHUB_MANAGER_CLIENT_SECRET=xxxxxxxxxxxxxxxx

b) Encrypted vault (Settings page “Custom OAuth App” or agent)

{"tool":"gh_auth_setup","args":{"clientId":"Iv1.xxxxxxxx","clientSecret":"xxxxxxxx"}}

Login and Typical Usage

Login

  • Interface: Settings → GitHub Management → Login with GitHub, confirm authorization on the GitHub side.
  • Agent: gh_auth_start returns the authorization URL; gh_auth_status checks connection and scopes.

Reproducible Example (Excerpt from README)

Create a private repo demo, add a README         → gh_repo_create { name, private: true, autoInit: true }
Change the port in config.json to 8080            → gh_file → gh_file_write
Add an SSH key to this machine                    → gh_my_key_add { title, key }
Add a CI secret in the repository                 → gh_secret_put { repo, name, value }
Delete the test repo just created                 → gh_repo_delete { repo, confirm: "DELETE" }
See which Actions have run                         → gh_workflow_list

CI Loop via API Only

{"repo":"owner/name","dir":"/path/to/project","message":"feat: x"}            // gh_push
{"repo":"owner/name","workflow":"build.yml","ref":"main"}                     // gh_workflow_run
{"repo":"owner/name"}                                                          // gh_ci_runs
{"repo":"owner/name"}                                                          // gh_ci_jobs
{"repo":"owner/name","jobId":123,"tailLines":200}                              // gh_ci_logs
{"action":"download","repo":"owner/name","artifactId":456,"dir":"/tmp/out"}    // gh_ci_artifacts

Deleting a repository requires explicit confirmation: gh_repo_delete’s confirm must be "DELETE".

Applicable Scenarios and Notes

Suitable for: Developers who have already developed in DSH, want the agent to directly manipulate GitHub (create repos, modify files, manage Deploy keys / Actions secrets, read CI logs), and are willing to set up their own OAuth App.

Notes:

  • The authorization scopes cover a wide range (including deleting repos, workflows, public key management, etc.), so the OAuth App and vault main key need to be kept by yourself.
  • Choose one between @local/github-oauth and this product to avoid callback conflicts.
  • The plugin page on the community directory site skillhub.cn and the GitHub repository maintain information independently; installation and behavior are subject to the repository README and local code. The DSH ecosystem is “everything is a plugin”, and this directory is not the DeepSeek / Hypothesis official app store.

Conclusion

dsh-github-manager puts “browser OAuth + encrypted multi-account vault + massive gh_* tools” into an admin-security class plugin, allowing the agent to complete the GitHub loop inside DSH from changing code to monitoring CI. For further understanding and obtaining source code:

  • Directory page: https://www.skillhub.cn/plugins/wanan8396/dsh-github-manager
  • GitHub: https://github.com/wanan8396/dsh-github-manager
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye