dsh-feishu-cui: Remote Control DSH via Feishu Private Messages

Introduction

Most day-to-day DSH operations are performed via the local terminal TUI or the web interface. When away from the computer, common solutions involve public network entry points, HTTPS, reverse proxies, or intranet penetration (tunneling), all of which incur high maintenance and certificate costs. dsh-feishu-cui takes a different approach: it treats Feishu (Lark) private chats as the operation interface (CUI). Messages and card callbacks reach the local dsh web plugin via the Feishu bot’s outbound long connection. Execution is still handled by the agent within the host, and sandboxing and approval policies remain determined by DSH. The following sections explain what it is, how to install it, what needs to be configured on the Feishu side, and how to use it daily.

What is this?

dsh-feishu-cui is a DSH client-type plugin released by community maintainer wanjiaju3108 (current package version 0.4.2, MIT License). Structurally, it consists of two parts: the host-side lib/ loaded with dsh web, and the browser-side settings page lib/settings/client.js mounted under the “Feishu CUI Session” section of the DSH Web interface.

It solves the core problem of: providing a remote usage entry point without public network access, without certificates, and without intranet penetration. The bot establishes a long connection to Feishu, requiring no port opening, firewall changes, or self-built relays. It uses Feishu private chats to receive/answer messages, cards for selection, and custom menus for entry points, eliminating the need to write a separate mobile client. A pairing code binds the owner once, and the bot only serves that specific individual.

Compared to the TUI, the difference lies mainly in interaction: workspace, session, model, reasoning depth, permissions, and balance are mostly handled via card and menu clicks. Private messages are queued into the current session; answers return as cards attached to the original message, updating status from “Queued” and “Processing” to “Completed” or “Failed”.

Core Features

The following capabilities are derived from the plugin’s README and repository description. Please verify the source code and license before installation.

Remote Dialogue & Queueing

  • Send text via private chat → enters the “Current Session” queue without interrupting the running turn; answers reply to the original message as a card, with the body updating progressively. Upon completion, it concludes with “Completed,” “Stopped,” or “Processing Failed.”
  • Cards only display text blocks from assistant messages; thinking, tool calls, and tool results are not shown on the screen. The full process can be viewed on the web interface.
  • “Stop” interrupts the current turn (equivalent to stopping generation on the web); “Recall” removes queued items that haven’t started yet. If the body exceeds approximately 30KB, the card prompts to view it on the web interface.

Menus & Settings (Recommended 8 submenus, event_key must match documentation)

  • Request Pairing, Workspace List, Session List (including Create New), Rename Session, Model, Reasoning Depth, Permissions, Balance.
  • Agent questions (ask_user_question, limited to questions with choices) and tool approvals pop up as cards in Feishu; the triggerer answers them.
  • When the model, permissions, or session name of the current session is modified via the web interface or CLI, a notification card (e.g., “Model Modified”) is pushed to the owner via private chat.

Connection & Boundaries

  • Survival Watchdog: Reconnects if no response frame is received for ~15 seconds; the SDK auto-reconnects, and Feishu may push events again during disconnection.
  • Serves only the owner; if a non-owner or an unpaired user interacts, messages and menus uniformly reply with “CUI Session Mismatch”.
  • Private chat only, text only; images/files/attachments are not supported. Only recognizes the “Feishu Current Session” context.
  • Credential reference names FEISHU_CUI_APP_ID / FEISHU_CUI_APP_SECRET; do not share the same self-built app with other Feishu plugins (long connection cluster mode will compete for events).

Installation & Activation

Prerequisites: DSH is installed locally, and dsh and dsh plugin are available; use the web profile (the settings page depends on the web server). Peer dependency is @deepseek-ai/dsh ≥ 0.1.7-rc.1 (current 0.2.x plugin line); if still on DSH 0.1.5, the @0.1.0 plugin must be installed.

Run the official installation command under the target profile:

dsh plugin --profile web add dsh-feishu-cui

