Skills lark-integration
Connect Lark (Feishu) messaging to OpenClaw via webhook bridge. Supports text, rich text (post), and image messages bidirectionally. Use when setting up Lark/Feishu as a messaging channel, receiving messages with images, sending replies back to Lark, reading Lark documents/wikis/bitables, or troubleshooting Lark integration issues. Covers both Lark International (larksuite.com) and China Feishu (feishu.cn).
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/boyangwang/lark-integration" ~/.claude/skills/openclaw-skills-lark-integration && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/boyangwang/lark-integration" ~/.openclaw/skills/openclaw-skills-lark-integration && rm -rf "$T"
skills/boyangwang/lark-integration/SKILL.mdLark Integration
Connect Lark (Feishu) to OpenClaw for bidirectional messaging with full rich content support.
Quick Start
# 1. Set credentials echo "FEISHU_APP_ID=cli_xxx" >> ~/.openclaw/workspace/.env mkdir -p ~/.openclaw/secrets echo "your_app_secret" > ~/.openclaw/secrets/feishu_app_secret # 2. Start bridge cd skills/lark-integration/scripts node bridge-webhook.mjs # 3. Configure Lark webhook URL in developer console # https://open.larksuite.com → Your App → Event Subscriptions # URL: http://YOUR_SERVER_IP:3000/webhook
Architecture
Lark App ──webhook──► Bridge (port 3000) ──WebSocket──► OpenClaw Gateway │ │ ◄────────── Reply ──────────────────┘
Supported Message Types
| Type | Direction | Format |
|---|---|---|
| ↔ Both | Plain text |
| → Receive | Rich text with images, links |
| → Receive | Single image |
| Reply | ← Send | Text (cards via feishu-card skill) |
Platform Detection
The bridge auto-detects platform from URLs:
→*.larksuite.com
(International)https://open.larksuite.com
→*.feishu.cn
(China)https://open.feishu.cn
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
| Yes | App ID from Lark Developer Console |
| No | Path to secret file (default: ) |
| No | Webhook listen port (default: 3000) |
| No | Delay before "Thinking..." placeholder (default: 2500) |
| No | Encryption key if enabled in Lark |
| No | Agent to route messages to (default: main) |
Lark App Permissions
Enable these scopes in Lark Developer Console → Permissions & Scopes:
Messaging:
- Send and receive messagesim:message
- Send messages as botim:message:send_as_bot
- Download message resources (images)im:resource
Documents (optional):
- Read documentsdocx:document:readonly
- Read wiki spaceswiki:wiki:readonly
- Read spreadsheetssheets:spreadsheet:readonly
- Read bitablesbitable:bitable:readonly
- Access drive filesdrive:drive:readonly
Scripts
bridge-webhook.mjs
Main webhook bridge. Receives Lark events, forwards to OpenClaw, sends replies.
FEISHU_APP_ID=cli_xxx node scripts/bridge-webhook.mjs
setup-service.mjs
Install as systemd service for auto-start:
node scripts/setup-service.mjs # Creates /etc/systemd/system/lark-bridge.service
Image Handling
Images in messages are:
- Detected from
content orpost
message typeimage - Downloaded via Lark API using
andmessage_idimage_key - Converted to base64
- Sent to OpenClaw Gateway as
parameterattachments
attachments: [{ mimeType: "image/png", content: "<base64>" }]
Group Chat Behavior
In group chats, the bridge responds when:
- Bot is @mentioned
- Message ends with
or?? - Message contains trigger words: help, please, why, how, what, 帮, 请, 分析, etc.
- Message starts with bot name
Otherwise, messages are ignored to avoid noise.
Reading Documents
Use the
feishu-doc skill to read Lark documents:
node skills/feishu-doc/index.js fetch "https://xxx.larksuite.com/docx/TOKEN"
Supported URL types:
- New documents/docx/
- Wiki pages (auto-resolves to underlying doc)/wiki/
- Spreadsheets/sheets/
- Bitables (multi-dimensional tables)/base/
Permission Note: Documents must be shared with the bot, or the bot must have tenant-wide read permission.
Troubleshooting
"forBidden" error when reading docs
- Document not shared with bot → Add bot as collaborator
- Missing scope → Enable
in consoledocx:document:readonly
No messages received
- Check webhook URL is accessible:
curl http://YOUR_IP:3000/health - Verify webhook in Lark console shows "Verified"
- Check bridge logs:
journalctl -u lark-bridge -f
"must be string" error
- Old bridge version → Update to use
for imagesattachments
Images not received
- Missing
scope → Enable in Lark consoleim:resource - Token expired → Bridge auto-refreshes, restart if stuck
Service Management
# Check status systemctl status lark-bridge # View logs journalctl -u lark-bridge -f # Restart systemctl restart lark-bridge
References
- Lark Developer Console (International)
- Feishu Developer Console (China)
- See
for message format detailsreferences/api-formats.md - See
for step-by-step setupreferences/setup-guide.md