Introduction¶
In the Web interface of DeepSeek Harness (DSH), restarting or stopping the host process can be implemented as a plugin capability. keyiadiannao/dsh-power-button adds a power button at the bottom of the sidebar. When opened, it provides a Restart/Shutdown menu with a Windows-style full-screen transition overlay. It features a built-in standalone restart engine and does not rely on other plugins.
What is This¶
keyiadiannao/dsh-power-button is a self-contained power control plugin for DSH, maintained by keyiadiannao. It places the sidebar button, Restart/Shutdown menu, confirmation interaction, and transition overlay into the Web sidebar to complete restart or shutdown for DSH. The license is MIT.
Core Features¶
- Sidebar bottom power button: Theme-aware and matches the adjacent
Settingstrigger. - Restart/Shutdown menu: Provides Restart and Shutdown actions; the page automatically reloads after confirming a restart.
- Windows-style full-screen transition overlay: Used to display the transition state during the restart or shutdown process.
- Built-in standalone restart engine: Writes a
detached .cjshelper that waits for the old process to exit and the port to be released, then restarts DSH with the sameexecPath/execArgv/argv/cwd; does not usePowerShellortaskkill. - Commands and Model Tools: Provides
/restartand/shutdown, as well as therestart_harnessmodel tool; if the tool name is already taken by another plugin, it skips registration. - Localization: Provides zh/en UI and host notifications, following the profile’s
locale.preference. - Log cleanup: Cleans up
restart-helper-*.logfiles older than 7 days in the runtime directory at startup.
Installation and Enablement¶
Requires Node >= 22.19. Use the following command to install:
dsh plugin --profile web add "github:keyiadiannao/dsh-power-button#master"
After installation, restart DSH, and the power button will appear at the bottom of the sidebar.
Configuration¶
The plugin is configured via the profile’s cordis layer and can be used with cordis.patch.yml or the settings UI. Example:
- id: dsh-power-button
config:
enableModelTool: true
Common configuration options:
| Config Option | Default Value | Description |
|---|---|---|
enableModelTool |
true |
Used to register the restart_harness model tool |
maxDelayMs |
5000 ms |
Upper limit for the restart_harness model tool delayMs parameter; effective lower limit is 1000 ms |
Typical Usage¶
- Click the power button at the bottom of the sidebar to open the Restart/Shutdown menu.
- After selecting Restart and confirming, the page will automatically reload.
- When selecting Shutdown, the GUI will first pop up a confirmation dialog; the process will only stop after explicit confirmation.
- You can also use the
/restartand/shutdowncommands. - If the
restart_harnessmodel tool is enabled, you can pass indelayMs; the parameter has a lower limit of1000 ms, and the default upper limit is controlled bymaxDelayMs(default5000 ms). /shutdownand the model tool maintain a single-action design; the model does not expose shutdown.
Security and Runtime Details¶
- Destructive POST requests are protected by the
same-origin/loopbackguard. - Concurrent duplicate requests are rejected, returning
409. - Command logs are redacted; helper/marker file permissions are
0600, and the runtime directory permissions are0700. - Restart confirmation is only via UI toast notifications, not written to any session log.
Use Cases and Notes¶
Suitable for developers or users who need to perform restart/shutdown within DSH’s Web sidebar and wish to avoid dependencies on other plugins. Since the plugin executes the restart/stop of the DSH process, it runs with the permissions of the current dsh process; source code and license should be checked before installation. The license is MIT; the idea for the detached helper relaunch is referenced from anweat/dsh-restart (MIT), but the implementation is written independently without copying code.
Links¶
- GitHub: https://github.com/keyiadiannao/dsh-power-button
- Community Directory: https://www.skillhub.cn/plugins/keyiadiannao/dsh-power-button