feishu-cli-messaging

Send, read, and manage Feishu instant messages, cards, chats, and real-time events via CLI.

1.4k|142|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/riba2534/feishu-cli --skill feishu-cli-messaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feishu-cli-messaging
Source: https://github.com/riba2534/feishu-cli/tree/main/skills/feishu-cli-messaging
Command: npx skills add https://github.com/riba2534/feishu-cli --skill feishu-cli-messaging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Operating Feishu instant messaging programmatically requires juggling message types, receiver ID formats, card JSON schemas, upload flows, and WebSocket event subscriptions. This Skill gives an AI Agent a unified, rule-checked entry point for all Feishu chat operations through the feishu-cli command line tool.

Core Features & Use Cases

  • Message Sending & Management: Send, reply, forward, merge-forward, and urgent-notify messages with idempotency keys, local media upload (images, files, Opus audio, MP4 video), and thread support.
  • Chat History & Group Administration: Export time-windowed chat history with thread expansion and sender name resolution, manage reactions, pins, group members, and external-chat edge cases.
  • Card JSON 2.0 Construction: Build interactive cards from 7 scenario templates and 19 visual presets with an offline linter that blocks placeholders, invalid nesting, and broken buttons before sending.
  • Real-Time Event Subscription: Consume Feishu events over WebSocket with bounded runs, NDJSON output, and process lifecycle management.
  • Use Case: Ask the agent to build a red alert card with an error-rate chart, lint it strictly, send it to a group chat, then subscribe to message events for 30 seconds to watch for replies.

Quick Start

Ask the AI to send a Feishu message or notification to a user or group, for example: send a project status card to chat oc_xxx using feishu-cli.

Frequently Asked Questions about feishu-cli-messaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send a Feishu message from the command line?

Use feishu-cli msg send with --receive-id-type (email, open_id, or chat_id), --receive-id, and a content flag such as --text, --markdown, --file, --image, or --content-file. Add --idempotency-key to prevent duplicate sends on retries.

How do I create and send a Feishu interactive card?

Build a Card JSON 2.0 document using the card workflow templates, validate it with lint_card.py --strict, then send it via feishu-cli msg send --msg-type interactive --content-file card.json. Local images in the card require the --upload-images flag.

Can feishu-cli read group chat history including thread replies?

Yes. Run the fetch_chat_history.py script with a chat ID and time window to export history.json, threads.json, names.json, and a readable timeline.txt. The msg history command also auto-expands threads by default since v1.27.1.

Why does sending a message with local images fail?

Any missing file, unsupported format, or upload failure aborts the entire send before the message API is called. Fix the image paths and retry with the same idempotency key; the server-side key prevents duplicate visible messages.

How do I listen for Feishu message events in real time?

Use feishu-cli event consume im.message.receive_v1 to open a WebSocket connection that streams events as NDJSON. Bound the run with --max-events and --timeout, and verify no leftover consumers with event status afterward.

What are the limitations of Feishu card messages?

Card JSON is limited to 30 KB and 200 components, tables and forms must sit directly in body.elements, and button callbacks require a server-side handler. Hex colors are rejected; only official color enums or rgba values are accepted.