DeepSeek Harness (DSH) workspace code is usually managed locally. To publish it to GitHub, you typically need to manually create a repository, initialize git, configure credentials, and push. The dsh-github-sync plugin manages GitHub Personal Access Tokens (PATs) through the DSH credential store and automates repository creation, initialization, committing, and pushing. The plugin is maintained by s-huizhuy-u and uses the MIT License.
Core Features¶
The plugin provides the following capabilities:
- Create a repository: Create it if it does not exist on GitHub; reuse it if it already exists.
- Initialize git: Preserve the project’s current branch; use
mainby default for a new repository. - Commit: Stage and commit the entire worktree; if there are no changes, reuse the existing
HEADinstead of failing. - Push: If histories have diverged, first fetch, then rebase, then push.
- Automatic configuration: Write the account’s commit identity and record the branch upstream.
- Read-only preview:
github_statusreports what synchronization will do without changing anything.
Installation and Activation¶
Copy the plugin package to the DSH profile directory and run the installation script:
node scripts/install.mjs
The script locates the DSH home directory, copies the plugin to <profile>/.local-plugins/ and <profile>/node_modules/, and updates dsh.profile.bundles and cordis.patch.yml. Restart DSH after installation.
Environment Requirements¶
Running this plugin requires the following:
- DeepSeek Harness
0.1.5-rc.2or later - Node.js
20.12+(requiresAbortSignal.any) - A git executable available in
PATH
Typical Usage¶
The plugin provides three main tools:
github_sync: Publish the current workspace.github_status: Report what synchronization will do.github_configure: Validate and store a token with the GitHub API.
Example Interaction¶
The user instructs the assistant:
You: Publish this project to GitHub
After the assistant runs github_sync, it responds:
DSH: Synchronized 12 changed files to octocat/my-project (branch main).
Repository: https://github.com/octocat/my-project
Authentication Configuration¶
Before use, a GitHub Personal Access Token (PAT) is required.
Provision Methods¶
There are three ways to provide a token:
- Environment variable: Set
GITHUB_TOKENorGH_TOKEN. This is the best option for CI and shared machines, leaving no trace on disk. - Assistant storage: Say “Save my GitHub token”, and the assistant will use
github_configureto store it. - HTTP API: Send a request to
POST /api/github-sync.tokenwith the body{"token": "..."}.
Permission Requirements¶
| Token type | Required permissions |
|---|---|
| classic | repo (public_repo can be used only for publishing public repositories) |
| fine-grained | Contents: Read and write; to create repositories, also Administration: Read and write |
Important note: Stored tokens are kept in the DSH credential store, not in settings.yaml. All tokens are redacted in logs and conversation records.
Design Trade-offs¶
For security and stability, the plugin makes the following design decisions:
- Tokens are never written to disk:
originstores a clean repository URL; credentials are used only for a singlegit push. Tokens do not enter.git/config. - Git never prompts: Each invocation sets
GIT_TERMINAL_PROMPT=0,GIT_ASKPASS=, andGCM_INTERACTIVE=neverto prevent the call from hanging when authentication fails. - Remote divergence is coordinated: On conflict, use
git rebase --abortto roll back; the worktree remains unchanged, and conflicts must be resolved manually orforcemust be explicitly enabled to overwrite. - Not concurrency-safe: Multiple git operations on the same workspace may contend on the index lock.
Troubleshooting¶
| Symptom | Cause and resolution |
|---|---|
No GitHub token is configured |
Set the GITHUB_TOKEN environment variable, or use github_configure to store a token and restart DSH |
GitHub rejected the request (HTTP 401) |
The token has expired or is incorrect; reissue it |
HTTP 403 with a permission hint |
Check the token permissions. A fine-grained token must select the repository and be granted write permissions for Contents and Administration |
TLS_UNTRUSTED |
If using a GitHub accelerator (such as Watt Toolkit or FastGithub), configure NODE_EXTRA_CA_CERTS |
git push failed … non-fast-forward |
The remote has newer commits; retry or pass the force parameter to overwrite |
Ecosystem Links¶
- Plugin catalog: https://www.skillhub.cn/plugins/s-huizhuy-u/dsh-github-sync
- Source repository: https://github.com/s-huizhuy-u/dsh-github-sync