Foreword¶
DSH plugin developers need to publish their code to GitHub. The dsh-github-sync plugin pushes DSH plugins from the local workspace as “clean copies” to separate GitHub repositories. It triggers on demand, does not inject system prompts during normal operation, and stores the token locally only once.
Core Design¶
Security Mechanisms¶
The plugin adopts a two-stage security confirmation mechanism (Tool Guard). Tokens are stored in %USERPROFILE%\.dsh\github-sync\config. and never enter git; secret scanning will block uploads of sensitive files. Token permissions must be configured correctly: classic tokens require the repo scope, while fine-grained tokens require Contents: Read and write and Administration: write.
Clean Copies and Incremental Synchronization¶
Automatically excludes runtime files (.git, node_modules, cache, dist, .env*, etc.). Symbolic links are not followed. Smart incremental synchronization compares the working tree with the clean copy, skipping unchanged files on disk to avoid Windows file handle occupation conflicts (EBUSY).
Standard Git Flow¶
One local mirror repository per plugin, stored in %USERPROFILE%\.dsh\github-sync\mirrors. Supports incremental commits, real history, and standard push operations. Does not force-overwrite the remote; conflicts on the remote are reported as-is. The force option remains an explicit operation for replacing remote history.
Installation and Configuration¶
A configuration template is automatically generated when the DSH plugin loads. Edit the user configuration file (which is not part of any repository):
%USERPROFILE%\.dsh\github-sync\config.json
{
"github": {
"owner": "your GitHub username",
"token": "ghp_xxxx or github_pat_xxxx",
"topics": ["dsh-plugin"],
"license": "MIT",
"copyright": "your name or organization name"
},
"git": {
"userName": "your name",
"userEmail": "your email"
}
}
Commit attribution is derived from the token’s associated account by default, using the GitHub noreply email. If using a custom email, ensure it has been verified in your GitHub account.
Typical Usage¶
Commands and Tools¶
/git: Quick trigger entry. Empty input performs a read-only investigation; with intent, it initiates synchronization.github_sync_status: Read-only view of configuration, token source, target list, and determination results.github_sync_plan: Dry run that lists files to be committed/excluded and the reasons.github_sync_push: Actually executes the push. Requiresconfirm: trueas a confirmation parameter or prior authorization.
Natural Language-Driven¶
Supports expressing synchronization intents in natural language, without rigidly requiring two consecutive specific /git syntax commands.
Notes¶
- The plugin itself never auto-uploads and has no background polling or save-and-upload hooks.
- Single file size limit is 100 MiB; exceeding GitHub’s hard limit will be blocked.
- Commit author attribution is linked to your avatar by default, but only if the email is verified.
- If the plugin directory contains
.github/workflows/*.yml, theworkflowpermission must be additionally checked in the Token permissions during push.