Restart dsh web after installation (plugins are loaded only once at startup). If the installation finishes with ERR_PNPM_IGNORED_BUILDS: protobufjs, it means the postinstall of @larksuiteoapi/node-sdk was skipped by pnpm, and the plugin was not registered in the profile. Add an exception in the corresponding profile’s pnpm-workspace.yaml and install again:

# ~/.dsh/profiles/<profile>/pnpm-workspace.yaml
allowBuilds:
  protobufjs: true

When modifying plugin source code locally, you can use link: to point to the repository directory; similarly, a restart of dsh web is required.

Feishu Self-Built App (Summary)

Configure the self-built app in the Developer Console:

  1. For Event & Callback subscription, select Long Connection.
  2. Events: im.message.receive_v1, application.bot.menu_v6; Card callback: card.action.trigger.
  3. Permissions at least: im:message.p2p_msg:readonly, im:message:send_as_bot; if the settings page needs to display the bound user’s name, contact directory permissions are required, and the bound user must be included in the data permission scope (see README “On the Feishu side” for details).
  4. Availability scope: check only yourself.
  5. Bot Custom Menu: For submenus, select “Push Event”, and the event_key must match the README table (e.g., model, sessions, pairing); parent menus are only containers and should not have events configured.
  6. Create a version and publish; it takes about 5 minutes for the menu to take effect.

Fill in the App ID / App Secret in the DSH Web settings page under “Feishu CUI Session” (upon saving, it writes to $DSH_HOME/.credentials.yaml and rebuilds the long connection with the new credentials).

Typical Usage

Pairing (One-time)

  1. Click “Request Pairing” in the Feishu menu; the bot sends an input box card.
  2. Open the DSH settings page “Feishu CUI Session” and copy the pairing code (valid for 10 minutes, one-time use; cannot request if already bound).
  3. Enter the pairing code into the card and confirm; the submitter becomes the owner. To switch users, you must first “Unbind” in the settings page and then request pairing again in Feishu.

Daily Use

  1. Select or create a session in the current workspace via the “Session List” menu; if there is no current session, sending a message will prompt “No current session yet”.
  2. Send task descriptions to the bot via private chat; observe the status card under that message. If there is a queued answer card, you cannot switch sessions or workspaces via the card.
  3. Modify current session settings via menus like “Model”, “Reasoning Depth”, “Permissions”; only pairing codes and session renaming require text input.
  4. Click “Refresh” on the settings page to view long connection status, bound user, registered pairing codes, and credential status (the page does not auto-poll).

Troubleshooting

Symptom Possible Cause
No reaction when sending message Long connection not established or Feishu event subscription not fully configured
Menu no reaction and log shows “This menu item has no destination yet” event_key mismatch or parent menu mistakenly configured with an event
“CUI Session Mismatch” Not paired or sender is not the owner
“Only text messages supported” Non-text content was sent

For more complete logs and terminology explanations, see the GitHub README.

Scenarios & Notes

Who it is for: DSH users who run dsh web locally or within an intranet, wish to use mobile Feishu private chats to queue questions, switch sessions and models, handle agent questions and tool approvals, and prefer not to maintain public entry points or tunnels. The plugin is categorized as a “Client”, emphasizing the interaction entry point rather than replacing the host execution surface.

Must Know: The plugin runs agents and tools with the same permissions as the current dsh web process. Before installation, you should read the repository source code and the MIT License, and understand boundaries such as “Owner Only”, “Private Text Only”, and “Session-level Settings”. The DSH community plugin directory (e.g., SkillHub entry page) is an independent ecosystem site and has no official affiliation with DeepSeek / HiDream.

Conclusion

dsh-feishu-cui turns Feishu private chats into a CUI for DSH: utilizing outbound long connections, cards, and menus to drive common operations, eliminating the need for public network and tunnel maintenance. The installation command is dsh plugin --profile web add dsh-feishu-cui. Simply configure long connection, events, menus, and credentials on the Feishu side and complete a one-time pairing to start using it.

  • Directory Page: https://www.skillhub.cn/plugins/wanjiaju3108/dsh-feishu-cui
  • GitHub: https://github.com/wanjiaju3108/dsh-feishu-cui
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye