dsh-hillstone-cli-ops: Managing Hillstone / StoneOS Devices in DSH

Introduction

In DeepSeek Harness (DSH), the common approach to network device operations involves device inventories in spreadsheets or scripts, SSH terminals opened in separate windows, and a disconnect between auditing, “what commands the assistant can execute,” and the conversation interface. If the assistant needs to log in, run commands, or view output on your behalf, it requires manually piecing together SSH commands or temporary scripts, and the status often fails to sync with what you see on the panel.

Below is an introduction to the community plugin dsh-hillstone-cli-ops (display name: “Hillstone Device Operations”). It integrates Hillstone / StoneOS devices into the DSH right sidebar and provides 9 hillstone_* tools, enabling the agent and humans to operate devices within the same set of sessions, logs, and policies. The maintainer is jazhu; it is categorized as a Workflow in the SkillHub directory. The plugin is released under the MIT license, and the current package version is 1.1.1 (subject to the repository’s package.json).

What is this

dsh-hillstone-cli-ops is a typical “two-half” DSH plugin:

  • Host Side (Node): SSH, credential encryption/decryption, session auditing, execution policy validation, and tools registered to the agent.
  • Client Side (Browser): The “Device Operations” tab in the right sidebar, embedding an xterm.js terminal.

Build artifacts are committed in dist/: ssh2 and its pure JS dependency closure are bundled into dist/index.mjs, and xterm into dist/client.js. Therefore, the target machine does not need to build upon installation, nor does it rely on node_modules adjacent to the plugin directory to resolve ssh2 / xterm at runtime. The optional capability WebUI Login dynamically loads playwright to drive a local Chromium, which is an optionalDependency.

Four Sub-pages of the Right Sidebar “Device Operations”

Opening the “Device Operations” tab in the DSH right sidebar reveals four sub-pages:

Sub-page Role
Device Management CRUD for devices: Name, IP, Account, Password, SSH Port, Device Type, Web Port, Notes. Add, Copy, and Edit share a centered dialog. The right side of the card name row provides CLI Login (SSH terminal) and WebUI Login (Browser). A liveness indicator light appears before the name: Green for reachable, Red for unreachable; hidden before the first scan.
Terminal Each active connection corresponds to an xterm.js terminal; input is sent to the host, and device output is returned via SSE. Creating a new connection automatically switches to the “Terminal” sub-page for immediate visibility of the session.
Logs Auditing by connection: Who connected to which device, input content, commands executed, session end time and reason.
Execution Policy Rules authored by you: Binding daily time windows and command patterns. If a command triggered by the assistant falls within the window and matches the pattern, the host rejects it before issuing SSH and records the reason. Full semantics are available in the repository’s docs/执行策略.md.

9 Tools Registered to the Agent

The plugin registers the following tools to DSH (names consistent with the README):

  • hillstone_list_devices
  • hillstone_open_terminal
  • hillstone_send_input
  • hillstone_get_output
  • hillstone_close_terminal
  • hillstone_list_sessions
  • hillstone_run_and_analyze
  • hillstone_scan_liveness
  • hillstone_web_login

Among them, hillstone_run_and_analyze can execute commands in batches and pass the output to the host-side LLM, facilitating natural language tasks (e.g., “Check interface status and CPU load”). By default, it reuses terminal sessions already opened by the operator in the tab, facilitating observation of agent operations in the “Terminal”; if there is no live session, it falls back to a one-off exec channel.

hillstone_scan_liveness returns the TCP reachability of each device as data. This is consistent with the liveness light probing on the device cards, allowing the agent to distinguish between offline devices and environment unreachability without relying on visual inspection of the panel.

hillstone_web_login drives the device management UI login and returns a conclusion (Ready / Captcha Required / Error); if a captcha is required, the window is retained for manual completion.

WebUI Login (Optional Playwright)

WebUI Login on the device card sits alongside CLI Login. The access URL takes the form:

https://<device ip>:<web port or 443>/

Before use, please note three points from the README:

  1. Passwords do not enter the panel frontend. The Host decrypts and fills it into the browser form, reporting only Logged In / Manual Completion Required / Failed to the interface; the client side cannot access the password.
  2. Only one login attempt. After an incorrect password, the device often requires a graphical captcha; continuing automatic retries can easily lead to a lockout. Upon failure, it reports Manual Completion Required and retains the window.
  3. Browser profile persistence is located at <data dir>/webui/<device id>. Clicking the same device again usually allows direct reuse of the logged-in session.

