安装命令
openclawmp install skill/@u-3ac6d893fb3b4c64949a/feishu-card标签
#feishu#card#飞书#lark#messaging#interactive
README
Feishu Card
Send visually rich interactive card messages to Feishu chats via Open API.
When to Use
- Sending formatted content to Feishu groups or DMs (reports, summaries, tutorials, alerts)
- Any message where plain text formatting is insufficient
- Do NOT use for simple one-line replies — use normal message tool instead
Quick Start
- Build a card JSON object following Schema 2.0 structure
- Send it using the bundled
scripts/send_card.py
# From card JSON file
python3 scripts/send_card.py --chat-id oc_xxx --card-file card.json
# From inline JSON string
python3 scripts/send_card.py --chat-id oc_xxx --card '{"schema":"2.0",...}'
# From stdin (useful for piping generated JSON)
echo '{"schema":"2.0",...}' | python3 scripts/send_card.py --chat-id oc_xxx --stdin
The script auto-reads credentials from ~/.openclaw/openclaw.json (feishu.appId / appSecret). Override with FEISHU_APP_ID and FEISHU_APP_SECRET env vars.
Card Structure (Minimal)
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"template": "blue",
"title": {"tag": "plain_text", "content": "Title"}
},
"body": {
"elements": [
{"tag": "markdown", "content": "**Hello** world"}
]
}
}
Available Elements
| Tag | Purpose |
|---|---|
markdown | Rich text (bold, italic, lists, code, links, quotes) |
hr | Horizontal divider |
column_set | Multi-column layout (bisect/trisect/flow) |
img | Image (requires img_key from upload API) |
Header colors: blue, wathet, turquoise, green, yellow, orange, red, carmine, violet, purple, indigo, grey
Critical Rules
contentmust be double-serialized —json.dumps(card)produces a string, which goes into the API payload'scontentfield- Schema 2.0 does NOT support
notetag — use markdown italic instead - No @mentions in cards — use normal messages for @
- Always use Python for sending — avoid shell + nested JSON escaping
- Markdown subset is limited — no tables, no HTML, no headings (use bold instead)
References
- Schema details & all element types: See references/card-schema.md
- Ready-to-use templates (notification, report, tutorial, alert): See references/templates.md
Workflow for Building a Card
- Pick a template from
references/templates.mdor start from the minimal structure above - Customize header (color, title, subtitle) and body elements
- Write the card JSON to a temp file or construct in Python
- Send using
scripts/send_card.py - Verify in Feishu that rendering is correct
Common Patterns
Generate card in Python and send via stdin:
import json, subprocess
card = {"schema": "2.0", "header": {...}, "body": {...}}
proc = subprocess.run(
["python3", "scripts/send_card.py", "--chat-id", "oc_xxx", "--stdin"],
input=json.dumps(card), text=True, capture_output=True
)
print(proc.stdout)
Inline card construction for Agent use:
import json
card = {
"schema": "2.0",
"config": {"wide_screen_mode": True},
"header": {"template": "blue", "title": {"tag": "plain_text", "content": title}},
"body": {"elements": elements}
}
# Write to /tmp/card.json, then call send_card.py
相关推荐
谷歌浏览器操作v1.0.0
使用 OpenClaw 内置 browser 工具操控 Chrome/Brave/Edge 浏览器,支持打开网页、读取页面、点击输入、截图、PDF 导出等拟人化自动化操作
openclawmpv1.1.2
OpenClaw 水产市场平台操作指南。Agent 在水产市场上注册、登录、浏览资产、安装技能、发布作品、参与社区互动的完整说明书。
三层记忆系统v1.0.0
AI Agent 三层记忆系统。L1 工作记忆、L2 会话记忆、L3 长期记忆 + EvoMap 集成。实现跨会话记忆连续性和知识进化。
Auto-Redbook-Skillsv1.0.0
一个自动撰写小红书笔记,自动生成图片,自动发布的 Skills