dsh-kill-restart
v0.1.0
Published
One-click kill button for the DSH Web GUI – kill the server process so you can restart without taskkill.
Maintainers
Readme
dsh-kill-restart ☠
One-click kill button for the DSH Web GUI.
Kill the server process instantly so you can restart DSH without taskkill or hunting for the PID.
How it works
- A small ☠ button appears at the bottom-right corner of the DSH Web GUI.
- Click it → confirm the dialog.
- The browser sends
POST /api/kill-dsh. - The server responds
{ "ok": true }, waits 200 ms so the browser receives the confirmation, then callsprocess.exit(0). - The page displays a "server terminated — restart DSH" message.
Installation
From npm (recommended)
dsh plugin --profile <profile-name> add dsh-kill-restartFrom GitHub
dsh plugin --profile <profile-name> add github:mozhi5795/dsh-kill-restartNote: Git installs fetch sources, not built artifacts. You must either:
- Use a tag that includes prebuilt
lib/files, or- Allow the
preparescript in the profile'spnpm-workspace.yaml:allowBuilds: dsh-kill-restart: true
From a local checkout
# From the directory containing dsh-kill-restart
dsh plugin --profile <profile-name> add ./dsh-kill-restartUsage
- Start DSH with the profile that includes this bundle.
- Open the Web GUI (
http://127.0.0.1:3080by default). - Click the ☠ button at the bottom-right corner.
- Confirm the dialog.
- The server exits; restart DSH manually.
Project structure
dsh-kill-restart/
├── package.json # Bundle manifest (dsh.bundle + dsh.client)
├── cordis.patch.yml # Cordis patch layer — inserts the plugin row
├── README.md # This file
├── .gitignore
└── lib/
├── index.js # Server half — POST /api/kill-dsh route
└── client.js # Client half — ☠ button UIArchitecture
This is a DSH bundle — an installable npm package that ships a configuration layer.
| Concept | File | What it does |
|---------|------|-------------|
| Bundle manifest | package.json | Declares dsh.bundle.patch (the patch file) and dsh.client (client module injection) |
| Patch layer | cordis.patch.yml | Inserted when a profile lists this bundle; adds the kill-dsh-restart plugin row |
| Server plugin | lib/index.js | Injects webServer, registers POST /api/kill-dsh, calls process.exit(0) after the response |
| Client plugin | lib/client.js | Injected into the browser via exports["./client"]; adds the floating ☠ button with click handler |
Loading order
Per the DSH plugin development docs, the effective configuration composes over an empty root by applying:
- Each bundle patch named in the profile's
bundleslist (in order) - The profile's own
cordis.patch.yml - The home-level
$DSH_HOME/cordis.patch.yml - Each
--patch <path>overlay
This bundle's patch (cordis.patch.yml) is applied at step 1 when the profile lists dsh-kill-restart.
Publishing to npm
This package is ready to publish to npm. To publish:
# Build (if needed — currently plain JS, no build step)
# Login to npm
npm login
# Publish
npm publishAfter publishing, users can install it with:
dsh plugin --profile <profile-name> add dsh-kill-restartDevelopment
This is a plain JavaScript (ESM) plugin — no build step required.
Edit the files in lib/ and test locally with a --patch overlay or dsh plugin add ./dsh-kill-restart.
License
MIT
