
Feishu Card
- 180 installs
- 65 repo stars
- Updated March 26, 2026
- alextangson/feishu_skills
Create and send interactive Feishu/Lark cards for approvals, status updates, and bot replies so teams get actionable messages inside chat instead of plain text notifications.
About
feishu-card from alextangson/feishu_skills guides agents to design, format, and deliver Feishu interactive cards for bots and workflows, turning backend events into rich in-chat actions for enterprise teams on Lark.
- Interactive card JSON templates
- Webhook and bot delivery
- Approval and status UX patterns
- Feishu API auth guidance
- Reusable notification blocks
Feishu Card by the numbers
- 180 all-time installs (skills.sh)
- Ranked #608 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/alextangson/feishu_skills --skill feishu-cardAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 180 |
|---|---|
| repo stars | ★ 65 |
| Last updated | March 26, 2026 |
| Repository | alextangson/feishu_skills ↗ |
What it does
Create and send interactive Feishu/Lark cards for approvals, status updates, and bot replies so teams get actionable messages inside chat instead of plain text notifications.
Files
飞书交互卡片
构建、发送和处理飞书交互卡片。
Base URL: https://open.feishu.cn/open-apis/im/v1
使用场景: 晨报确认、告警处理、任务确认、状态更新
认证与 Token 获取
从 feishu_skills 根目录执行共享脚本:
TOKEN="$(./scripts/get_feishu_token.sh)"请求头统一使用 Authorization: Bearer ${TOKEN}。
如果业务接口返回 token 无效、过期或 401,强制刷新后仅重试一次原请求:
TOKEN="$(./scripts/get_feishu_token.sh --force-refresh)"环境变量:
FEISHU_APP_IDFEISHU_APP_SECRET
本地缓存: ./.feishu_token_cache.json(未过期直接复用,默认提前 5 分钟刷新)
---
发送卡片
POST /open-apis/im/v1/messages?receive_id_type=chat_id{
"receive_id": "<chat_id>",
"msg_type": "interactive",
"content": "<card_json_string>"
}⚠️ content 必须是字符串化的 JSON。
---
卡片结构
{
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "标题"},
"template": "blue"
},
"elements": [
{"tag": "div", "text": {"tag": "lark_md", "content": "**加粗**"}},
{"tag": "action", "actions": [
{"tag": "button", "text": {"tag": "plain_text", "content": "确认"}, "type": "primary", "value": {"action": "confirm"}}
]}
]
}---
常用元素
| 元素 | 说明 | 示例 |
|---|---|---|
div | 文本块 | {"tag":"div","text":{"tag":"lark_md","content":"文本"}} |
hr | 分割线 | {"tag":"hr"} |
action | 按钮组 | 见下方 |
note | 备注 | {"tag":"note","elements":[{"tag":"plain_text","content":"备注"}]} |
---
按钮
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": {"tag": "plain_text", "content": "确认"},
"type": "primary",
"value": {"action": "confirm", "data": "extra_info"}
}
]
}按钮类型: default / primary / danger
---
选择器
{
"tag": "select_static",
"placeholder": {"tag": "plain_text", "content": "请选择"},
"options": [
{"text": {"tag": "plain_text", "content": "选项1"}, "value": "opt1"},
{"text": {"tag": "plain_text", "content": "选项2"}, "value": "opt2"}
],
"value": {"key": "select_result"}
}---
回调处理
用户点击按钮后,飞书会发送 WebSocket 事件:
{
"type": "card.action.trigger",
"action": {
"value": {"action": "confirm", "data": "extra_info"}
}
}处理回调后可更新卡片:
PATCH /open-apis/im/v1/messages/{message_id}---
最佳实践
1. 按钮带 value(用于回调识别) 2. 卡片更新代替新消息(减少刷屏) 3. 危险操作用 danger 类型
{
"config": { "wide_screen_mode": true },
"header": {
"title": { "tag": "plain_text", "content": "ALERT | {{service_name}}" },
"template": "red"
},
"elements": [
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "**What happened**: {{description}}\n**Impact**: {{impact}}\n**Duration**: Offline for {{duration}}"
}
},
{ "tag": "hr" },
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Auto-fix" },
"type": "primary",
"value": { "action": "auto_fix", "service": "{{service_name}}" }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Ignore (1h)" },
"type": "default",
"value": { "action": "ignore", "service": "{{service_name}}", "ttl": 3600 }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Escalate" },
"type": "danger",
"value": { "action": "escalate", "service": "{{service_name}}" }
}
]
}
]
}
{
"config": { "wide_screen_mode": true },
"header": {
"title": { "tag": "plain_text", "content": "Morning Briefing | {{date}}" },
"template": "blue"
},
"elements": [
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "{{anomalies_section}}"
}
},
{ "tag": "hr" },
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "**Today's Action Queue**\n{{actions_list}}"
}
},
{ "tag": "hr" },
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Confirm & Execute" },
"type": "primary",
"value": { "action": "confirm_today", "date": "{{date}}" }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Adjust Priorities" },
"type": "default",
"value": { "action": "adjust_priority", "date": "{{date}}" }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "+ Add Task" },
"type": "default",
"value": { "action": "add_task", "date": "{{date}}" }
}
]
},
{
"tag": "note",
"elements": [
{ "tag": "plain_text", "content": "Generated at {{timestamp}} | Auto-synced to Bitable | Reply '确认' / '调整' / '加任务'" }
]
}
]
}
{
"config": { "wide_screen_mode": true },
"header": {
"title": { "tag": "plain_text", "content": "Skill Test | {{skill_name}} — {{result}}" },
"template": "{{template_color}}"
},
"elements": [
{
"tag": "div",
"text": {
"tag": "lark_md",
"content": "**Test #{{test_number}}** | {{date}}\n\n{{details}}\n\nPass count: **{{pass_count}}/3** needed for stable"
}
},
{ "tag": "hr" },
{
"tag": "action",
"actions": [
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Retest Now" },
"type": "default",
"value": { "action": "retest", "skill": "{{skill_name}}" }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Mark Stable" },
"type": "primary",
"value": { "action": "mark_stable", "skill": "{{skill_name}}" }
},
{
"tag": "button",
"text": { "tag": "plain_text", "content": "Archive" },
"type": "danger",
"value": { "action": "archive", "skill": "{{skill_name}}" }
}
]
}
]
}