In local development environments, it is a common practice to frequently open multiple terminal windows to run different npm scripts. DeepSeek Harness provides a plugin mechanism to extend functionality, and the dsh-run plugin is designed specifically for this purpose: it allows invoking workspace npm scripts directly from the session header, avoiding the need to switch windows.
Features¶
This plugin adds a composite button to the session header (next to the “Open in…” button) for controlling workspace npm scripts.
-
Reading & Display
Reads the workspace’spackage.json. The button only appears if the workspace contains apackage.jsonwith defined scripts. -
Composite Button Interaction
- Play Icon (▶): Click to run the default script.
- Arrow Icon (▾): Click to expand a list showing all
npm runscripts; select one to execute it and set it as the new default script.
-
Default Script Logic
The default script is selected based on the following priority:devstart- The first declared script
-
Runtime State
- When running, the button changes to a stop icon; clicking it again terminates the process group (including
npmand its child processes). - If the script fails, the button turns red and displays an error message.
- When running, the button changes to a stop icon; clicking it again terminates the process group (including
-
Persistence
The default script selection for each project is saved in the browser’slocalStorage.
Installation & Activation¶
Install the plugin using the following command:
dsh plugin --profile web add github:albertgranados/dsh-run
After installation, restart the Harness and refresh the browser page.
Notes¶
- Dependency Requirement: The button only displays if the workspace contains a
package.jsonwith scripts. - Permission Restrictions: Runs using the Harness
subprocessservice; process management is subject to Host/Origin restrictions. - Concurrency Limits: Supports up to 8 concurrent executions, with an in-memory queue limit of 32 KiB and a disk spill limit of 4 MiB.
- Configuration Simplification: The plugin declares
dsh.bundle.patch, automatically handling configuration. Manual editing ofpackage.jsonorcordis.patch.ymlis not required.
Summary¶
The dsh-run plugin simplifies the development workflow by integrating npm script execution capabilities into the session header. It provides intuitive button interactions and basic process management, making it suitable for workflows that require frequent running of builds or development servers.
GitHub: albertgranados/dsh-run