@ptfm/dsh-github: Integrate GitHub into DeepSeek Harness without tokens in the model context

Introduction

When working with GitHub in DeepSeek Harness (DSH), the common approaches are to attach a “GitHub MCP” or let the model construct curl commands itself. The former often writes Personal Access Tokens into the conversation or tool chain, while the latter is difficult to audit for permissions and prone to leaking credentials in logs. If you want the agent to read repositories, browse issues and PRs, check Actions, and post comments just like you would in a terminal, without letting the token pass through the model context, you need an access path that “logs in once and calls the API within the host.”

Below is an introduction to the community plugin @ptfm/dsh-github (repository w32394045-dotcom/dsh-github), maintained by w32394045-dotcom and categorized as a networking tool in the SkillHub directory. After completing GitHub login via the DSH settings page or CLI, it exposes 12 github-* tools to the agent and injects DSH_GITHUB_TOKEN into the shell when needed, allowing git / gh and tool calls to share the same login state.

What is this

@ptfm/dsh-github is a GitHub integration plugin for DeepSeek Harness: credentials are stored locally in $DSH_HOME/github.json. The plugin requests api.github.com directly within the host, and the model only sees structured returns. Compared to other “GitHub MCP” solutions, the core difference emphasized in the README is that the token does not pass through the model context.

The current package version is 0.1.0, licensed under MIT, with zero runtime third-party dependencies (only Node built-in modules and DSH service interfaces).

Architecture and Credential Flow

After login is completed, the general data flow is as follows (excerpted from the README schematic):

  • DSH Web UI Settings → GitHub or CLI writes credentials;
  • The plugin host-side maintains 12 github-* tools, precise routing for /api/github, and DSH_GITHUB_TOKEN injection;
  • Whether the agent calls tools or runs shell commands, permissions are subject to your account on GitHub.

If the environment variables DSH_GITHUB_TOKEN / GITHUB_TOKEN are already set, they will override local storage, facilitating temporary identity switching.

Core Features

Three Login Paths

  1. Personal Access Token: Paste in the settings page; the plugin will first request /user for validation, and only write to disk if it passes.
  2. OAuth Device Flow: No client_secret required. Create an OAuth App on GitHub and check Enable Device Flow, fill the client_id into the settings page; after “Start Authorization,” confirm with the 8-digit code in your browser. The plugin only saves the client_id.
  3. Pure token CLI (not dependent on the DSH process):
node lib/cli.mjs status                  # Status + live validation, never prints plaintext token
node lib/cli.mjs login --token <token>   # Also supports --stdin / interactive hidden input
node lib/cli.mjs login --device --client-id <id>
node lib/cli.mjs whoami --json           # Machine-readable
node lib/cli.mjs token                   # The only command that outputs plaintext (stdout)
node lib/cli.mjs logout

After installation, you can also call the same CLI via the dsh-github binary (defined in bin in package.json).

12 Agent Tools

Tool Purpose
github-search Search issues / PRs / repos / code / commits
github-status Login status, account, token scopes, rate limits
github-account User profile
github-repo Repo info, directory tree; action=local reads local .git/config (no API consumption)
github-issues List / read / create / comment / change status
github-pulls List / read / create / comment / review / merge
github-branches Branch list, HEAD, create/delete, compare
github-actions Workflow runs, jobs and steps, log tails, manual triggers
github-releases Release list / details / create / modify / delete / assets
github-notifications Notifications: list unread, mark read, archive, subscribe
github-cloud Codespaces, self-hosted runners, Actions quota, Pages, Packages, Models, and cost reports & idle reclamation
github-api Direct pass-through to any REST endpoint

The repo parameter supports three-level inference: Explicit input → Git repo belonging to the current working directory → Default repo in settings. You can simply say “open issues for this repo” within a repository directory without writing the full owner/repo every time.

github-search handles GitHub’s stricter search API rate limits (30 requests/minute for authenticated users) by implementing pagination, query enhancement (e.g., @me, days:, automatically limiting to the current repo when no repo: is specified), a 90-second short-term cache, and clear errors with alternative suggestions upon 422/rate limit responses.

