微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📮

飞书富媒体卡片一键推送专家

Feishu Cards · v1.0.0
这个包缺安装入口,装上也不会生效 缺 SKILL.md 或 frontmatter 不完整(NO_FRONTMATTER)。我们仍保留下载,方便你自行查看内容。
办公 安全 B 级 作者 seetherianbow 公开目录收录
984 下载 0 安装 3.6k 收藏 28 浏览

简介

飞书交互卡片发送工具,支持富文本、按钮、模板颜色,一键推送任务通知与告警消息至飞书私聊或群组。

原始描述

Send customizable interactive Feishu cards with titles, content, buttons, and color templates via Feishu Open API for users or group chats.

通过你的 Agent 添加

安装目录:feishu-cards/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/feishu-cards/
Codex CLI~/.codex/skills/feishu-cards/
DeepSeek Harness~/.agents/skills/feishu-cards/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Feishu Cards 是一款面向开发者和运维团队的飞书消息推送工具,通过调用飞书开放 API 实现交互式卡片的发送。支持两种使用模式:

CLI 命令行模式:通过 feishu-cards 命令快速发送卡片,支持指定接收者(用户或群组)、标题、内容、交互按钮及颜色模板。典型场景如定时任务完成通知、CI/CD 构建结果推送。

Python 模块模式:集成至现有 Python 项目,使用 FeishuCardSender 类程序化发送消息,便于与业务系统深度整合。

核心特性:

  • 五种预设颜色模板(blue/green/red/yellow/grey),适配不同消息类型
  • 交互按钮支持,首按钮为 primary 样式(蓝色),其余为 default(灰色)
  • 双模式 ID 支持:open_id(默认)、user_id、chat_id
  • 可选备注字段,用于附加信息

显著优点

  1. 极低接入成本:一行命令即可完成安装与发送,无需理解飞书卡片 JSON 协议细节
  2. 开箱即用:默认继承 OpenClaw 配置的飞书应用凭证,零配置启动;同时支持环境变量自定义
  3. 格式专业:相比纯文本通知,卡片式消息视觉层级清晰,提升信息阅读效率
  4. 双向灵活:既满足脚本自动化需求,也支持代码集成场景

潜在缺点与局限性

  • 交互能力受限:按钮仅支持打开 URL,需自建回调服务器才能实现表单提交、数据回传等完整交互
  • 内容格式单一:正文仅支持纯文本,不支持 Markdown 或富文本嵌套
  • 体积限制:单卡片上限 45KB,复杂内容需裁剪
  • 生态依赖:深度绑定飞书生态,无法迁移至其他 IM 平台

适合人群

  • 运维工程师:服务器监控告警、定时任务状态通知
  • 开发者:CI/CD 流水线结果推送、代码审查提醒
  • 团队管理员:群发公告、活动通知(需配合 chat_id)

常规风险

  • 凭证泄露风险:FEISHU_APP_ID 与 FEISHU_APP_SECRET 若硬编码或日志泄露,可能导致消息滥用
  • ID 误用风险:混淆 open_id 与 user_id 或 chat_id 会导致消息发送失败或误发
  • 频率限制:未明确说明但飞书 API 存在调用配额,高频场景需关注限流
  • 按钮链接安全:若按钮 URL 指向外部站点,存在钓鱼链接风险,需确保 URL 可信

技能正文

Feishu Cards

Send interactive cards to Feishu (飞书) directly via Feishu Open API.

When to Use

  • User wants to send rich interactive messages in Feishu
  • Need buttons, forms, or dropdown menus in messages
  • Want beautifully formatted messages with colors

Installation

clawhub install feishu-cards

Usage

CLI

# Basic card
feishu-cards --to "ou_xxx" --title "标题" --content "内容"

# With buttons
feishu-cards --to "ou_xxx" --title "任务" --content "有新任务" --buttons "处理,稍后"

# Custom color
feishu-cards --to "ou_xxx" --title "警告" --content "注意" --template "red"

# To chat
feishu-cards --to "oc_xxx" --type "chat_id" --title "群通知" --content "大家好"

As Python Module

from feishu_card_sender import FeishuCardSender

sender = FeishuCardSender()
result = sender.send(
    recipient_id="ou_xxx",
    title="任务提醒",
    content="你有一个新任务",
    buttons=["立即处理", "稍后提醒"],
    template="blue"
)

Options

Flag Description Default
--to Recipient ID (user or chat) Required
--type ID type: open_id, user_id, chat_id open_id
--title Card title Required
--content Card content text Required
--buttons Comma-separated buttons None
--template Color: blue, green, red, yellow, grey blue
--note Optional note None

Card Elements

  • Header - Title with color template
  • Content - Main text (plain text format)
  • Buttons - Interactive buttons (primary/default types)
  • Note - Additional info with icon

Button Types

  • primary - Blue button (first button)
  • default - Gray button (other buttons)

Examples

Task Notification

python3 feishu_card_sender.py \
  --to "ou_9d00de9a95a2fb69c425f0a39930c67a" \
  --title "📋 任务通知" \
  --content "你有一个新任务待处理" \
  --buttons "立即处理,稍后提醒" \
  --template "blue"

Alert Card

python3 feishu_card_sender.py \
  --to "ou_xxx" \
  --title "⚠️ 警告" \
  --content "账户存在异常登录" \
  --template "red" \
  --buttons "查看详情"

Requirements

  • Python 3.7+
  • requests library

Install: pip install requests

Configuration

Credentials are read from environment variables (optional):

  • FEISHU_APP_ID
  • FEISHU_APP_SECRET

Defaults to OpenClaw's configured Feishu app.

Notes

  • Cards work in Direct Messages and group chats
  • Buttons open URLs (configure your callback server for full interactivity)
  • Maximum card size: 45KB

Made for ClawHub

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

feishu飞书messagenotificationcardwebhookenterprise-imalerting

同类 Skill