In the DSH development workflow, tracking version numbers and quickly deploying updates are common requirements. Manually checking or relying on scattered logs is difficult to meet in real time. dsh-version-badge is a plugin that solves this problem: it persistently displays a version badge above the settings button in the web interface sidebar, and provides update checking and one-click deployment.

Plugin Overview

  • Name: dsh-version-badge
  • Maintainer: mervin1944
  • License: MIT
  • Positioning: A version badge plugin above the settings button in the DSH web interface sidebar, supporting viewing core package versions, checking updates, and one-click deployment.

Core Features

  1. Persistent Badge
    The plugin persistently displays the DSH main version number (for example, DSH v0.1.1-rc.2) above the settings button in the web interface sidebar. This badge is part of the interface layout and is not a floating element.

  2. Version Details Expansion
    Clicking the badge expands to show all core package versions (CLI, base, web-app, web-frontend, agent). Clicking outside or the close button collapses it.

  3. Update Check
    The plugin queries the npm registry to compare the latest version, caching the result for 60 seconds. It prompts when a new version is found.

  4. One-Click Deployment
    After a new version is found, one-click deployment can be executed. This operation upgrades the global @deepseek-ai/dsh CLI and automatically restarts the current process.

    • Limitation: Deployment always uses npm dist-tag latest, ignoring any tag or version provided by the client.
    • Rollback: If the npm deployment fails, the current version remains unchanged.
  5. Security and Dependencies

    • Zero dependencies: A pure host-side plugin with no client-side build.
    • Security model: Write operations accept only local same-origin requests (loopback address + matching Origin to Host + rejection of forwarding headers).

Installation and Activation

Use the official command to install the plugin:

dsh plugin --profile web add dsh-version-badge

After installation, restart the dsh web service and refresh the browser. The version badge will appear above the settings button.

Configuration (Optional)

By default, the plugin allows one-click deployment and automatic restart. If your dsh process is managed by a supervisor or similar tool and you do not want the plugin to automatically restart the process, configure it in the profile’s cordis.patch.yml:

- id: dsh-version-badge
  name: dsh-version-badge
  config:
    allowRestart: false

After configuration, the check-update panel displays the message “Deployment is disabled”.

Typical Usage

In addition to operating from the web interface, you can also query the endpoints directly:

  • View version information:
    curl http://127.0.0.1:3080/dsh-version/version.json
  • Check for updates:
    curl http://127.0.0.1:3080/dsh-version/check-update.json
  • View deployment status (if available):
    curl http://127.0.0.1:3080/dsh-version/deploy-status.json
  • View the plugin script (verify installation):
    curl http://127.0.0.1:3080/dsh-version/widget.js

Notes

  • Deployment result path: The deployment result is written to $DSH_HOME/dsh-update-deploy.result.txt.
  • Security validation: Write endpoints (such as deploy-update.json) require the Origin header to be present and match the Host, rejecting cross-site or requests without an Origin header.

Summary

dsh-version-badge simplifies version tracking and updates through its sidebar badge and one-click deployment features. As a pure host-side plugin, it remains lightweight and is suitable for developers who frequently check versions and perform local deployments.