Policy-driven Git sync for DSH settings and profile configuration, with secret-aware projections, conflict review, and per-line apply controls.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-sync
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ZhenHuangLab/dsh-sync
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. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Policy-driven DeepSeek Harness config sync. This is not a thin git pull of $DSH_HOME.
A dual-face DSH plugin:
- Host — sidecar Git under
$DSH_HOME/.dsh-sync/, namespace-projected settings, secret scan, journaled apply,/synccommand, fenced HTTP/SSE API - Web — theme-independent
settings.section("Git Sync") plus a/syncpopupSelectdecoration
Pinned to DSH 0.1.0-rc.6.
Install
dsh plugin --profile web add dsh-sync
# optional, if /sync should exist in headless too:
dsh plugin --profile headless add dsh-sync
Then restart dsh web. Open Settings → Git Sync.
From a checkout:
dsh plugin --profile web add /absolute/path/to/dsh-sync
The package declares dsh.bundle.patch so the CLI appends it to dsh.profile.bundles. The client bundle is exports["./client"] (lib/client.js) in the ModuleLoader factory format.
What v1 syncs
| Class | Items | Apply |
|---|---|---|
| Safe / live | Selected settings namespaces as payload/settings.namespaces.yaml (user layer, secrets and local-only paths stripped) |
ctx.settings.mutate with expectedRevision |
| Restart | profiles/{web,headless}/package.json |
Explicit only; shows install/restart follow-up. Does not run pnpm. |
| Executable | profile/home cordis.patch.yml, user .agent-presets/*/{preset.yml,agent.cordis.yml,tool-bootstrap.mjs} |
Explicit risk confirmation naming files + remote |
Never: .credentials.yaml, sessions, storages, node_modules, generated cordis.yml, .dsh-sync itself, .env*, shipped/system presets, symlinks, gitlinks.
baseURL is not treated as machine-local unless you add it under local-only paths. Tailscale CPA endpoints are portable on purpose.
A checkout that still looks like my-dsh-config (files at repo root) can set Payload root to “repository root”.
Cloning a remote that has no .gitattributes is supported. Push writes sidecar hygiene files if they are missing and never git adds a path that is neither on disk nor already tracked. Under systemd, plugin-triggered relaunch does not spawn a second process — Restart=always brings the unit back.
Commands
/sync status
/sync check
/sync diff
/sync pull # safe settings only; executable stays pending
/sync push # fast-forward only
/sync doctor
/sync recover
Bare /sync in the Web client opens the shared popup (status / check / safe pull / push). Full executable review is on the settings page.
Operator CLI (no compose): dsh-sync status|check|doctor|recover.
Security
- Allowlist by construction. Deny names in
.gitignoreare defense in depth only. execFileonly.GIT_TERMINAL_PROMPT=0.core.hooksPathis an empty plugin-owned directory.- Origin URL must match local config before fetch/push. No force-push. No Git secret in plugin config.
- HTTPS remotes with userinfo are refused. Scanner findings name path + rule, never the matched value.
- Web API is loopback + same-origin by default. Mutations require
X-Dsh-Sync-Request: 1and JSON. Non-loopback needs explicittrustedHosts. - Applying patch/preset files is a supply-chain action (they may contain
!!js). v1 never auto-applies them.
If a secret was already pushed: rotate first, then rewrite history yourself. This plugin will not.
Theme contract
The settings section binds only --dsw-alias-* tokens and official primitives (Button, Input, StateDot, DisclosureRow, DiffBlock, RiskConfirmation). It does not import ui-theme, read data-ds-dark-theme, or use color literals. pnpm run lint:theme enforces that.
Develop
pnpm install
pnpm test
pnpm run lint:theme
pnpm run build
Architecture notes live in docs/.
Links
More in this category
NanmiCoder/dsh-agent-teams★ 327
AgentTeams multi-agent teams.
icetomoyo/dsh_workflow★ 59
UltraCode-style multi-agent orchestration: a generatable, savable, governable, observable, resumable workflow layer.
btspoony/mstar-harness★ 46
Skill-driven harness/loop engineering workflow agent plugin.
titanwings/dsh-automation★ 41
Scheduled coding runs in fresh agent sessions with auditable history.
whyihaveyou/dsh-suite#plugin-team-board★ 27
Shared multi-agent task board (create/claim/transition/query) over a Cordis service key.
omdsh-dev/dsh-deep-research★ 12
Adaptive deep-research orchestrator built on the official workflow engine.