lizi600jin/dsh-ensp
Developer ToolsAutomates Huawei eNSP labs by generating topologies, starting devices, pushing configurations, verifying results and exporting reports.
What it does
dsh-ensp is a Windows automation shell for Huawei eNSP. It generates .topo files that eNSP can open, launches and stops simulated devices, pushes VRP configuration line by line with per-command error reporting, waits for protocol convergence, and checks lab results against scenario-specific expectations. It also exports a Word lab report containing topology details, effective device configuration, verification output and conclusions.
The same core is exposed as a CLI, a library importable from JavaScript, an MCP Server with 17 tools, and a DeepSeek Harness plugin. The built-in scenario library covers VLAN, STP, link aggregation, static routing, RIP, OSPF, BGP, IS-IS, MPLS, multicast, NAT, DHCP, ACL, QoS, port security, IPsec, IPv6, WLAN, firewalls and high availability (scenario overview).
This is aimed at network learners, instructors and lab engineers who already run eNSP and want repeatable, scriptable experiments rather than manual clicking.
Quick start
Prepare a Windows machine with eNSP and VirtualBox working, Node.js 18 or newer, and administrator rights for both eNSP and this tool. Install the CLI globally:
npm install -g dsh-ensp
Then run the recommended sequence from an elevated interactive desktop session:
ensp doctor # check environment
ensp preset ospf-single --topo lab.topo # generate topology
ensp up lab.topo # open, start and confirm devices
ensp apply ./configs --topology lab.topo --save
ensp verify ospf-single --topology lab.topo
ensp report ospf-single --topology lab.topo --out ospf-single.docx
ensp stop
The apply step expects per-device .cfg files, which can be produced with ensp preset ospf-single --config ./configs. verify retries assertions for up to 60 seconds by default because routing protocols converge asynchronously; adjust with --wait. report writes the six-chapter document only when explicitly invoked.
Alternatively, add the MCP Server from an MCP client:
{
"mcpServers": {
"ensp": {
"command": "npx",
"args": ["-y", "dsh-ensp", "mcp"]
}
}
}
DSH users can install it with dsh plugin --profile desktop add dsh-ensp.
Constraints
- Windows only; the package declares
win32because eNSP has no other platform build. - Requires an installed and working eNSP plus VirtualBox. Locations are auto-detected from flags, environment variables, registry and common paths.
- Must run elevated from an interactive desktop session. UIPI drops simulated input from lower-integrity processes, so services, scheduled tasks and SSH sessions cannot drive the GUI even when elevated.
ensp doctorreports whether input injection is available. - The eNSP window must stay visible and uncovered; the tool cannot force it to the foreground. It checks
WindowFromPointbefore clicking and refuses to click when another window covers the target. - Some device types need images that are not shipped with eNSP (notably USG6000V).
ensp imagescan inspect, andensp images <model> --install <file>can place an image you already have; the tool never downloads images. - eNSP allows one instance; the tool cleans up zombie processes holding the single-instance lock before starting.
verifyreturns exit code 3 andunverifiedwhen a scenario has no assertions, rather than claiming a pass. A few scenarios have smoke-only checks.- Licensed GPL-3.0-or-later; redistribution of modified builds must keep the notice and source under the same license (license).
HotRepo's take
On the 2026-11-16 new-project list for JavaScript, dsh-ensp recorded 103 stars and 3 stars gained in a roughly one-hour growth window, with no GitHub daily rank recorded. The repository has not appeared on a tracked all-language daily list, so there is no broader ranking signal to interpret. The notable technical fact is the project's careful handling of eNSP's awkward edges: per-device image checks, window-occlusion detection, UIPI-aware input injection and assertion-based acceptance with retries. Those are specific, verifiable engineering choices that make the CLI more than a button-click wrapper.
Resources
Written by AI from the project's README, updated . The project's own docs are the source of truth.