- ホーム
- プラグイン
- Git とコードレビュー
- dsh-publish-github
dsh-publish-github
lucyvan/dsh-publish-github
Publish any local directory to GitHub from inside a DSH session with a /publish slash command — git init, gh repo create, commit and push. Never force-pushes, never deletes.
インストール
dsh plugin --profile web add github:lucyvan/dsh-publish-githubREADME
dsh-publish-github
A GitHub publishing plugin for DeepSeek Harness: type one command in the composer and publish any local directory as a GitHub repository — git init, repo creation, commit and push, without leaving the session.
What it does
/publish <dir> → git init (if needed) → git add -A → commit (first commit)
→ origin exists → push; otherwise → gh repo create --source . --push
One command covers the whole flow, reporting each step as a ✓/✗ line in the session.
Why a slash command instead of a model tool
DSH's @deepseek-ai/* packages live inside the Electron app.asar, so a plugin mounted from disk cannot import them — which rules out the official ctx.tools.register path. This plugin registers /publish through the host's ctx.commands.register instead, needing no internal package and working as soon as it is mounted.
Install
# GitHub
dsh plugin --profile desktop add github:lucyVan/dsh-publish-github
# Local checkout
dsh plugin --profile desktop add /absolute/path/to/dsh-publish-github
Restart DSH afterwards. Authorize GitHub once, either way:
Install gh and log in (any one option):
# macOS
brew install gh
# Windows (PowerShell / winget)
winget install --id GitHub.cli
# Linux (Debian/Ubuntu)
sudo apt install gh
# Then log in (same on every platform)
gh auth login
Alternatively, save GITHUB_TOKEN in DSH credentials — the plugin injects it as GH_TOKEN into the gh child process, so gh's own login is not required.
Usage
/publish /path/to/your/project
Options:
| Flag | Effect |
|---|---|
--private | Create a private repository (public by default) |
--name <repo> | Repository name (defaults to the directory basename) |
--message "<msg>" | Commit message / repository description (default Publish <repo>) |
--author <name> | Author name for the first commit (defaults to your git config) |
--email <addr> | Author email for the first commit (defaults to your git config) |
Quote paths that contain spaces — Windows paths work the same way:
/publish "C:\Users\me\My Projects" --private
/publish "/Users/me/My Projects" --name my-project
Example:
/publish ~/IdeaProjects/my-plugin --private --name best-plugin --message "My first DSH plugin"
Safety
- Never force-pushes, deletes branches or resets history — such words are refused up front;
- When
originalready exists it only performs a normalpushand never recreates the remote; - The child environment strips
DSH_*variables so harness configuration never reachesgh; - Any directory is allowed (deliberate: the path the user names is the authorization).
Requirements
| Dependency | Notes |
|---|---|
git | required |
gh | required (macOS brew install gh / Windows winget install GitHub.cli / Linux apt install gh) |
| GitHub auth | gh auth login, or a GITHUB_TOKEN in DSH credentials |
| Node | >= 22 |
Known limitations
- Only the
/publishcommand; there is no settings page (account details come from gh CLI or DSH credentials); - GitHub repositories only — no npm publishing;
- The first commit is authored as
DSH <dsh@localhost>(amend it afterwards if you prefer); - No conflict handling: if the remote already has unrelated history, the push fails and the error is reported verbatim.
Compatibility
| Item | Status |
|---|---|
| DSH version | Verified on 0.2.2-rc.1; declares engines.dsh: >=0.2.2-rc.1 <0.3.0-0; DSH rejects an incompatible host at install time |
| Platform | Tested on macOS; Windows untested, with three adaptations in place: gh/gh.exe/gh.cmd/gh.bat are probed in order, arguments honour quotes (including backslash paths), and the commit author is configurable |
| npm dependencies | None: only node:* built-ins, no @deepseek-ai/* imports |
| Browser module dependencies | None: host-only plugin, no client half |
| Required external tools | git and gh, both on PATH |
| Install | Declares dsh.bundle, so dsh plugin add registers it as a profile layer automatically — no manual patch editing |
After a DSH upgrade the plugin may refuse to install:
engines.dshis enforced by DSH, which rejects an out-of-window host and explains that running it may crash or corrupt data. To try an unverified host anyway, use DSH's exact-version exemption:dsh plugin --profile <name> allow-version <package>@<version> --dsh-version <host-version> --accept-riskBack up your workspace first. The host APIs this plugin relies on (
ctx.commands.register, the right-sidebar tabs,agents.create's seed semantics) can still change between release candidates.
Install verification: dsh plugin --profile web add github:lucyVan/dsh-publish-github was run in an isolated DSH_HOME.
Uninstall
dsh plugin --profile desktop remove dsh-publish-github
Then restart DSH.
License
MIT (see LICENSE)