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 Settings trigger.
  • 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 .cjs helper that waits for the old process to exit and the port to be released, then restarts DSH with the same execPath/execArgv/argv/cwd; does not use PowerShell or taskkill.
  • Commands and Model Tools: Provides /restart and /shutdown, as well as the restart_harness model 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-*.log files 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

  1. Click the power button at the bottom of the sidebar to open the Restart/Shutdown menu.
  2. After selecting Restart and confirming, the page will automatically reload.
  3. When selecting Shutdown, the GUI will first pop up a confirmation dialog; the process will only stop after explicit confirmation.
  4. You can also use the /restart and /shutdown commands.
  5. If the restart_harness model tool is enabled, you can pass in delayMs; the parameter has a lower limit of 1000 ms, and the default upper limit is controlled by maxDelayMs (default 5000 ms).
  6. /shutdown and 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/loopback guard.
  • Concurrent duplicate requests are rejected, returning 409.
  • Command logs are redacted; helper/marker file permissions are 0600, and the runtime directory permissions are 0700.
  • 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