Preamble

DeepSeek Harness (DSH) dynamic plugins run in a sandbox environment and are usually restricted from directly initiating network requests or using Node.js require. html.run must publish HTML files through a specific interface, so it cannot be invoked directly via the standard ctx.web.fetch call.

The dsh-htmlrun plugin calls a zero-dependency local CLI (htmlrun.cjs) through ctx.subprocess to bypass the sandbox restrictions. It wraps html.run’s publishing capability into a tool that DSH models can call, allowing models to convert local HTML files into shareable links directly within a session.

Plugin Positioning

  • Name: dsh-htmlrun
  • Author: iwker
  • Type: DSH model tool plugin (network tool category)
  • License: MIT
  • Core value: Wraps the html.run CLI publishing workflow into a model tool, eliminating the need to manually copy links.

Core Features

This plugin provides the following capabilities:

  1. CLI wrapping: Calls the project-bundled scripts/htmlrun.cjs to perform specific operations, including activation, publishing, updating, and checking status.
  2. Model tool integration: Registers a tool named htmlrun in the DSH session, allowing direct invocation by the model.
  3. Authentication management: No separate Key configuration is required for the DSH plugin. The html.run authentication Token is stored in ~/.htmlrun/config, matching the terminal CLI usage.
  4. Supported commands:
    • check: Checks login status. When not activated, returns an activation link and QR code.
    • publish: Publishes or updates an HTML file.
    • bind: Binds a device via a pairing code.
    • login / logout: Manually configures or clears the Token.
    • whoami: Views the current status.

Installation

Installation via GitHub is recommended, with the commit SHA locked to ensure version consistency.

dsh plugin --profile <name> add github:iwker/dsh-htmlrun#<commit-sha>

After installation, the plugin is loaded into the DSH configuration as a bundle.

Usage

Tool Parameters

When calling the htmlrun tool, the following parameters must be passed:

Parameter Type Description
action string Required. The action to perform: check, publish, bind, login, logout, whoami
file string Required for the publish action. The absolute path of the HTML file, or a path relative to the workspace
note string For the publish action. A short note for this publication (optional)
forceNew boolean For the publish action. Forces a new artifact to obtain a completely new link (by default, the same path is automatically updated, version +1)
noInline boolean For the publish action. Does not inline local resources (by default, files in the same directory are automatically inlined)
code string For the bind action. An 8-digit pairing code
token string For the login action. The html.run publish token (starting with h_)
cliPath string Optional. Overrides the execution path of htmlrun.cjs

Typical Flow

  1. Check status: The model first calls action=check. If not activated, the CLI outputs an activation link and QR code, and the model must convey this information to the user. After the user confirms, check is invoked again and passes silently.
  2. Publish content: The model calls action=publish, file=<file path>.
  3. Result feedback: The CLI returns a link, version number, sensitive-word notices, and other information. The model must convey this raw output to the user rather than simply saying “Publish successful.”

Common Operation Examples

  • Update link: After modifying the HTML content, call action=publish again for the same file path (without forceNew). The link remains unchanged, and the version number is automatically incremented by 1.
  • Token management: A plaintext Token should not appear in conversational replies or logs. For login, only pass a value starting with h_; subsequent operations read the configuration internally via the CLI.

Limitations and Notes

  • Single-file limitation: Only single-file static HTML is supported. CSS/JS must be inlined or use local relative references; resources such as images are handled automatically by the CLI.
  • Environment requirements: Requires Node.js >= 16. htmlrun.cjs is zero-dependency, but it must be available in the plugin process or workspace.
  • Dynamic plugin behavior: Dynamic plugins are in-process and temporary. After the DSH process restarts, the plugin must be reloaded (via cordis_define or reinstallation).
  • Token location: The Token is stored in ~/.htmlrun/config (permissions 0600). Publishing from a different machine or path is treated as a new artifact.

Ecosystem and Source

This plugin is maintained by iwker and follows the MIT license.
* Plugin body: Authored by the developer, MIT.
* Skill source code: Copied as-is from the html.run official skill v2.0.1 (MIT) and distributed with the project.

Summary

dsh-htmlrun solves the problem of being unable to directly call the html.run publishing interface in the DSH sandbox environment. By reusing a mature CLI tool, it provides models with a reliable local file publishing capability, making it suitable for scenarios where generated HTML pages need to be shared directly with users.