Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture with powerful backend capabilities (Agent, sessions, and tools). However, on the terminal interaction side, it often lacks a mature and polished native UI. The dsh-opencode-tui plugin aims to solve this problem. By running a protocol compatibility layer within the DSH process, it directly reuses the high-quality official opencode TUI for DSH’s drivers, giving developers an authentic terminal experience for session management and tool invocation.
Plugin Overview¶
dsh-opencode-tui is a client plugin for DeepSeek Harness (dsh). It directly reuses the opencode terminal interface and delegates the driver logic for Agent, sessions, tools, and permissions to dsh. This plugin is maintained by developer LittleFishStars and is licensed under the MIT License.
Core Features¶
- Interface Reuse: Directly reuses the original opencode TUI interface, including the session list, message stream, tool cards, thinking collapse, mouse interaction, and theme support.
- Logic Driven: DSH handles the underlying Agent, session, tool invocation, and permission management.
- Protocol Compatibility: Implements an opencode server protocol compatibility layer within the plugin process, mapping TUI HTTP requests to dsh.
- Storage Integration: Sessions and message data are stored in DSH’s session storage and support restoring historical sessions.
- Interaction Details: Supports the Ctrl+C exit dialog (No is selected by default; press Tab to switch to Yes, then press Enter to confirm) and is compatible with the v2 PermissionRequest approval flow.
Installation and Enablement¶
After successful installation, configure the following parameters in the profile’s config (default values are for reference only):
* binary: Specifies the path to lildax.
* preset: Specifies the agent preset id (defaults to the roster default).
* cwd: Sets the working directory (defaults to the current process directory).
* serverPort: Sets the compatibility layer port (random by default, or can be set via the environment variable DSH_OPENCODE_TUI_SERVER_PORT).
* args: Additional arguments passed through to the TUI.
After starting, sessions and messages are automatically saved to DSH’s session storage (the path can be redirected via DSH_OPENCODE_SESSION_ROOT).
Notes and Limitations¶
- Binary Dependency: An opencode TUI binary (such as
lildax) is required; otherwise, it cannot start. - Rendering Limitations: Due to technical limitations of the sandbox pty, the sidebar area and some flex layouts may not render properly.
- Message Format: The compatibility layer requires message formats to align strictly with the legacy SDK types. For example,
UserMessageandAssistantMessageusually do not have acontentfield and must include fields such asagent,model, andparentID; otherwise, rendering may crash. - Protocol Fault Tolerance: When legacy paths (such as
/config/providers) return 404, the TUI’sgracefulFetchhandles them as a fallback; other 404 responses are handled according to the TUI’s fault-tolerance mechanism.
Conclusion¶
dsh-opencode-tui successfully brings the mature opencode TUI experience to DeepSeek Harness through the protocol compatibility layer. It addresses the high cost of terminal UI development, allowing developers to focus on the Agent logic itself while preserving the original TUI’s interaction details and visual experience. For more technical details and source code, please visit the project homepage or plugin directory.