# deepseek-harness-desktop

> Package DSH into an Electron desktop app with native window, system tray, profile switching, standalone terminal, and update checking—no need to open the web version in a browser.

## Metadata

- Author: [@anywhere-labs](https://github.com/anywhere-labs)
- Repo: <https://github.com/anywhere-labs/deepseek-harness-desktop.git>
- GitHub: [anywhere-labs/deepseek-harness-desktop](https://github.com/anywhere-labs/deepseek-harness-desktop)
- Stars: 11,481
- Language: TypeScript
- License: [MIT](https://spdx.org/licenses/MIT.html)
- Homepage: <https://dshdesktop.cn>
- Topics: `cordis`, `cordis-plugin`, `deepseek`, `deepseek-harness`, `desktop`, `dsh`, `dsh-plugin`, `dsh-plugin-desktop`
- Forks: 512
- Open Issues: 175
- Last push: 2026-08-17T16:44:20.000Z
- Added: 2026-08-17T00:00:00.000Z

## Install

```bash
dsh plugin --profile web add github:anywhere-labs/deepseek-harness-desktop/dsh-plugin-desktop
```

## Wiki

## One-Line Description

Wraps DeepSeek Harness in an Electron desktop application, using native windows and system tray to replace the "open local webpage in browser" approach. The installed app is named DSH Desktop, and the interface content remains the official DSH suite.

## Core Features

- Launch DSH as a desktop app: start a service listening only on the local loopback address within the process, then load it in a native window with navigation restricted to this address
- Provide system tray menu: reopen window, switch profile, open dedicated terminal, check for updates, switch interface mode, exit app
- Switch profiles (plugin combinations) from the tray, with changes taking effect via "save first, then orderly restart"; failed starts automatically roll back once
- Provide two interface appearances: compatibility mode uses system native borders and the official interface; advanced mode uses frosted glass title bar on macOS and Mica material on Windows
- Open a system terminal on macOS/Windows with the current profile as working directory, where the `dsh` command defaults to the current profile
- Check and download new version packages: periodic silent checks on timer; manual checks always show a result dialog

## Technical Implementation

- **Language**: TypeScript
- **Key Dependencies**: electron (host runtime, peer dependency), @deepseek-ai/cordis (plugin orchestration), @deepseek-ai/dsh series 0.1.0-rc.6 (Host and Web client capabilities), koffi (Windows volume info diagnostics)
- **Architecture Pattern**: The packaged executable does minimal startup: acquire single-instance lock, parse current profile, set up native runtime capabilities, then start the Cordis root in the Electron main process. Features are inserted via `cordis.patch.yml` as multi-line plugins (desktop shell, terminal, package management, profile, updates); windows and tray are held by effects with cleanup logic; interface is loaded via loopback HTTP/WebSocket, no preload bridge used, renderer process has context isolation and sandbox enabled, Node integration disabled
- **Entry Files**: `src/main.ts` (Electron launcher), `src/index.ts` (desktop shell plugin), `src/bin.ts` (command-line entry for non-GUI environments)

## Use Cases

Suitable for those already using DSH but not wanting to open a browser tab each time: after installation you have a standalone app that can sit in the Dock or taskbar, with the window hidden in the tray when closed. Also suitable for users who need to switch between multiple plugin combinations; the tray's profile menu is more convenient than manually editing config and restarting. If you only run DSH server-side without a UI, this plugin is not useful for you.

## Prerequisites and Compatibility

| Dependency | Minimum Version | Description |
|---|---|---|
| Node.js | ^22.19.0 or >=24.0.0 | Declared by the package's engines field |
| DSH | 0.1.0-rc.6 | Fixed dependency on this version of the DSH package family; no loose range declared |
| Electron | 43.4.0 | peer dependency; npm global install will bring it automatically; installing in profile requires manual add |
| Platform | macOS / Windows / Linux | Runs on all three, but Linux only has compatibility mode, and no tray terminal or update download |
| Native Modules | koffi, node-pty | koffi for Windows volume diagnostics; packaged product includes node-pty precompiled binaries |

## Installation

```bash
dsh plugin --profile web add github:anywhere-labs/deepseek-harness-desktop/dsh-plugin-desktop
```

## Configuration Options

| Config | Type | Description | Default |
|---|---|---|---|
| Interface Mode | `compatibility` \| `advanced` | Choose native appearance: compatibility mode loads official interface with system borders, advanced mode换成桌面专属外观; takes effect after restart, Linux doesn't accept advanced mode | `compatibility` |
| Window Width | Number (CSS pixels) | Window width on first open, minimum 800 | `1280` |
| Window Height | Number (CSS pixels) | Window height on first open, minimum 600 | `840` |
| Min Width | Number (CSS pixels) | Narrowest width allowed, minimum 640 | `900` |
| Min Height | Number (CSS pixels) | Shortest height allowed, minimum 480 | `640` |
| Background Update Check | Boolean | When disabled, packaged version no longer periodically checks for new versions; tray manual check still available | `true` |
| First Check Delay | Milliseconds | How long to wait after startup before first update check | `60000` |
| Check Interval | Milliseconds | Wait time between one check ending and the next check starting | `21600000` (6 hours) |
| Single Request Timeout | Milliseconds | Maximum wait time for one version query; timeout treated as silent failure | `15000` |

The interface mode can also be written directly in DSH home's `settings.yaml` (under `dsh-desktop.mode`); the tray selection modifies the same file.

## FAQ

**Q: After installing this plugin, can I double-click to open the desktop app directly?**

A: Not necessarily. Starting requires electron to be present: using `npm install -g dsh-plugin-desktop` will automatically install electron, but installing via profile does not auto-install; you need to add `dsh plugin --profile <name> add electron` manually. When missing, the command only prints installation guidance, it won't throw a module error.

**Q: Is the interface seen in the desktop version the same as the web version?**

A: The default compatibility mode loads the official web interface, just wrapped in a native window with system borders; macOS hides the page title, Windows removes the menu bar. After switching to advanced mode, macOS gets a transparent title bar plus sidebar frosted glass, Windows gets a Mica background.

**Q: How do I switch interface mode?**

A: Choose from the tray menu, or manually edit DSH home's `settings.yaml`, setting `dsh-desktop.mode` to `compatibility` or `advanced`. Both methods modify the same file; after committing, the app will restart orderly, it won't hot-swap while running.

**Q: Does it work on Linux?**

A: It can start, but only supports compatibility mode; writing advanced mode will be rejected rather than downgraded; the "Open DSH Terminal" command in tray is not included on Linux, nor is update package download.

**Q: Will switching profiles lose chat history?**

A: No. The default official profile shares the same sessions, settings, and storage under the DSH home; switching just swaps to a different plugin combination and restarts, it won't copy or migrate data. Custom profiles can actively change a storage location elsewhere.

**Q: I added a new plugin to the profile, why don't I see it in the desktop app?**

A: The launcher doesn't listen for changes to the profile list; after adding/removing plugins you need to restart the desktop app for changes to take effect; switching a profile from the tray will also complete this restart.

**Q: Are updates automatically installed?**

A: No. Packaged version checks once after 60 seconds of startup, then checks again every 6 hours after each check completes; it prompts for download when an update is found. On macOS it opens the downloaded DMG, requiring you to manually replace the app; Windows requires confirmation before running the installer. Checks fail silently when there's no network or versions match.

**Q: Does closing the window exit the program?**

A: No. Closing the window only hides the window; the Cordis tree in the background continues running and can be reopened from the tray; to truly exit, choose the exit command from the tray, or send SIGINT/SIGTERM.

## Getting Started Difficulty

Beginner — after installation, mode switching, profile switching, and update checking can all be done from the tray; default config works out of the box; only when installing in profile is an extra electron dependency needed.

## Known Issues and Limitations

- After adding/removing plugins in a profile, the app must be restarted; the launcher doesn't listen for profile list changes
- Switching compatibility/advanced mode inevitably restarts the app; running windows won't hot-swap appearance or plugin lines
- Linux doesn't support advanced mode, nor tray terminal commands or update package downloads
- On Windows, `pnpm` and Node helper commands exposed to the environment are `.cmd` scripts; third-party plugins that call them directly without going through shell will fail; should use managed services or shell-based launch methods
- Update process only verifies downloaded file integrity, not publisher identity; locally built Windows installers are unsigned and may trigger unknown publisher or SmartScreen warnings
- Communication between interface and backend uses local loopback HTTP/WebSocket, not Electron IPC; replacing it requires upstream DSH to provide transport extension points
- Dependency is fixed to published DSH 0.1.0-rc.6 package family; no wider version range declared
- Third-party marketplace package `dshmarket@1.2.3` is not pre-installed and is incompatible with this plugin's profile and package management capabilities; need to wait for its adapted version release

---

This document is auto-generated by [deepseek-plugin.org](https://deepseek-plugin.org). HTML page: [deepseek-harness-desktop](https://deepseek-plugin.org/plugins/anywhere-labs/deepseek-harness-desktop/dsh-plugin-desktop)
Wiki generated by AI (model: `MiniMax-M2.5`)
