The DSH plugin ecosystem supports extending client capabilities through plugins. For developers, viewing local listening ports, associated processes, and quickly handling port issues (such as port conflicts or unexpected behavior) are common, high-frequency requirements. dsh-port-manager is a locally running plugin that integrates port information directly into the DSH right sidebar, providing a visualized entry point for viewing and operations.
Plugin Overview¶
This is a zero-runtime-dependency client plugin maintained by wyzh0117 under the MIT license. It provides an entry point by registering a Guide page capsule on the right sidebar. Data collection and rendering are completed entirely locally.
Core Features¶
Sidebar Entry
On the Guide page in the right sidebar, the plugin registers a capsule with order 15. Clicking it opens the Port Manager panel in the current Pane.
Port List and Details
The panel lists all listening ports on the current machine, including the following information:
* Protocol and port
* Binding scope (localhost only, local network, all interfaces)
* Application details (application name, category badge)
* Process information (PID, CPU, memory)
* Working directory
* Container information (if associated via Docker port mapping)
Port Operations
Supports one-click operations:
* Open: Opens the corresponding address in the system browser.
* Copy: Provides multiple formats (URL, lsof command, kill command, working directory path, etc.).
* Details: Expands to show the full command line, parent process chain, all bindings, and HTTP probe results (including status code, latency, etc.).
* Locate: Opens the working directory in the file manager.
* Terminate: Supports graceful termination with SIGTERM. If the process is still alive after 1.7 seconds, it escalates to SIGKILL.
Filtering and Controls
* The toolbar displays the total number of ports, applications, exposed ports, and last scan time.
* Supports search by port, application, command, directory, and container name.
* Filters: All / Localhost only / Exposed externally / Terminable.
* Sorting: port, application, CPU, memory.
* Refresh: manual / 3s / 10s / 30s automatic refresh.
Installation and Enablement¶
- Navigate to the plugin directory.
- Run the installation command.
cd /path/to/dsh-PortManager
dsh plugin --profile web add "link:$PWD"
- Restart
dsh web. Because a new bundle layer is installed,dsh webmust be restarted for the plugin to take effect.
Verify the installation:
node -e 'const h=process.env.DSH_HOME??process.env.HOME+"/.dsh";const p=require(h+"/profiles/web/package.json");console.log(p.dependencies["dsh-port-manager"], p.dsh.profile.bundles)'
Uninstall:
dsh plugin --profile web remove dsh-port-manager
Usage¶
After installation and restart, open the DSH right sidebar and click the “Port Manager” capsule. Once the panel has loaded, you can filter ports using the search box in the toolbar, or click the action buttons on the cards (such as Open, Copy, and Terminate) to quickly handle port-related tasks.
Compatibility and Notes¶
- Platform Support: macOS and Linux are fully supported. Due to system command limitations, scanning on Windows reports errors and the list remains empty.
- UI Language: The panel UI currently supports Simplified Chinese only. Internationalization is not yet available.
- Environment Requirements: The DSH version must be
^0.1.5-rc.1or higher. The Node.js version must be>= 20.
This plugin runs with the permissions of the DSH process. It is recommended to review the source code and license before installing.