This button launches a headed Chromium (bundled with Playwright) on the machine running DSH, occupying screen space; it is not a headless probe. Except for the WebUI, Device Management, SSH Terminal, Audit Logs, and other agent tools are usable without Playwright installed; the button will prompt the installation command to execute rather than causing the entire plugin to fail loading.

If WebUI functionality is needed, install Playwright and Chromium in the plugin environment (e.g., when using link: to copy directories):

pnpm add playwright
npx playwright install chromium

Installation and Activation

Environment Requirements: Node 22+ (declared in engines); DSH build must expose services such as tools, slots, sidebarRightTabs, sidebarRight, uiWorkspace.

After installation, a DSH main process restart is required. Simply disabling and enabling the plugin will not rebuild the host fiber of the running process; new host code for SSH, tools, and log writing only takes effect after a real restart.

Install from git (No Build Required)

The repository has committed dist/ and has no prepare script, so git dependency installation requires no build, nor does it require configuring allowBuilds in pnpm ≥ 10:

dsh plugin add github:jazhu/dsh-hillstone-cli-ops#<sha>

Replace <sha> with the commit you wish to pin.

From tarball or npm

The package files contains only dist/, locale/, cordis.patch.yml, and is ready to load upon arrival. README example:

pnpm pack && <your-dsh-plugin-install-command> ./dsh-hillstone-cli-ops-1.0.0.tgz

The filename after packaging varies with the version; subject to the actual output of pnpm pack; <your-dsh-plugin-install-command> depends on the DSH plugin installation method you use (the README does not replace this with a single fixed command).

Development Checkout (For Reference, Not Mandatory for Readers)

The development workflow provided by the maintainer in the README is pnpm install (devDependencies only) after cloning, followed by pnpm test; pnpm run build is optional, used to regenerate dist/ from src/. The task described in this article does not require readers to clone the repository.

Typical Usage Scenarios

  1. Enter Hillstone / StoneOS devices in Device Management (IP, SSH Port, Account, etc.), and confirm reachability using the liveness light or by letting the agent call hillstone_scan_liveness.
  2. Click CLI Login or let the agent use hillstone_open_terminal / hillstone_send_input / hillstone_get_output to collaborate in the “Terminal” sub-page; session details can be traced in Logs.
  3. Configure time windows and command patterns in Execution Policy to restrict the assistant from executing matching commands during sensitive periods.
  4. When batch diagnosis is needed, let the agent call hillstone_run_and_analyze and specify a natural language analysis task; if you already have a session open in the terminal, you can observe the output in the same panel.
  5. Management plane login can use WebUI Login or hillstone_web_login; in case of a captcha, complete it manually in the window opened by Playwright.

Applicable Scenarios and Notes

Suitable for: Teams or individuals already developing or operating Hillstone / StoneOS firewalls/gateways in DSH who wish for device inventories, SSH, auditing, and agent tools to form a closed loop within the same interface.

Points to Note:

  • The plugin host logic runs with the identity and permissions of the current DSH process. It can SSH to intranet devices and read/write local data directories (including WebUI profiles and session logs). Before installation, you should read the GitHub Source Code and the MIT license to confirm that credential storage and policy semantics meet your security baseline.
  • SkillHub (Plugin Directory Page) is a community plugin index and has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “Everything is a Plugin,” and this article introduces one of the community-maintained workflow plugins.
  • The public star count on the GitHub repository is 0 (based on directory clues). This does not represent functional completeness but serves only as a reference for ecosystem visibility.

Conclusion

dsh-hillstone-cli-ops integrates Hillstone / StoneOS device management, SSH terminals, connection auditing, and execution policies into the DSH right sidebar, and utilizes 9 hillstone_* tools to enable the agent to collaborate under the same sessions and rules. dist inlines ssh2 and xterm, making the installation path via git / npm / tarball build-free; WebUI Login can be added by installing Playwright as needed.

  • Directory Page: https://www.skillhub.cn/plugins/jazhu/dsh-hillstone-cli-ops
  • Source Code and README: https://github.com/jazhu/dsh-hillstone-cli-ops
羽毛球分组比赛记分
小程序二维码

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

Xiaoye