Feishu (Lark) IM bridge for DeepSeek Harness via `dsh plugin add`; one DM user to one persistent dsh session, with full debugging docs.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:itr-del/dsh-feishu
GitHub-sourced plugins run build scripts on your machine at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Pluggable cordis plugin wiring a Feishu self-built bot into a running DeepSeek Harness (dsh)
webprofile — installable viadsh plugin add.
┌────────┐ WS ┌──────────────┐ cordis ┌──────────┐ LLM ┌──────────┐
│ Feishu │ ──────> │ this plugin │ ──────────> │ dsh agent │ ────────> │ DeepSeek │
│ IM │ <────── │ │ <────────── │ │ <──────── │ │
└────────┘ API └──────────────┘ events └──────────┘ stream └──────────┘
Features
- One Feishu DM user ↔ one persistent dsh session (
feishu:<open_id>). - Multi-turn conversations across reconnects.
- Streams assistant replies back into Feishu, chunked at 4000 chars.
- Filters DeepSeek
<|DSML|...>tool-call markers from outbound text. - Pure ESM, no TypeScript compile step.
- No telemetry, fully local.
Installation
1. Install dsh
npm install -g @deepseek-ai/dsh
dsh web --help
2. Install the plugin
dsh plugin add dsh-feishu
This installs the plugin into ~/.dsh/profiles/web/node_modules/dsh-feishu and
patches cordis.patch.yml automatically.
3. Configure your Feishu app
Create a Custom App at https://open.feishu.cn/app and copy appId + appSecret.
Under Event Subscriptions (事件与回调):
- Set mode to Receive events via persistent connection (使用长连接接收事件/回调).
- Add the event
im.message.receive_v1.
Under Permissions (权限), grant:
im:messageim:message.p2p_msg(required for DMs)
Publish a version (发布版本) — without this the bot cannot receive events. Wait ~2 minutes after publishing.
4. Export env vars and run
export DEEPSEEK_API_KEY="sk-..."
export FEISHU_APP_ID="cli_..."
export FEISHU_APP_SECRET="..."
dsh web
You should see in logs:
[feishu] WebSocket started (appId=cli_xxx)
[feishu] FeishuBridgeService initialized
DM the bot anything — the agent will reply in the same conversation.
Environment variables
| Variable | Required | Default | Notes |
|---|---|---|---|
DEEPSEEK_API_KEY |
yes (LLM) | — | https://platform.deepseek.com |
DEEPSEEK_BASE_URL |
no | https://api.deepseek.com |
For proxies |
FEISHU_APP_ID |
yes | — | cli_xxx from app console |
FEISHU_APP_SECRET |
yes | — | From app console — never commit |
How a message flows
- User DMs the bot.
- Feishu SDK fires
im.message.receive_v1→ this plugin. - Plugin loads/creates the agent for
feishu:<open_id>. - Plugin calls
agent.followup(userMessage). - When agent returns to
idle, plugin readsagent.session.events, strips DSML noise, and posts the reply vialarkClient.im.message.create(...).
Limitations
- Text only. Image / file / card / post messages are not handled.
- No streaming. Reply sent after turn completes.
- No groups yet. DMs only.
License
MIT.
Author
itr-del — 13918029394@163.com
Built while integrating dsh with a self-hosted Feishu bot on Ubuntu 22.04.
📖 Open-sourcing story: PUBLISHING.md — how this repo got published and listed.
中文文档见 README.zh.md。
Links
More in this category
omdsh-dev/dsh-open-in-vscode★ 40
Open DSH workspace directories in VS Code directly from the web GUI.
omdsh-dev/dsh-notification★ 38
Desktop notifications for turn completions, with per-outcome controls and keyword rules.
whyihaveyou/dsh-suite#plugin-notify★ 15
IM webhook and local notifications on turn completion, errors, or approval (Feishu/WeCom/DingTalk/Slack/Discord/custom).
bobleer/dsh-acp-for-bitfun★ 9
ACP bridge between BitFun and DSH.
bill9109/dsh-web-ui-notify★ 9
Desktop notification reminders.
openma-ai/deepseek-harness-acp★ 6
ACP profile plugin and standalone stdio server for using the full DSH agent from Zed and other ACP clients while sharing DSH credentials and sessions.