feishu-cli-msg

riba2534/feishu-cli · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/riba2534/feishu-cli --skill feishu-cli-msg
0 commentsdiscussion
summary

通过 feishu-cli 发送飞书消息、回复、转发、Reaction、Pin 等互动操作。

skill.md

飞书消息发送与互动技能

通过 feishu-cli 发送飞书消息、回复、转发、Reaction、Pin 等互动操作。

feishu-cli:如尚未安装,请前往 riba2534/feishu-cli 获取安装方式。

查看聊天记录? 请使用 feishu-cli-chat 技能(msg history/list/get/search-chats/群管理)。本技能专注于消息的发送与互动操作。

核心概念

消息架构

飞书消息 API 的 content 字段是一个 JSON 字符串(不是 JSON 对象)。CLI 提供三种输入方式:

输入方式 参数 适用场景
快捷文本 --text "内容" 纯文本消息,最简单
发送文件 --file <路径>-f 本地文件自动上传并发送(限 30MB)
发送图片 --image <路径> 本地图片自动上传并发送(限 10MB)
内联 JSON --content '{"key":"val"}'-c 简单 JSON,一行搞定
JSON 文件 --content-file file.json 复杂消息(卡片、富文本等)

互斥:以上 5 种输入方式只能指定一个,同时指定会报错。

接收者类型

--receive-id-type 说明 示例
email 邮箱地址 [email protected]
open_id Open ID ou_xxx
user_id User ID xxx
union_id Union ID on_xxx
chat_id 群聊 ID oc_xxx

消息类型选择

决策树(Claude 未指定类型时自动选择)

默认优先使用 interactive(卡片消息),样式美观、内容丰富、支持颜色/多列/按钮等。

用户需求
├─ 【默认】通知/报告/告警/任何有信息量的消息 → interactive(卡片)
├─ 发送已上传的图片/文件/音视频 → image/file/audio/media
├─ 分享群聊或用户名片 → share_chat/share_user
├─ 会话分割线(仅 p2p) → system
└─ 仅以下场景才用 text/post:
   ├─ 用户明确要求发纯文本 → text
   └─ 用户明确要求发富文本 → post

为什么优先卡片:text 不支持任何格式渲染,post 样式有限,卡片支持彩色 header、多列 fields、按钮、分割线、备注等,视觉效果远优于其他类型。

消息类型一览

类型 说明 content 格式 大小限制
text 纯文本 {"text":"内容"} 150 KB
post 富文本 {"zh_cn":{"title":"","content":[[...]]}} 150 KB
image 图片 {"image_key":"img_xxx"}
file 文件 {"file_key":"file_v2_xxx"}
audio 语音 {"file_key":"file_v2_xxx"}
media 视频 {"file_key":"...","image_key":"..."}
sticker 表情包 {"file_key":"file_v2_xxx"} 仅转发
interactive 卡片 Card JSON / template_id / card_id 30 KB
share_chat 群名片 {"chat_id":"oc_xxx"}
share_user 个人名片 {"user_id":"ou_xxx"}
system 系统分割线 {"type":"divider",...} 仅 p2p

身份说明

本技能所有命令使用 App Token(Bot 身份),无需登录。

Reaction/Pin/删除/获取消息/搜索群聊? 这些操作需要 User Token,已移至 feishu-cli-chat 技能(需先 auth login)。

发送命令

基础格式

feishu-cli msg send \
  --receive-id-type <type> \
  --receive-id <id> \
  [--msg-type <msg_type>] \
  [--text "<text>" | --file <path> | --image <path> | --content '<json>' | --content-file <file.json>]

file 类型(直发文件)

# 直接发送本地文件(自动上传,限 30MB)
feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --file /path/to/report.pdf

自动推断文件 MIME 类型(opus/mp4/pdf/doc/xls/ppt),未知类型使用 stream。超过 30MB 的文件请先用 file upload 上传到云空间,再用 --msg-type file --content '{"file_key":"..."}' 发送。

image 类型(直发图片)

# 直接发送本地图片(自动上传,限 10MB)
feishu-cli msg send \
  --receive-id-type chat_id \
  --receive-id oc_xxx \
  --image /path/to/screenshot.png

支持 JPEG、PNG、BMP、GIF、TIFF、WebP 格式。

text 类型

# 最简形式(默认 msg-type 为 text)
feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --text "你好,这是一条测试消息"

text 类型支持的内联语法:

  • @ 用户:<at user_id="ou_xxx">Tom</at>
  • @ 所有人:<at user_id="all"></at>

注意:text 类型不支持富文本样式(加粗、斜体、下划线、删除线、超链接等均不会渲染)。如需格式排版,请使用 post 类型。

post 类型(富文本)

推荐使用 md 标签承载 Markdown,一个 md 标签独占一个段落:

cat > /tmp/msg.json << 'EOF'
{
  "zh_cn": {
    "title": "项目进展通知",
    "content": [
      [{"tag": "md", "text": "**本周进展**\n- 完成功能 A 开发\n- 修复 3 个 Bug\n- [查看详情](https://example.com)"}],
      [{"tag": "md", "text": "**下周计划**\n1. 功能 B 开发\n2. 性能优化"}]
    ]
  }
}
EOF

feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --msg-type post \
  --content-file /tmp/msg.json

post 支持的 tag 类型:

