lark-event

Streams Lark/Feishu platform events as NDJSON via lark-cli event consume subprocesses.

Updated May 28, 2026
One-click install
npx skills add https://github.com/changfengpro/agent-skills --skill lark-event-changfengpro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lark-event
Source: https://github.com/changfengpro/agent-skills/tree/main/skills/lark-event
Command: npx skills add https://github.com/changfengpro/agent-skills --skill lark-event-changfengpro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lark-cli, and includes references (resource) components.

What problem does it solve? Building Lark/Feishu bots and integrations that react to real-time events (messages, approvals, meetings, tasks) normally requires standing up webhook servers and handling push infrastructure. This Skill lets an AI agent subscribe to and consume Lark events directly as NDJSON streams through the lark-cli event command, with a defined subprocess contract for readiness, bounded runs, and graceful shutdown. ## Core Features & Use Cases - Event discovery and schema inspection: List all subscribable EventKeys by domain (im, approval, vc, task, minutes, board, application) and inspect each key's output schema and jq root path before consuming. - Streaming consumption with filtering: Consume events as NDJSON on stdout with jq-based filtering/projection, plus bounded runs via --max-events and --timeout. - Subprocess contract for AI agents: A stderr ready marker, stdin-EOF graceful shutdown, structured JSON error envelopes, and documented exit codes make it safe to run as a managed subprocess. - Use Case: Build a bot that listens to im.message.receive_v1 as the bot identity, filters for text messages in group chats, and reacts to each incoming message in real time. ## Quick Start Ask the AI to list available Lark event keys with lark-cli event list, then start consuming im.message.receive_v1 as the bot identity to stream incoming messages.

Frequently Asked Questions about lark-event

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

FAQPage Schema
How do I listen to Lark/Feishu events in real time?

Run lark-cli event consume <EventKey> to stream events as NDJSON on stdout. First use lark-cli event list --json to find a valid EventKey, then lark-cli event schema <key> --json to inspect its output fields before writing any jq filter.

How do I filter Lark events with jq when consuming?

Pass a jq expression via --jq, for example --jq 'select(.chat_type=="p2p")'. Check the schema's jq_root_path first: flat schemas use top-level fields like .chat_id, while V2-envelope events require .event.chat_id. A jq runtime error skips that event with a stderr warning.

Can I consume multiple Lark EventKeys in one process?

No, each lark-cli event consume process accepts exactly one EventKey. To listen to multiple keys, start one subprocess per key; they share a single local bus daemon, so overhead is small and each stream keeps one output shape.

Why does my Lark event consumer exit immediately?

For unbounded runs, closing stdin (for example via /dev/null or nohup) triggers a graceful shutdown by design. Keep stdin open with a never-ending source like tail -f /dev/null, or run bounded with --max-events or --timeout, which ignore stdin EOF.

What happens if I kill -9 a Lark event consume process?

For EventKeys that register a server-side subscription and unsubscribe on exit (minutes, vc, board keys), kill -9 skips the unsubscribe call and leaks the subscription, causing 'subscription already exists' errors or duplicate delivery. Use SIGTERM or close stdin instead.

Does lark-cli event consume support both user and bot identities?

Yes, the --as user|bot|auto flag selects the identity, but support varies by EventKey. Approval, VC, and minutes keys require --as user, while task and whiteboard keys support both user and bot identities with the appropriate scopes granted.