Loading...
Loading...
Add Feishu (Lark) as a channel. Uses WebSocket long connection — no public URL or ngrok needed. Works alongside WhatsApp, Telegram, Slack, or as a standalone channel.
npx skill4agent add will-17173/nanoclaw-add-feishu-skill add-feishu.nanoclaw/state.yamlfeishuapplied_skillsAskUserQuestion.nanoclaw/npx tsx scripts/apply-skill.ts --initnpx tsx scripts/apply-skill.ts .claude/skills/add-feishusrc/channels/feishu.tsregisterChannelsrc/channels/feishu.test.tsimport './feishu.js'src/channels/index.ts@larksuiteoapi/node-sdk.env.exampleFEISHU_APP_IDFEISHU_APP_SECRET.nanoclaw/state.yamlmodify/src/channels/index.ts.intent.mdnpm test
npm run buildI need you to create a Feishu app:
- Go to Feishu Open Platform (or Lark Open Platform for international)
- Click Create App → Custom App
- Fill in app name and description (e.g., "NanoClaw Assistant")
- Go to Credentials & Basic Info — copy the App ID and App Secret
- Go to Event Subscriptions → Add Events → search and add:
(Receive messages — v2.0)im.message.receive_v1- Go to Permissions & Scopes → add the following permissions:
(Send & receive messages)im:message (Send messages as bot)im:message:send_as_bot (Read chat info)im:chat (Read chat members)im:chat.members:read- Go to Bot tab → enable the bot feature
- Click Publish / Apply for Release
Note: For enterprise use, your IT admin may need to approve the app.
cli_xxxxxxxxxxxxxxxxxx.envFEISHU_APP_ID=cli_xxxxxxxxxxxxxxxxxx
FEISHU_APP_SECRET=your_app_secret_heremkdir -p data/env && cp .env data/env/envdata/env/env.envnpm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclaw # macOS
# Linux: systemctl --user restart nanoclawTo register a Feishu chat with NanoClaw, I need the chat's ID:For a direct (p2p) chat:
- Add the bot to your Feishu contacts
- Open a direct message to the bot
- Send any message — NanoClaw will log the JID as
fs:p2p:<your_open_id>- Check
for:logs/nanoclaw.logMessage from unregistered Feishu chatFor a group chat:
- Add the bot to the group: Group Settings → Members → Add Bot
- Send any message in the group (or @mention the bot)
- NanoClaw will log the JID as
fs:oc_<chat_id>- Check
for:logs/nanoclaw.logMessage from unregistered Feishu chat
tail -f logs/nanoclaw.log | grep "unregistered Feishu"fs:oc_xxxxxfs:p2p:ou_xxxxxregisterGroup("fs:<chat-id>", {
name: "<chat-name>",
folder: "feishu_main",
trigger: `@${ASSISTANT_NAME}`,
added_at: new Date().toISOString(),
requiresTrigger: false,
isMain: true,
});registerGroup("fs:<chat-id>", {
name: "<chat-name>",
folder: "feishu_<group-name>",
trigger: `@${ASSISTANT_NAME}`,
added_at: new Date().toISOString(),
requiresTrigger: true,
});Send a message to your registered Feishu chat:
- For main chat: Any message works
- For non-main: @mention the bot or include a question/request keyword
The bot should respond within a few seconds.
tail -f logs/nanoclaw.logim.message.receive_v1FEISHU_APP_IDFEISHU_APP_SECRET.envdata/env/envlaunchctl list | grep nanoclawsystemctl --user status nanoclawrequiresTrigger: falsesqlite3 store/messages.db "SELECT DISTINCT chat_jid FROM chats WHERE channel = 'feishu'".envdata/env/env| Chat type | JID format | Example |
|---|---|---|
| Group chat | | |
| Direct (p2p) | | |
npm run dev# macOS:
launchctl unload ~/Library/LaunchAgents/com.nanoclaw.plist
npm run dev
# When done testing:
launchctl load ~/Library/LaunchAgents/com.nanoclaw.plist
# Linux:
# systemctl --user stop nanoclaw
# npm run dev
# systemctl --user start nanoclawsrc/channels/feishu.tssrc/channels/feishu.test.tsimport './feishu.js'src/channels/index.tsFEISHU_APP_IDFEISHU_APP_SECRET.envsqlite3 store/messages.db "DELETE FROM registered_groups WHERE jid LIKE 'fs:%'"npm uninstall @larksuiteoapi/node-sdknpm run build && launchctl kickstart -k gui/$(id -u)/com.nanoclawnpm run build && systemctl --user restart nanoclaw