Cloud Cost Guardrails

Services like Codespaces are billed by usage. The plugin centralizes rules in lib/lifecycle.mjs, shared by the settings page and github-cloud, including:

  • Default shorter idle auto-stop upon creation (default 15 minutes);
  • Pre-checks for existing environments and costs before billable create operations;
  • action=reap for idle reclamation (supports dryRun=true);
  • No accidental shutdown within the safety window, in manual mode, or when holding an active DSH lease; stop/delete may be rejected for environments with recent activity, requiring force=true.

Settings → GitHub → Cloud Costs offers three modes: Balanced (default), Aggressive Savings, and Manual; github-cloud action=cost allows viewing cost reports and the cost-saving order instructions in the README.

Permissions and Security (Plugin-side Behavior)

  • Capabilities fully follow the token’s own scopes; the plugin does not perform secondary trimming.
  • Storage file permissions are 0600 with atomic writes; statusOf() only returns masked previews and does not serialize plaintext tokens to the browser.
  • When scopes are insufficient, 403/404 errors will indicate which scope is missing and where to add it.
  • Operations that incur costs (such as creating a Codespace, dispatch workflow, etc.) require prior user consent in the tool descriptions.

Installation and Activation

Windows (PowerShell):

git clone https://github.com/w32394045-dotcom/dsh-github.git
cd dsh-github
powershell -ExecutionPolicy Bypass -File scripts\install.ps1

macOS / Linux:

git clone https://github.com/w32394045-dotcom/dsh-github.git
cd dsh-github
bash scripts/install.sh

The installer idempotently places the plugin into $DSH_HOME/plugins/dsh-github, registers the link: dependency and bundle in the target profile, and uses DSH’s bundled pnpm to complete the link. After installation, open DSH → Settings → GitHub → paste the token; if the plugin does not appear immediately, restart DSH once.

Manual installation: Add "@ptfm/dsh-github": "link:<plugin_directory>" to dependencies and dsh.profile.bundles in the profile’s package.json, then run pnpm install.

Typical Usage

  1. Complete installation and log in via the settings page or CLI.
  2. Directly describe GitHub tasks in the agent conversation (e.g., query open issues, check PR CI, search code); the agent calls the corresponding github-* tools. When local git operations are needed, the shell can use the injected DSH_GITHUB_TOKEN.
  3. Before using Codespaces or cloud-related capabilities, check the cost and mode settings of github-cloud; you can use reap with dryRun=true to preview batch cleanup operations.

The repository README also mentions the backup upload script scripts/upload-via-api.mjs: it uploads via the Git Data API for scenarios where the git transport domain is unavailable (this is an auxiliary script provided by the maintainer, not a daily installation step).

Use Cases and Notes

Who it is for: Developers already using DSH who want the agent to perform real read/write operations (issues/PRs/Actions/Releases/notifications/some cloud computing management) with their GitHub account, and who care about tokens not entering the model context.

Please be aware before use:

  • The plugin runs with the current DSH process privileges; please review the source code and MIT license yourself before installation and activation.
  • The community directory SkillHub Plugin Page and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “Everything is a plugin.” This article only introduces the plugin’s capabilities and does not constitute an official endorsement.
  • If the host side has been in a loading failure state, the README explains that DSH needs to be restarted to recover; when modifying plugin code, pay attention to Cordis’s caching behavior for module specifiers, etc. (see the “Development Notes” in the repository).

Uninstallation: Remove @ptfm/dsh-github from dependencies and dsh.profile.bundles in the profile’s package.json, and rerun pnpm install; optionally delete $DSH_HOME/plugins/dsh-github and $DSH_HOME/github.json.

Conclusion

@ptfm/dsh-github integrates GitHub login, 12 structured tools, shell token injection, and cloud cost guardrails into a single DSH pipeline: log in once in the settings, and the agent calls the GitHub API with your permissions within the host, while the token stays local. For further information, visit the SkillHub Directory Page and the GitHub Repository README.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye