Connect Feishu chats to DeepSeek Harness projects, conversations, replies, and scoped tool approvals over WebSocket.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:452926826/dsh-feishu-bot
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 简体中文
Use DeepSeek Harness through a Feishu application bot over a WebSocket long connection, without exposing a public callback URL. On first start, the plugin can create and bind a Feishu application through a QR code, so App ID and App Secret do not need to be copied manually.
QR-code binding
When no credentials are available, the plugin starts Feishu's OAuth 2.0 Device Authorization Grant application-creation flow, renders a QR code in the DSH terminal, and writes it to:
~/.dsh/feishu-bot/feishu-bind-qr.png
Scan the code in Feishu and create and authorize the application on the confirmation page. The scanning user must have permission to create a custom application in the tenant. The QR code normally expires after about ten minutes; restart DSH to generate another one.
After confirmation, the plugin:
- Requests the
im:message:send_as_botpermission. - Subscribes to
im.message.receive_v1events. - Saves the returned credentials and the scanner's
open_idto~/.dsh/feishu-bot/credentials.jsonwith mode0600, then validates them with the tenant token API. A post-creation validation failure is logged but does not discard the credentials or create another bot. - Allows only the scanning user by default. Additional group chats can be allowed through
FEISHU_ALLOWED_CHATS. - Deletes the consumed QR code and connects to Feishu WebSocket immediately.
Publish the application as instructed by Feishu, then add the bot to a group or start a direct conversation. No public callback URL is required.
Commands
/lp: list projects/up + project name or index: select an existing project by name or by the one-based index shown by/lp, for example/up + 2/np + project name: create and select a project under the projects root/lc: list conversations in the current project with one-based indexes/uc: enter the most recently completed conversation and return its two latest user/assistant messages/uc + index: select a conversation by the index shown by/lcand return its two latest user/assistant messages/nc: create and select a conversation in the current project/approve: approve the current pending operation once/reject: reject the current pending operation/批准and/拒绝: Chinese aliases for approval and rejection/help: show help- Any other text: send it to the active Harness conversation and return the final answer to Feishu
The bot first sends a thinking placeholder and updates it with the final answer. Replies longer than 3,500 Unicode characters are split into multiple messages at newline boundaries when possible, without splitting Unicode code points. The Feishu WebSocket uses the SDK's automatic reconnect and heartbeat watchdog so short disconnects and half-open idle connections recover automatically.
When a tool requests approval, the bot sends the tool name, reason, and an argument summary. Only the Feishu chat that initiated the Harness conversation can answer with /approve or /reject. Failed delivery, timeouts, and conversations without a Feishu route are rejected or passed to another configured approval channel.
Project and conversation selections are isolated by Feishu chat_id and persisted in $DSH_HOME/feishu-bot/state.json. After every conversation completes, the bot notifies the originating chat; FEISHU_NOTIFY_CHATS can broadcast the notification to additional chats. A chat that is currently processing a message is excluded from completion notifications for other conversations, avoiding interruptions. Reply /uc to enter the most recently completed conversation directly.
Environment variables
QR binding does not require App ID or App Secret. Optional settings:
export FEISHU_PROJECTS_ROOT='/absolute/path/to/projects'
# Recommended: comma-separated Feishu chat IDs allowed to operate Harness.
export FEISHU_ALLOWED_CHATS='oc_xxx,oc_yyy'
# Optional: broadcast every completed Harness conversation to these chats.
# The originating chat is always notified as well.
export FEISHU_NOTIFY_CHATS='oc_ops,oc_owner'
Manual credentials are still supported and take precedence over saved QR-binding credentials:
export FEISHU_APP_ID='cli_xxx'
export FEISHU_APP_SECRET='xxx'
Other optional variables:
FEISHU_CREDENTIALS_PATH: saved credential file pathFEISHU_QR_PATH: QR-code PNG output pathFEISHU_QR_TERMINAL=false: disable terminal QR renderingFEISHU_REBIND=true: delete saved credentials and bind again on the next start; remove it after successful bindingFEISHU_STATE_PATH: project and conversation selection state pathDSH_HOME: Harness data directory, defaulting to~/.dsh
Installation
Install a release archive copied to the target machine:
dsh plugin --profile web add /absolute/path/to/dsh-feishu-bot-0.1.4.tgz
If installation reports Ignored build scripts: protobufjs, edit the target profile's pnpm-workspace.yaml and add:
allowBuilds:
protobufjs: true
Then repeat the installation. The default profile file is ~/.dsh/profiles/web/pnpm-workspace.yaml.
Restart Harness after installation:
dsh web
The package contains both Host and Web client plugins. When enabled, a Feishu configuration entry appears under Harness Settings > Plugins. An unbound installation displays the QR code; a bound installation only displays masked binding information. Each machine uses its own ~/.dsh/feishu-bot/credentials.json by default. Bind again on the target machine and never include App Secret or credential files in the plugin archive.
Install from source for development:
npm install
npm run check
dsh plugin --profile web add .
It can also be installed directly from GitHub:
dsh plugin --profile web add github:452926826/dsh-feishu-bot
Inspect the current binding state without reading or printing App Secret:
npm run binding:status
waiting-for-scan-confirmation means a QR code exists but the Feishu confirmation flow is incomplete. bound means credentials have been saved.
Security
The QR code contains short-lived device authorization credentials. Do not share it with anyone who should not be able to create an application. The long-lived App Secret remains in the local credential file and is never written to the QR code, repository, or cordis.patch.yml.
Ordinary bot messages are submitted to Harness as user instructions and have the same effective permissions as the active DSH profile. Configure FEISHU_ALLOWED_CHATS in production; otherwise, any Feishu chat that can contact the bot may operate Harness.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-remote-web-ui★ 8707
Remote control of a dsh web workspace from phone or PC: QR-code pairing through a token-gated channel, SSE real-time sync, and separate mobile and full desktop GUI modes.
zhu1090093659/dsh-web#packages/dsh-ssh★ 8707
SSH ops panel for DSH: web terminal, SFTP transfer with progress, local port forwarding, and one-command cluster execution across hosts; agents share the same host config.
saya-ch/dsh-mobile★ 449
Access DeepSeek Harness from the Android app or a mobile browser with secure LAN and remote connections, persistent device pairing, and a customizable mobile interface.
liguobao/ds-harness-remote★ 327
Multi-device remote access for DeepSeek Harness: continue an active session from your phone, tablet, browser, or another computer over an end-to-end encrypted channel (Noise IK + adaptive relay/WebRTC transport), with device authorization, ApiProxy-only remote capabilities, and read-only file preview via dsh-file-viewer — no shell, remote desktop, or write access.
ZSeven-W/dsh-ios★ 322
A live iOS Simulator or USB-connected iPhone inside the conversation: 22 agent tools for booting, building, driving the UI by accessibility identity or OCR text, list-row actions and SwiftUI preview hot reload, plus a streaming sidebar panel you can tap and drag on.
wenbin-wb/dsh-bridge★ 195
Remote and mobile access for DeepSeek Harness: provides LAN QR code connection, Cloudflare/custom tunnels, WeChat, QQ, Feishu, Telegram bot integration, and security authentication.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.