
peach0x33a/dsh-open-browser
30Last commit Aug 14, 2026
dsh-open-browser DSH plugin
DSH plugin that opens the browser automatically when the dsh web server is ready. It works on macOS, Linux (X11 and Wayland), Windows, and WSL. It detects headless environments and skips opening to avoid popups in CI/containers.
How to install the dsh-open-browser DSH plugin
dsh plugin --profile web add dsh-open-browserCopying does not run this command. Review the repository and version before installing the dsh-open-browser DSH plugin.
dsh-open-browser DSH plugin data source
dsh-open-browser DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-open-browser DSH plugin can do
- Zero runtime dependencies; only peer dependency on @deepseek-ai/schemastery for config validation.
- Cross-platform: macOS, Linux (X11 & Wayland), Windows, and WSL.
- Headless safe: on Linux without DISPLAY/WAYLAND_DISPLAY and not WSL, it silently skips and prints a message.
- Precise timing: opens after the Loader tree settles, even with `--port 0` (OS-assigned port).
- Non-blocking: spawns a detached child process with `unref`, so Ctrl-C/SIGTERM is unaffected.
Where the dsh-open-browser DSH plugin fits
- Automatically open the dsh web UI after starting the server, saving manual clicks.
- Use in development workflow to instantly access the web interface.
- Run in CI/CD or headless containers without unwanted browser popups.
- Use on WSL to open the browser on the Windows host automatically.
Who the dsh-open-browser DSH plugin is for
- DSH users who run dsh web locally and want a seamless startup experience.
- Developers working on multiple platforms (macOS, Linux, Windows, WSL).
- Users who want to avoid manually opening the browser URL after each start.
dsh-open-browser DSH plugin limitations
- On Linux, if `$BROWSER` is set with arguments (e.g., 'firefox %s'), the opener will fail; it's recommended to leave it unset or use xdg-open.
- On Windows without a desktop session (services/SSH non-interactive), `Start-Process` may fail, but the dsh startup is unaffected.
- On minimalist Linux without xdg-utils, the opener will error; install xdg-utils or set `$BROWSER`.
- On WSL if interop is disabled, `powershell.exe` is unavailable and the opener will error, but startup is unaffected.
dsh-open-browser DSH plugin: from the repository README
Quoted from the peach0x33a/dsh-open-browser README, the upstream source of the dsh-open-browser DSH plugin. Copyright remains with the original authors.
DSH 插件:在 `dsh web` 启动完成、可以对外服务时,自动用系统默认浏览器打开 Web UI。 - **零运行时依赖**(仅 peer 使用 dsh 自带的 `@deepseek-ai/schemastery` 做配置校验) - **跨平台**:macOS / Linux(X11 与 Wayland)/ Windows / WSL,见下方平台矩阵 - **无头安全**:Linux 无 `DISPLAY`/`WAYLAND_DISPLAY` 且非 WSL 时静默跳过并打一行提示(CI/容器里不会乱弹) - **时机精确**:与 web-app 打印 URL 行同一就绪点(Loader 树 settle 之后),`--port 0` 的 OS 分配端口也能拿到 - **不阻塞关停**:opener 子进程 detached + `unref`,Ctrl-C/SIGTERM 关停不受影响 ## 安装 已发布到 npm(`dsh-open-browser`,GitHub: [peach0x33a/dsh-open-browser](https://github.com/peach0x33a/dsh-open-browser)),三平台安装命令一致(Windows 上 `dsh` 为 `.cmd` shim,CLI 已内部处理): ```sh # 从 npm 安装(首选) dsh plugin --profile web add dsh-open-browser # 或从 git 直装(纯 JS 无 prepare,无需 allowBuilds 授权) dsh plugin --profile web add github:peach0x33a/dsh-open-browser # 或本地目录(开发/验证) dsh plugin --profile web add /path/to/dsh-open-browser ``` `dsh plugin` 会把包加入 profile 的 `dsh.profile.bundles` 层列表。之后正常启动: ```sh npx @deepseek-ai/dsh web ``` 启动完成后终端会打印两行: ``` dsh web: http://127.0.0.1:3080 dsh-open-browser: opened http://127.0.0.1:3080 via xdg-open ``` ## 平台矩阵 | 平台 | 命令 | 说明 | |---|---|---| | macOS | `open <url>` | LaunchServices 默认浏览器;`/usr/bin/open` 始终存在 | | Linux (X11) | `xdg-open <url>` | 走桌面环境默认浏
Read the full READMERepository license: MIT
dsh-open-browser DSH plugin questions
How do I install dsh-open-browser?
Run `dsh plugin --profile web add dsh-open-browser` to install from npm. Alternatively, you can install from GitHub directly with `dsh plugin --profile web add github:peach0x33a/dsh-open-browser`. No extra permissions or build steps are needed.
Can I disable the auto-open behavior?
Yes, you can temporarily disable it by setting `open: false` in your profile's `cordis.patch.yml` under the plugin's config. For example, add `- id: dsh-open-browser` and then `config: { open: false }`. The default value is true.
Does it work on Linux without a desktop environment?
Yes, but it will detect the headless environment (no DISPLAY or WAYLAND_DISPLAY and not WSL) and skip opening, printing a skip message. This is useful for CI or server environments where you don't want a browser popup.
Which platforms are supported?
macOS (uses `open`), Linux with X11 or Wayland (uses `xdg-open`), Windows (uses `powershell.exe Start-Process`), and WSL 1/2 (uses Windows' PowerShell). On headless Linux it skips gracefully.
What if the browser doesn't open and I see an error?
Check the terminal output. Possible errors: missing `xdg-open` on Linux, `$BROWSER` set with arguments (Linux), or non-interactive Windows session. The plugin prints a clear error message but does not affect dsh startup. See the platform matrix in the README for troubleshooting.