DeepSeek Harness Plugin

OMSociety/dsh-git-forge

Stars ★ 6 Downloads (30d) 2,447 Category Git & Code Review Added 2026-10-10 npm dsh-git-forge

Project-scoped Git credentials: forge accounts (GitHub, Gitea, GitLab, Bitbucket or a custom host) live in the right-sidebar "Git Forge" tab, are granted per project, and reach the agent as an HTTPS credential helper so the token never enters the conversation. Pushes to a host the project has not granted are rejected.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-git-forge

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:OMSociety/dsh-git-forge

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

What this is • Screenshots • Installation • Sidebar • Model tool • Where data lives • Security • Requirements • Development • Support and credits • License and author

What this is

DSH Git Forge is a community plugin for DeepSeek Harness. In the DSH right sidebar it gives you one place to manage a forge account library, per-project grants and push policy.

It governs two things:

  • Which credential an agent uses. Once a project is granted an account, HTTPS git fetch / git push in agent shells pick up that account's token through this plugin's credential helper. Tokens are read host-side only and never enter model context.
  • Where the project may push. Non-granted hosts are rejected at the tool layer by the push guard; bare git push and git push origin are resolved to their remote URL before the decision.

SSH remotes and the system gh auth are untouched and keep using your local SSH / gh. This plugin only covers HTTPS in DSH agent shells.

Screenshots

Installation

Install from npm

# stop the running DSH first (a live service holds the dependency lock; start it again afterwards)
dsh plugin --profile <profile> add "dsh-git-forge@1.2.4"

Note: After installing, refresh the browser page; the "Git Credentials" tab is opened from the right sidebar's guide page — restarting the host alone is not enough, because the client artifact is fetched when the page loads.

First run

  1. Open the "Git Credentials" tab in the sidebar and add an account on the Accounts page (the token is entered in the sidebar, not in chat)
  2. Use the probe to confirm the token works
  3. Switch to Project access, tick that account and save — the current workspace now has push credentials
  4. Have the agent run HTTPS git fetch / git push in the project; the helper fills in the credential and the model never sees the token
  5. Try the opposite: point the agent at a non-granted host and the push guard should reject it outright

Sidebar

One sidebar tab with three pages:

Page Purpose
Project access Accounts available to the current project, and whether enforcePush is on
Accounts Create, edit, delete accounts and probe an API token; accounts are keyed by gitHost, the UI suggests github.com / gitee.com / gitlab.com / bitbucket.org, and self-hosted forges take their own domain
Policy Allowed gitHost values and the default for unbound projects

Model tool

Action Purpose Arguments
GitForge action=list_accounts List the account library (no tokens) none
GitForge action=list_project_accounts List the accounts granted to a project project_path
GitForge action=get_policy Read that project's policy: granted accounts, enforcePush, unbound default project_path
GitForge action=check_remote Check whether a remote URL is allowed to push (does not push) url (required)

Agent HTTPS and project paths

  • Grant key = the DSH session workspace (injected into agent shells as DSH_GIT_FORGE_PROJECT), not a nested path; workspace paths are canonicalized through the filesystem state (realpath), so Windows 8.3 short names and symlinks collapse onto one key
  • Helper resolves the project as: env → exact cwd → walk parents (bounded to /workspace when cwd is under it, otherwise up to the filesystem root)
  • R1: credentials are auto-filled only when exactly one token account is granted for that host
  • An agent shell's GIT_CONFIG_GLOBAL points at $DSH_HOME/git-forge/gitconfig; the first line includes your user-level gitconfig (user.name / user.email / http.proxy keep working), followed by an empty credential.helper that clears system-level helpers, then this plugin's helper — a system credential manager cannot pop a dialog and hang a headless shell, and user-configured helpers are cleared the same way

Where data lives

Under $DSH_HOME/git-forge/ (directory mode 0700; 0600/0700 modes apply on POSIX (Linux/macOS) only — Windows has no equivalent tightening):

File Contents
accounts.json Account metadata (no tokens)
secrets.json Tokens (0600)
grants.json projectPathKey → accountIds[] plus enforce / unbound policy
gitconfig Credential helper config injected into agent shells (holds no credentials)

Note: if accounts.json / secrets.json / grants.json fail to parse, the corrupt file is renamed to <name>.corrupt-<timestamp> and defaults are used — the original is never overwritten away.

Security

  • Tokens never appear in API results, tool results or model context
  • Push policy is enforced in the host's tools.guard, not left to the model: URLs in the command, bare git push, and git remote add / set-url are all decided against the grants
  • With no grants configured for a project, the push guard does not block by default (progressive enablement), and the helper supplies no credentials either
  • Tokens live only in the host-side data file secrets.json; the helper is a separate process spawned by git and reads it on demand; tokens never enter model context. Rotate tokens immediately if secrets.json may have leaked
  • The sidebar API completes host admission before parsing the URL, reading the body, accessing account or grant data, or dispatching business logic. On older hosts (@deepseek-ai/dsh-client-connection <= 0.2.2-rc.5) it still calls connection.requestRejection, and 401 / 403 end the response with the original status; on newer hosts (>= 0.2.3-alpha.1) the WebServer has already admitted the request, so the handler consumes the passed Peer and requires principal.kind === 'owner', answering 403 for a missing or non-owner peer
  • Push detection is a text-heuristic and has a known bypass surface (git renamed via an env var, git aliases, paths assembled through variables, non-bash/sh wrappers, uncovered prefixes like time/nice); this boundary states the detection scope, it is not an endorsement
  • In a project with grants, a bare git push whose remote cannot be resolved is retried once, then rejected (fail-closed)

Requirements

  • A DSH profile (desktop and self-hosted servers both work); the plugin declares no DSH version requirement and runs on whatever host it is installed into
  • Node.js >= 20

Development

npm test                      # 27 offline checks (scripts/smoke-test.mjs)
npm run check                 # syntax + smoke tests
npm run build:preview          # regenerate the sidebar preview images under docs/ (needs local Chrome; CHROME_PATH overrides)
DSH_PROFILE=desktop bash scripts/sync-to-dsh.sh   # register this checkout into a DSH profile as link: (dev)

Layout and where to change what:

lib/index.js            Host entry: tool registration, /dsh-git-forge/api routes, push guard, credential helper config
lib/client.js           Client bundle (committed; dsh plugin add does not build)
lib/shared/             Pure functions shared by host and client: path / git-policy / remote-resolve / credential-select / account-summary
docs/preview/           Preview input: fixture.json is fictional data; panel.html and docs/panel-*.png are generated by build:preview
scripts/                install.sh · install.ps1 · sync-to-dsh.sh · smoke-test.mjs · git-credential helper
cordis.patch.yml        In-package bundle patch the CLI turns into dsh.profile.bundles

Support and credits

License and author

MIT. Upstream project and code author @thirsty5034; maintenance and additions in this repository © 2026 @OMSociety.

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.