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 pushin 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 pushandgit push originare 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
- 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)
- Use the probe to confirm the token works
- Switch to Project access, tick that account and save — the current workspace now has push credentials
- Have the agent run HTTPS
git fetch/git pushin the project; the helper fills in the credential and the model never sees the token - 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/workspacewhen 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_GLOBALpoints at$DSH_HOME/git-forge/gitconfig; the first lineincludes your user-level gitconfig (user.name/user.email/http.proxykeep working), followed by an emptycredential.helperthat 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.jsonfail 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, baregit push, andgit remote add/set-urlare 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 ifsecrets.jsonmay 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 callsconnection.requestRejection, and401/403end 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 requiresprincipal.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 pushwhose 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
- If this plugin helps you, a Star is welcome; questions and suggestions go to Issues or Pull Requests.
- Changes are recorded in the CHANGELOG.
- DeepSeek Harness: the host for plugins, tools and agent shells
License and author
MIT. Upstream project and code author @thirsty5034; maintenance and additions in this repository © 2026 @OMSociety.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-git-graph★ 10616
Git branch selector and Git graph for the dsh web GUI: switch branches and explore branch-lane and commit history from the conversation header. Retired by the author in favour of the official workspace-changes plugin: the published npm package stays installable but is no longer developed.
Akimiya-z/codex-guard#dsh★ 131
Pre-submit pull-request hygiene checks inside DeepSeek Harness: scans the current diff for TODO leftovers, hardcoded secrets, and non-conventional commit subjects.
xbzbing/dsh-git-panel★ 60
IDE-style Git panel in the DSH Web GUI: a resident tab with a three-column overview (branch/tag list, searchable commit-history graph, commit detail with changed-file tree and message) and a changes page (stats bar, uncommitted list with per-file stage/unstage/discard, commit box with amend); side-by-side diffs carry lazy highlight.js syntax highlighting, on-demand between-hunk context expansion and word-level intra-line emphasis, with image files shown as before/after panes; plus a zsh-style branch marker in the input bar. Every git command runs as an argv array through the host subprocess service, cwd locked to the repo root.
Cerbur/clutch-dsh#clutch-dsh-worktree★ 47
Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
DamonKoy/dsh-web-ui#dsh-git-graph★ 35
Git branch selector and Git graph in the conversation header of the dsh web GUI.
KannaKuron/dsh-ide-git★ 35
JetBrains-style Git tool window for the sidebar: branch tree with ahead/behind badges, commit graph with text/author/date/path filters, per-file line diff, changes list and commit box, plus branch, tag and stash actions, merge, rebase, cherry-pick, reset and fetch/pull/push.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.