DeepSeek Harness Plugin

LinXueyuanStdio/dsh-git

Stars ★ 4 Downloads (30d) 1,486 Category Git & Code Review Added 2026-10-16 npm @linxueyuan/dsh-git

Local Git plus the four GitHub remote tabs in the official DSH right sidebar: Changes (per-file staging, line diffs, and commit messages written by the model already configured in DSH), History, then Code, Issues, Pull requests and Actions proxied by the host half. The token stays in the host half through ctx.credentials and /dsh-git/* accepts loopback requests only.

Install

# from npm (prebuilt)

dsh plugin --profile web add @linxueyuan/dsh-git

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

dsh plugin --profile web add github:LinXueyuanStdio/dsh-git

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

简体中文 | English

CI

Local Git, inside the official DeepSeek Harness sidebar: a multi-repo picker, local Changes / History work, Code / Issues / Pull requests / Actions tabs for the remote, and commit messages written by any model already configured in your DSH model list.

What you get

These are shared by every tab:

  • Multi-repo picker — the local repositories you explicitly added; once you sign in to GitHub it can also list remote repositories you have access to.
  • Sync and branches — fetch / pull / push. A force push is only ever --force-with-lease (there is no bare --force anywhere). Switch, create and rename branches; check out a commit (detached HEAD) or cherry-pick it.
  • Usable without a remote — on a local-only repository the Code tab degrades to a local working-tree view rather than an empty page; Issues / PR / Actions need a remote and say so in plain language instead of erroring.
  • Commit messages come from the model — the host half reads the diff and goes through ctx.llm, so it uses whichever provider you already configured in DSH.
  • Findable in settings — sidebar Plugins page ▸ Installed ▸ @linxueyuan/dsh-git ▸ the configuration section on its detail page: interface scale, diff check marks, notifications and a few confirmation prompts, plus the plugin's own config document (Pulls auto-refresh interval). The ported GitHub Desktop preference pages stay behind the gear in the right sidebar.

How it works

One npm package contains two halves. The browser half only draws UI (it registers the official sidebar tab; local actions go over /dsh-git/*). The host half runs in the same process as dsh: it runs git, registers routes, holds the token, and calls the model. Remote tabs never talk to GitHub directly — the host half proxies them, so the token never enters the browser.

  • /dsh-git/* accepts loopback requests only; LAN and remote access get a 403.
  • git can only touch paths from the list of repositories you explicitly added (anything else returns workspace-unknown).
  • clone disables protocol.ext.*.
  • The token lives in the host only, with a single read / write / log site: src/host/credential-bridge.ts.

Install

# from npm (the npm package name is scoped: @linxueyuan/dsh-git)
dsh plugin --profile <profile> add @linxueyuan/dsh-git

# from a local directory (development)
dsh plugin --profile <profile> add /path/to/dsh-git

Note it is @linxueyuan/dsh-git, not the unscoped dsh-git — the latter was taken by someone else (a 0.0.1 placeholder package whose repository link 404s).

After installing, restart DSH and hard-refresh the page (the host half is a Node module and does not reload with a page refresh).

GitHub sign-in and tokens

Two ways to sign in: click Sign in to GitHub.com for device flow (works out of the box — the app ships with the package), or paste a Personal Access Token (a fine-grained token needs Contents R / Issues RW / Pull requests RW / Actions RW; a classic token needs repo).

⚠️ The built-in app is a GitHub App: install it on your account / organization first — without an installation you sign in successfully but see no repositories. Its user tokens expire after 8 hours; the plugin refreshes them automatically.

To bring your own app, set clientId in the profile's cordis.patch.yml, or provide the DSH_GIT_CLIENT_ID environment variable (off disables device flow).

- id: dsh-git
  name: '@linxueyuan/dsh-git'
  config:
    clientId: 'Ov23li…'   # Client ID of your own app

The token lives in the host only, the browser sees just its last 4 digits, and at rest it is plaintext with 0600 permissions — no encryption.

Known limits (M1)

  • Remote tabs are GitHub-only. And the Code tree is the remote's view: local commits that have not been pushed do not show up there as files.
  • The built-in app is a GitHub App, so its repository access requires installing it first, and its user tokens expire after 8 hours (the plugin refreshes them automatically). Bringing your own OAuth App avoids the install step.

Development

npm install           # deps: esbuild (bundling) + typescript / eslint / sass (gates)
npm run build         # lib/index.js (host, esm) + lib/client.js (browser, ModuleLoader-wrapped)
npm run check         # artifact syntax check (node --check)
npm run lint          # ESLint
npm run typecheck     # type gate
npm run check:static  # every static gate in one command (check-all discovers and summarises)

CI only checks the published artifact (build → artifact syntax → package usability: manifest self-consistency, the host can load it, every runtime dependency is declared, and the tarball is complete and carries no source):

npm run build && npm run check && node scripts/verify-plugin.mjs

The gates below are local source-hygiene tools, not CI — they look at how this repository is written rather than at whether an install works, and some of them carry long-standing ratchet debt:

Gate Silent failure it catches
check-integration artifact not promoted / mirror unreachable / missing class names
check-generated generated files out of sync with sources (npm run check:generated:rebuild re-runs the build and compares byte for byte)
check-base-recipes the class exists but its real style recipe is outside the compiled closure
check-scope-roots a scope root appearing twice in one selector ⇒ it can never match
check-sass-leaks an unencoded $var left in the artifact ⇒ browsers silently drop the whole declaration
check-unreachable-ancestors the rule exists but the ancestor element it requires never renders
check-lint / check-types / check-scripts-types ESLint / client types / types of scripts/** itself

Exit-code contract: 0 = pass (registered ratchet debt is allowed), 1 = an unregistered defect, 2 = skipped.

License

MIT · third-party notices: THIRD-PARTY-NOTICES.md

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.