dsh-npm-script: List and Run Workspace npm Scripts in the Harness Web Interface

Preface

When doing frontend or monorepo development in DeepSeek Harness (DSH), the common practice is to switch to the terminal, run commands like npm run dev or npm run build, and then stare at the terminal to find the local debugging URL. The Harness Web UI itself does not natively provide the capability to “scan package.json per project, run scripts in one click, and click through http links while watching the output.” The community plugin dsh-npm-script (maintainer: zouzhipeng, category: client-side) adds a floating entry point at the bottom-right corner of the Web UI, groups and displays the npm scripts in the current workspace, and supports running, stopping, and viewing output. Below is an introduction to its positioning, capabilities, and installation instructions.

What Is This

dsh-npm-script is a client-side plugin for the DeepSeek Harness Web UI: a floating button that, when clicked, lists the scripts from all package.json files in the current workspace grouped by project. Scripts can be run, stopped, and their captured stdout / stderr can be viewed; http:// / https:// URLs in the output are clickable and open in a new browser tab.

Core Features

All capabilities below come from the plugin’s README.

  • Floating button: Persistently docked at the bottom-right corner of the UI, without consuming panel space.
  • Grouped by project: Automatically scans multiple package.json files within the workspace (suitable for monorepos and multi-subdirectory setups), displaying script lists grouped by project.
  • Run state: Each command is displayed as Running / Ready / Stopping; long-running commands (such as npm run dev) can remain in the running state and be stopped at any time.
  • Output log: View stdout / stderr during execution; output can be polled and refreshed while running.
  • Clickable URLs: http:// / https:// in the output automatically become links; the panel also summarizes all addresses that appeared during the current run at the top, making it easy to click open local dev URLs.
  • Bilingual (Chinese / English): Follows the Harness UI language.

Command sources are limited to the scripts field of each package.json; arbitrary npm subcommands are not included.

Installation and Enabling

Prerequisites: DeepSeek Harness is already installed and running, and the scenario uses the web profile.

Method 1: Web UI

  1. Open the Harness Web UI and go to the Plugins page in the sidebar.
  2. Enter the following in the install input box:
github:zouzhipeng/dsh-npm-script
  1. Confirm the installation and make sure the bundle is in the enabled state.
  2. Refresh the page.

Method 2: Command Line

Run the following in your shell:

dsh plugin --profile web add github:zouzhipeng/dsh-npm-script

After installation, enable the dsh-npm-script bundle on the Plugins page in the Web UI, then refresh the page.

Update: Simply re-run the add command above to pull the latest version.

Uninstall: Remove it from the Plugins page, or run:

dsh plugin --profile web remove @zouzhipeng/dsh-npm-script

Typical Usage

After completing the installation and enabling steps above:

  1. Click the floating button at the bottom-right corner of the UI to open the command panel.
  2. The panel lists all scripts from every package.json, grouped by project.
  3. Click a command name to start execution; running commands display a stop button.
  4. Click a command to view its output log; URLs in the output can be clicked directly to open.

Press Esc to close the panel; if you are currently viewing output, the first Esc press will return you to the command list first.

How It Works and Optional Configuration

The plugin consists of a Host half (index.js) and a Client half (client.js): the Host resolves the workspace via Harness’s workspaceRegistry, scans package.json files, and launches scripts using subprocess; HTTP routes are restricted to localhost-only access. The Client renders the floating button and panel via shell.overlay, fetching data from the Host’s same-origin JSON routes. When executing scripts, the plugin injects NO_COLOR=1, TERM=dumb, PAGER=cat, and GIT_PAGER=cat to facilitate plain-text output and link detection; the client also strips ANSI escapes as a fallback.

Optional settings can be overridden via config in the profile’s cordis.yml (excerpt):

Field Default Description
scanDepth 3 Maximum directory depth for scanning package.json files
maxOutputBytes 262144 Maximum bytes retained in memory per output stream (tail retained)
maxSpillBytes 8388608 Maximum bytes spilled to disk
graceMs 5000 Milliseconds to wait for graceful shutdown when stopping a command; force-kills after timeout
historyLimit 20 Number of historical run records to retain
scanCacheMs 5000 Cache duration (in milliseconds) for project scan results

Changes to the Host half require restarting dsh web to take effect; changes to the Client half take effect after a page refresh.

Use Cases and Notes

Who it’s for: Developers already working in the DSH Web environment who want to browse and run workspace npm scripts without leaving the Harness UI, and quickly open local URLs printed by dev servers.

Environment: DeepSeek Harness (profile web); same platforms as Harness (macOS / Linux / Windows).

Known limitations (from the README):

  • Only recognizes http:// and https:// in output (does not recognize ws://).
  • The list comes only from the scripts field of package.json.

Security and permissions: The plugin starts a subprocess through Harness to execute the npm script you select, running with the same user and permissions as the current dsh process. Before installation, it is recommended to read the source code and the MIT License on the GitHub repository to confirm the behavior meets your expectations. The DSH ecosystem emphasizes “everything is a plugin”; community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.

Summary

dsh-npm-script consolidates “scanning scripts, running commands, following output, and clicking links” into a compact piece of UI at the bottom-right corner of the Harness Web interface, making it especially convenient for monorepos and multi-project workspaces. For installation or detailed information, refer to the SkillHub directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye