bihangchi9-creator/dsh-lark-bridge
A native DeepSeek Harness (dsh) plugin bridging dsh coding agents to Feishu/Lark group chats — one group, one project directory.
编辑导读Editor's Brief
## 核心特性
- 来自飞书或 Lark 的入站消息会通过宿主 agents 服务驱动 DeepSeek Harness 智能体,回复会以流式方式回传到实时更新的飞书消息中。
- 每个聊天标识符都会映射到配置的工作区根目录下一个稳定的项目目录,为每个群聊或私聊会话创建独立文件夹。
- 会话使用固定的每个聊天会话标识符,允许每个聊天会话在重启后恢复,而不是从空上下文开始。
- 首次启动且没有凭据时,插件可以显示二维码注册向导,在扫码后创建飞书应用凭据并本地存储。
- 斜杠命令包括 /help、/new、/where 和 /model,用于显示帮助、清除聊天上下文、显示项目目录,以及显示或切换模型。
## 使用场景
- 团队可以通过将一个飞书群分配给一个工作区文件夹,并行运行多个独立编码项目。
- 启用私聊处理后,开发者可以通过飞书私聊与 dsh 编码智能体交互。
- 用户可以将对话式编码提示与独立的 Lark CLI 工作流结合,用于文档、表格、消息或日历操作。
## 技术细节
- 插件通过长连接 WebSocket 连接飞书,因此无需公网 IP 地址或回调 URL。
- 凭据可从内联插件配置、环境变量或注册向导写入的本地文件中读取。
- 该包使用 pnpm 从源码安装,将源码构建到 lib,并通过 Cordis 补丁加载到 dsh,该补丁会注入 agents、sessions、agentPresets 和 agentDefaultModel。
- 运行时配置包括面向 feishu.cn 或 larksuite.com 的租户选择、模型和提供方覆盖、工作区根目录、私聊开关,以及群聊提及要求。
## 注意事项
- 宿主需要可用的 DeepSeek Harness 代码检出、Node.js ^22.19.0 || >=24.0.0 和一个 DeepSeek API 密钥。
- 飞书机器人注册按用户进行,且在不转移机器人控制权的情况下无法共享 app secret。
- 设置 DSH_PERMISSION_MODE=danger-full-access 会禁用智能体审批提示;这是必需的,因为飞书用户无法批准本地提示。
## Core Features
- Inbound Feishu or Lark messages drive a DeepSeek Harness agent through the host agents service, and replies stream back into a live-updating Feishu message.
- Each chat identifier maps to a stable project directory under a configured workspace root, creating an isolated folder for every group or direct message conversation.
- Conversations use fixed per-chat session identifiers, allowing each chat session to resume after restarts instead of starting from an empty context.
- On first launch without credentials, the plugin can display a QR registration wizard that creates Feishu app credentials and stores them locally after scanning.
- Slash commands include /help, /new, /where, and /model for showing help, clearing chat context, showing the project directory, and showing or switching the model.
## Use Cases
- Teams can run separate coding projects in parallel by assigning one Feishu group to one workspace folder.
- Developers can interact with a dsh coding agent from Feishu direct messages when direct message handling is enabled.
- Users can combine conversational coding prompts with separate Lark CLI workflows for documents, sheets, messaging, or calendar operations.
## Technical Details
- The plugin connects to Feishu over a long-lived WebSocket, so no public IP address or callback URL is required.
- Credentials are read from inline plugin configuration, environment variables, or the local file written by the registration wizard.
- The package installs from source with pnpm, builds source into lib, and loads into dsh through a Cordis patch that injects agents, sessions, agentPresets, and agentDefaultModel.
- Runtime configuration includes tenant selection for feishu.cn or larksuite.com, model and provider overrides, workspace root, direct-message toggle, and group mention requirement.
## Notes
- The host requires a working DeepSeek Harness checkout, Node.js ^22.19.0 || >=24.0.0, and a DeepSeek API key.
- Feishu bot registration is per user, and the app secret cannot be shared without transferring control of the bot.
- Setting DSH_PERMISSION_MODE=danger-full-access disables agent approval prompts, which is required because Feishu users cannot approve local prompts.
安装Install
dsh plugin --profile web add github:bihangchi9-creator/dsh-lark-bridge
把 bihangchi9-creator/dsh-lark-bridge 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-lark-bridge
A native DeepSeek Harness (dsh) plugin that bridges dsh coding agents to Feishu / Lark group chats — one group, one project folder.
Send a message in a Feishu chat, and a real dsh agent — with its own tools, its own project directory, and its own persistent conversation — answers you right there. Each group chat is an isolated workspace, so a team can run several projects in parallel, one per group.
What it does
- Feishu ⇄ dsh agent. Inbound Feishu messages drive a live dsh agent through the host's
agentsservice; the reply streams back onto a live-updating Feishu message. - One group, one project folder. Every chat id maps to a stable directory (
<workspaceRoot>/<chatId>), created on first use. Different groups never touch each other's files. - Persistent per-chat sessions. A chat's conversation survives restarts (resume-or-create on a fixed per-chat session id).
- Zero-config setup. On first launch, if no credentials exist, the plugin auto-runs a QR registration wizard — scan it in the Feishu app and it connects automatically. No portal spelunking.
- Slash commands.
/help,/new,/where,/modelmanage each chat locally.
Architecture in one picture
① Feishu Open Platform ← register a bot here (auto QR wizard does it for you)
│ gives: app_id + app_secret
▼
② dsh-lark-bridge (this plugin) ← holds the keys, opens a WebSocket to Feishu,
│ turns each message into an agent turn
▼
③ dsh host (DeepSeek Harness) ← loads the plugin, provides the `agents` service
The bot registration lives entirely on Feishu, not in dsh. dsh only loads this plugin; the plugin then connects out to Feishu over a long-lived WebSocket (so no public IP or callback URL is needed).
Requirements
- A working DeepSeek Harness (dsh) checkout you can launch with
dsh web. - Node.js
^22.19.0 || >=24.0.0. - A DeepSeek API key (set
DEEPSEEK_API_KEY, or configure it in your dsh credentials). - A Feishu account to scan the QR code (the wizard creates the app for you).
Install
Because the dsh public npm graph is still partial, install from source alongside your dsh checkout.
# 1. Clone next to your dsh checkout
git clone https://github.com/bihangchi9-creator/dsh-lark-bridge.git
cd dsh-lark-bridge
# 2. Install & build
pnpm install
pnpm build # compiles src/ -> lib/
Then tell dsh to load it. Add the plugin row to the profile you launch (or reuse the shipped patch):
# cordis.patch.yml (already provided by this package)
- insert:
- id: lark-bridge
name: dsh-lark-bridge
inject: [agents, sessions, agentPresets, agentDefaultModel]
Launch dsh with the patch:
# from your dsh checkout
DSH_PERMISSION_MODE=danger-full-access \
dsh web --patch /path/to/dsh-lark-bridge/cordis.patch.yml
DSH_PERMISSION_MODE=danger-full-accessmakes the agent's approval policynever. This is needed because Feishu users cannot click through a local approval prompt. Only use it in an environment you trust.
First run: register your bot
Every user registers their own Feishu bot — you cannot share an app_secret, as that hands over control of your bot.
On the first launch with no credentials, the plugin prints a QR code in the terminal (and writes the raw URL to ~/.dsh-lark-bridge/register-url.txt for backgrounded runs). Steps:
- Open the Feishu mobile app, scan the QR code.
- Confirm creating a self-built app on your phone.
- The plugin receives the credentials, saves them to
~/.dsh-lark-bridge/credentials.json, and connects automatically. - Add the bot to a group (or DM it) and start talking.
Prefer to do it manually / re-register / switch accounts? Run the standalone wizard:
pnpm register # or: npx dsh-lark-register
Already have credentials? Skip the wizard entirely by exporting them:
export LARK_APP_ID=cli_xxx
export LARK_APP_SECRET=yyy
export LARK_TENANT=feishu # or `lark` for larksuite.com
Using it in a chat
| Command | What it does |
|---|---|
| (any text) | A prompt to this chat's agent |
/help |
Show help |
/new |
Start a fresh session (clears this chat's context) |
/where |
Show this chat's project directory |
/model [name] |
Show or switch the model for this chat |
In a group chat, @-mention the bot to trigger it (unless mention is disabled). In a DM, just send a message.
Configuration
Every field can come from the plugin config: block or an environment variable (env is the friendlier default).
| Config | Env var | Default | Meaning |
|---|---|---|---|
appId |
LARK_APP_ID |
— | Feishu app id (cli_...) |
appSecret |
LARK_APP_SECRET |
— | Feishu app secret |
tenant |
LARK_TENANT |
feishu |
feishu (feishu.cn) or lark (larksuite.com) |
provider |
DSH_LARK_PROVIDER |
dsh default | LLM provider route |
model |
DSH_LARK_MODEL |
dsh default | Model for created agents |
workspaceRoot |
DSH_LARK_WORKSPACE_ROOT |
~/dsh-lark-workspaces |
Root for per-chat folders |
allowDm |
DSH_LARK_ALLOW_DM |
true |
Respond in direct messages |
requireMention |
DSH_LARK_REQUIRE_MENTION |
true |
In groups, require an @-mention |
Credentials are read in this order: inline config → environment variables → the file written by the registration wizard.
Pairs well with lark-cli
If you already use lark-cli / the Lark skills to drive Feishu (docs, sheets, IM, calendar…), this plugin slots in beside it: keep using lark-cli for structured Feishu operations, and let dsh-lark-bridge be the conversational coding agent living in your group chats. You're very welcome to combine the two — for example, ask the agent in a group to draft something, then use lark-cli skills to push it into a Feishu doc.
Troubleshooting
- Bot says nothing / "(no output)" — make sure a model is resolvable (dsh's default model service must be configured, or set
DSH_LARK_MODEL). - "missing Feishu credentials" — the wizard didn't complete; re-run
pnpm registeror exportLARK_APP_ID/LARK_APP_SECRET. - QR not visible (backgrounded dsh) — open the URL saved at
~/.dsh-lark-bridge/register-url.txtin a browser. - Group messages ignored — you must
@-mention the bot, or setDSH_LARK_REQUIRE_MENTION=false.
Credits
dsh-lark-bridge is a creative extension of lark-coding-agent-bridge (originally feishu-claude-code-bridge) by zarazhangrui, by way of trae-to-lark. This project is a native DeepSeek Harness plugin reimplementation. All original work remains under its MIT license; see LICENSE and NOTICE for the full copyright chain.
amruthpillai/reactive-resume
tt-a1i/archify
zhu1090093659/dsh-web-ui
strukto-ai/mirage
liustack/modlens
omdsh-dev/DSH-better-sidebar
ccch1mneyyy/dsh-TUI