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

飞书富文本消息一键触达

feishu-card · vlatest
办公 安全 S 级 作者 Unknown 公开目录收录
1.2k 下载 317 安装 4.2k 收藏 34.3k 浏览

简介

由开源社区维护的飞书消息卡片工具,内置密钥扫描防护,支持Markdown代码块、人格化模板,让团队通知更生动安全。

原始描述

Send rich interactive cards to Feishu (Lark) users or groups. Supports Markdown (code blocks, tables), titles, color headers, and buttons.

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/feishu-card/
其它 Agent解压到它自己的 skills 目录,目录名用 feishu-card

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心功能

feishu-card 是一款飞书(Lark)富文本消息发送工具,支持多种内容格式和交互元素。主要功能包括:

  • 富文本卡片:支持 Markdown 渲染、代码块、表格、标题和彩色头部
  • 多种发送方式:简单文本、文件读取、安全封装三种模式
  • 图片上传:可嵌入本地图片到消息卡片
  • 交互按钮:支持添加底部操作按钮链接
  • AI 人格化消息:内置多种主题风格(警告红、绿茶粉、错误灰等)

显著优点

  1. 使用灵活:提供 --text、--text-file 和 send_safe.js 三种调用方式,兼顾简单场景与复杂 Markdown 需求
  2. 安全设计:内置 scanForSecrets 敏感信息扫描,防止 API Key 等泄露
  3. 依赖极简:仅依赖 commander 和 dotenv 两个 npm 包,无供应链攻击风险
  4. 代码质量:结构清晰,542 行代码覆盖完整功能,具备良好维护性
  5. 官方 API:仅调用飞书开放平台官方接口,HTTPS 加密传输

潜在局限

  • 子进程调用风险:send_safe.js 使用 execSync 调用自身脚本,存在理论上的命令注入可能(尽管当前已做引号包裹)
  • 临时文件路径固定:使用 ../../temp 而非系统临时目录,多实例运行时可能冲突
  • 输入验证不足:未对 --target 参数格式进行严格校验
  • 依赖前置:必须先安装 feishu-common 模块才能使用

适合人群

  • DevOps 工程师:CI/CD 流水线通知、部署状态推送
  • 运维团队:系统告警、日志异常通知
  • 开发团队:代码审查提醒、自动化报告分发
  • 需要飞书 Bot 集成的任何技术团队

使用建议

  • 发送含代码块或特殊字符的内容时,务必使用 --text-file 或 send_safe.js,避免 shell 转义问题
  • 生产环境建议改用 spawn 替代 execSync,并添加目标 ID 格式校验
  • 敏感信息扫描为辅助功能,不应替代代码审查和 Secrets 管理最佳实践

安全评估

认证报告评级 S 级(85 分),满足所有安全要求。网络流量仅指向飞书官方 API,无第三方数据上报。来源为可信组织 openclaw(T2 级),持续维护 8 个月。三项低风险发现均已提供修复建议,不影响实际使用安全。

技能正文

Feishu Card Skill

Send rich interactive cards to Feishu (Lark) users or groups. Supports Markdown (code blocks, tables), titles, color headers, and buttons.

Prerequisites

  • Install feishu-common first.
  • This skill depends on ../feishu-common/index.js for token and API auth.

Usage

1. Simple Text (No special characters)

node skills/feishu-card/send.js --target "ou_..." --text "Hello World"

2. Complex/Markdown Text (RECOMMENDED)

⚠️ CRITICAL: To prevent shell escaping issues (e.g., swallowed backticks), ALWAYS write content to a file first.

  1. Write content to a temp file:
# (Use 'write' tool)
write temp/msg.md "Here is some code:\n\`\`\`js\nconsole.log('hi');\n\`\`\`"
  1. Send using --text-file:
node skills/feishu-card/send.js --target "ou_..." --text-file "temp/msg.md"

3. Safe Send (Automated Temp File)

Use this wrapper to safely send raw text without manually creating a file. It handles file creation and cleanup automatically.

node skills/feishu-card/send_safe.js --target "ou_..." --text "Raw content with \`backticks\` and *markdown*" --title "Safe Message"

Options

  • -t, --target <id>: User Open ID (ou_...) or Group Chat ID (oc_...).
  • -x, --text <string>: Simple text content.
  • -f, --text-file <path>: Path to text file (Markdown supported). Use this for code/logs.
  • --title <string>: Card header title.
  • --color <string>: Header color (blue/red/orange/green/purple/grey). Default: blue.
  • --button-text <string>: Text for a bottom action button.
  • --button-url <url>: URL for the button.
  • --image-path <path>: Path to a local image to upload and embed.

Troubleshooting

  • Missing Text: Did you use backticks in --text? The shell likely ate them. Use --text-file instead.

4. Persona Messaging

Send stylized messages from different AI personas. Adds themed headers, colors, and formatting automatically.

node skills/feishu-card/send_persona.js --target "ou_..." --persona "d-guide" --text "Critical error detected."

Supported Personas

  • d-guide: Red warning header, bold/code prefix. Snarky suffix.
  • green-tea: Carmine header, soft/cutesy style.
  • mad-dog: Grey header, raw runtime error style.
  • default: Standard blue header.

Usage

  • -p, --persona <type>: Select persona (d-guide, green-tea, mad-dog).
  • -x, --text <string>: Message content.
  • -f, --text-file <path>: Message content from file (supports markdown).

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

标签

officeproductivityautomationcustomer-supportoperationsapi

同类 Skill