docs/channels/feishu.mdx
<Note> You need to be a Feishu enterprise user with admin privileges. </Note>Integrate CowAgent into Feishu via a custom enterprise app. Supports p2p chat and group chat (@bot), uses WebSocket long connection (no public IP needed), supports streaming typewriter replies and voice messages.
No need to manually create an app on the Feishu Developer Platform. Start the Cow project, open the web console (default http://127.0.0.1:9899/), go to Channels, click Add Channel, choose Feishu, then under the Scan QR tab click One-click Create Feishu App and scan with the Feishu App to complete app creation and connection automatically.
When starting from CLI without feishu_app_id configured, the QR code is also printed to the terminal.
Manually create a custom app on the Feishu Developer Platform, then connect via Web Console or config file.
Step 1: Create the App
Go to Feishu Developer Platform, click Create Enterprise Custom App:
In Add App Capabilities, add the Bot capability:
In Permission Management, paste the following permissions and Batch Enable all:
im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p2p_msg,im:message.p2p_msg:readonly,im:message:send_as_bot,im:resource,cardkit:card:write
App ID and App Secret from Credentials & Basic Info:Step 2: Connect to CowAgent
<Tabs> <Tab title="Web Console"> Open the web console, go to **Channels**, click **Add Channel**, choose **Feishu**, switch to the **Manual** tab, enter App ID and App Secret, then click connect. </Tab> <Tab title="Config File"> Add the following to `config.json` and start the program:```json
{
"channel_type": "feishu",
"feishu_app_id": "YOUR_APP_ID",
"feishu_app_secret": "YOUR_APP_SECRET",
"feishu_stream_reply": true
}
```
| Parameter | Description | Default |
| --- | --- | --- |
| `feishu_app_id` | Feishu app App ID | - |
| `feishu_app_secret` | Feishu app App Secret | - |
| `feishu_stream_reply` | Enable streaming typewriter reply | `true` |
| `feishu_detailed_card` | Use a detailed card (tool calls, thinking process, elapsed time) for streaming replies; off keeps the plain typewriter card | `true` |
Step 3: Publish the App
After Cow is running, go to Events & Callbacks in the Feishu Developer Platform, choose Long Connection mode and save:
Click Add Event, search for "Receive Message" and choose Receive Message v2.0.
(Optional) Under Callbacks, add Card Action Trigger (card.action.trigger) to enable /tasks scheduler commands; add the Message Recalled (im.message.recalled_v1) event to cancel a task by recalling its message.
Click Version Management & Release, create a version and apply for Production Release. Approve the request in the Feishu client:
| Feature | Status |
|---|---|
| P2P chat | ✅ |
| Group chat (@bot) | ✅ |
| Text messages | ✅ send/receive |
| Image messages | ✅ send/receive |
| Voice messages | ✅ send/receive |
| Quoted replies | ✅ quoted text and rich-post context |
| Streaming reply | ✅ (powered by Feishu cardkit streaming card) |
| Markdown card | ✅ remote images are uploaded to Feishu for static and final streaming cards |
| Detailed card | ✅ tool calls, thinking process and elapsed time (controlled by feishu_detailed_card, on by default) |
| Scheduler controls | ✅ /tasks list with enable, disable and delete buttons |
After connection, search for the bot name in Feishu to start a chat.
To use in groups, add the bot to a group and @-mention it.
Send /tasks in a private chat, or @-mention the bot with /tasks in a group, to manage tasks belonging to that chat.