tag 说明 主要属性
text 文本 text, style(bold/italic/underline/lineThrough)
a 超链接 text, href
at @用户 user_id, user_name
img 图片 image_key, width, height
media 视频 file_key, image_key
emotion 表情 emoji_type
hr 分割线
code_block 代码块 language, text
md Markdown text(独占段落,推荐使用)

interactive 类型(卡片消息)

卡片消息有三种发送方式:

方式一:完整 Card JSON(推荐,最灵活)

cat > /tmp/card.json << 'EOF'
{
  "header": {
    "template": "blue",
    "title": {"tag": "plain_text", "content": "任务完成通知"}
  },
  "elements": [
    {"tag": "markdown", "content": "**项目**: feishu-cli\n**状态**: 已完成\n**负责人**: <at id=all></at>"},
    {"tag": "hr"},
    {"tag": "note", "elements": [{"tag": "plain_text", "content": "由 CI/CD 自动发送"}]}
  ]
}
EOF

feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --msg-type interactive \
  --content-file /tmp/card.json

方式二:template_id

cat > /tmp/card.json << 'EOF'
{
  "type": "template",
  "data": {
    "template_id": "AAqk1xxxxxx",
    "template_variable": {"name": "张三", "status": "已完成"}
  }
}
EOF

feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --msg-type interactive \
  --content-file /tmp/card.json

方式三:card_id

feishu-cli msg send \
  --receive-id-type email \
  --receive-id [email protected] \
  --msg-type interactive \
  --content '{"type":"card","data":{"card_id":"7371713483664506900"}}'

Card JSON 结构(v1 vs v2)

v1 格式(推荐,兼容性好)

{
  "header": {"template": "blue", "title": {"tag": "plain_text", "content": "标题"}},
  "elements": [...]
}

v2 格式(更多组件)

{
  "schema": "2.0",
  "header": {"template": "blue", "title": {"tag": "plain_text", "content": "标题"}},
  "body": {"direction": "vertical", "elements": [...]}
}

v2 额外支持:table(表格)、chart(图表)、form_container(表单)、column_set(多列布局)等高级组件。对于简单通知,v1 足够;需要复杂布局时用 v2。

header 颜色模板

颜色值 色系 推荐场景
blue 蓝色 通用通知、信息
wathet 浅蓝 轻量提示
turquoise 青色 进行中状态
green 绿色 成功、完成
yellow 黄色 注意、提醒
orange 橙色 警告
red 红色 错误、紧急
carmine 深红 严重告警
violet 紫罗兰 特殊标记
purple 紫色 自定义分类
indigo 靛蓝 深色主题
grey 灰色 已处理、归档

语义化推荐:绿=成功 / 蓝=通知 / 橙=警告 / 红=错误 / 灰=已处理

常用组件速查

内容组件

组件 tag 说明
Markdown markdown 支持 lark_md 语法,最常用
分割线 hr 水平分割线
备注 note 底部灰色小字备注
图片 img 图片展示

布局组件

组件 tag 说明
文本+附加 div 文本块,可含 fields(多列)和 extra(右侧附加)
多列布局 column_set(v2) 横向分栏布局

交互组件

组件 tag 说明
按钮 button default/primary/danger 三种类型
下拉选择 select_static 静态下拉菜单
日期选择 date_picker 日期选择器
折叠菜单 overflow 更多操作菜单

卡片 Markdown 语法(lark_md)

卡片内 markdown 组件使用 lark_md 语法,与标准 Markdown 有差异:

# 支持的语法
**加粗** *斜体* ~~删除线~~ [链接](url) `行内代码`
![图片](img_v2_xxx)

# 特有语法
<font color='green'>绿色文字</font>
<font color='red'>红色文字</font>
<font color='grey'>灰色文字</font>
<at id=ou_xxx></at>
<at id=all></at>

注意:lark_md 的 <font color> 仅支持 green/red/grey 三种颜色。

常用卡片模板

模板

how to use feishu-cli-msg

How to use feishu-cli-msg on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add feishu-cli-msg
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/riba2534/feishu-cli --skill feishu-cli-msg

The skills CLI fetches feishu-cli-msg from GitHub repository riba2534/feishu-cli and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/feishu-cli-msg

Reload or restart Cursor to activate feishu-cli-msg. Access the skill through slash commands (e.g., /feishu-cli-msg) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.858 reviews
  • Dhruvi Jain· Dec 24, 2024

    Registry listing for feishu-cli-msg matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Kabir Ghosh· Dec 20, 2024

    We added feishu-cli-msg from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Aarav Mehta· Dec 12, 2024

    Keeps context tight: feishu-cli-msg is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Evelyn Bansal· Dec 8, 2024

    Solid pick for teams standardizing on skills: feishu-cli-msg is focused, and the summary matches what you get after install.

  • Olivia Brown· Dec 8, 2024

    feishu-cli-msg reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Noah Dixit· Nov 27, 2024

    Registry listing for feishu-cli-msg matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Ishan Iyer· Nov 27, 2024

    We added feishu-cli-msg from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Kabir Singh· Nov 19, 2024

    feishu-cli-msg fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Oshnikdeep· Nov 15, 2024

    Solid pick for teams standardizing on skills: feishu-cli-msg is focused, and the summary matches what you get after install.

  • Zara Okafor· Nov 11, 2024

    feishu-cli-msg reduced setup friction for our internal harness; good balance of opinion and flexibility.

showing 1-10 of 58

1 / 6