The philosophy of DSH is “everything is a plugin.” In actual development, managing third-party plugins, checking for version updates, or restarting the desktop application often requires frequently switching windows or running commands manually. This can interrupt the development flow. We need a capability to perform these operations directly in the desktop client.

What Is It

This plugin provides plugin installation, management, and restart capabilities for DSH Desktop. It is maintained by deronghe and is licensed under the MIT License.

Core Features

  • Restart Desktop button: Provides a one-click restart option in the top-right corner of the settings panel.
  • Install plugins by address: In the “Settings → Plugins → Install Plugin” tab, enter a repository address and select the target profile (desktop / web) to install a plugin.
  • Third-party plugin management: In the “Settings → Plugins → Third-party Plugins” tab, lists plugins installed from third parties in the current profile (excluding built-in bundles) and supports uninstalling, enabling, disabling, and checking for version updates.

Installation and Enablement

Run the following command in the terminal to install this plugin:

dsh plugin --profile desktop add github:deronghe/dsh-plugin-desktop-installer

After installation, restart Desktop to apply the changes.

Typical Usage

  1. After installation, restart DSH Desktop.
  2. In “Settings,” click the “Restart Desktop” button in the top-right corner.
  3. In the “Settings → Plugins → Install Plugin” tab, enter a repository address (supports github:owner/repo or @scope/pkg format) and select the target profile to complete installation.

Technical Structure

This plugin uses a separated frontend and backend architecture:

  • lib/index.js: Acts as the Host side and registers eight HTTP endpoints: /api/dsh-plugin-installer/{profiles,install,restart,installed,uninstall,set-enabled,check-updates,update}.
  • lib/client.js: Acts as the browser side and handles the interaction logic for the settings interface.
  • cordis.patch.yml: Responsible for injecting this plugin into the profile composition.

Applicable Scenarios and Limitations

Applicable scenarios: Developers who need to centrally manage desktop plugins or quickly restart the desktop application through an interface.

Notes:
* Profile limitation: The installation, uninstallation, and update capabilities depend on desktopPnpmBootstrap, which is exclusive to the desktop version. Running in a pure web profile will show a “missing installation capability” message. Enable, disable, and list operations only read and write the profile’s package.json and do not depend on desktop services.
* Network requirement: Version detection requires internet access. npm plugins query registry.npmjs.org, while github: plugins query the GitHub API (configuring the GITHUB_TOKEN environment variable can avoid rate limiting).
* Effective scope: Operations write to $DSH_HOME/profiles/<name> and only take effect for that profile on the local machine.

Summary

This plugin centralizes plugin management operations in the desktop settings panel. For more details, refer to its GitHub repository or SkillHub directory page.