lark-event

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

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/TrayMachi/dotfiles --skill lark-event-traymachi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lark-event
Source: https://github.com/TrayMachi/dotfiles/tree/main/agents/skills/lark-event
Command: npx skills add https://github.com/TrayMachi/dotfiles --skill lark-event-traymachi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building Lark/Feishu bots and real-time integrations normally requires standing up webhook servers and handling push callbacks. This Skill lets an AI agent subscribe to and consume Lark events (IM messages, reactions, chat changes, VC meeting end, Minutes generated, Whiteboard updates) directly as NDJSON streams from a CLI subprocess, with bounded runs and a machine-readable ready/exit contract. ## Core Features & Use Cases - Event discovery and schema inspection: List all subscribable EventKeys with lark-cli event list and inspect params, output fields, and jq root paths via event schema <key> --json before writing filters. - Streaming consumption with jq projection: Run lark-cli event consume <EventKey> to emit one JSON event per line on stdout, optionally filtered or transformed with --jq, and bounded with --max-events or --timeout. - Subprocess orchestration contract: A fixed stderr ready marker, stdin-EOF graceful shutdown, structured JSON error envelopes, and documented exit codes (0-5) make it safe for AI agents to spawn and supervise consumers. - Use Case: Run one consumer for im.message.receive_v1 and another for im.message.reaction.created_v1 concurrently, each writing NDJSON to its own file, to power a bot that reacts to group chat activity in real time. ## Quick Start Ask the agent to list available Lark event keys, then start consuming im.message.receive_v1 as the bot with a one-event limit to inspect the payload shape.

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 from the command line?

Run lark-cli event consume <EventKey> to stream events as NDJSON on stdout. First use lark-cli event list --json to find valid keys and event schema <key> --json to inspect fields, then add --jq to filter or project each event.

How do I filter Lark im.message.receive_v1 events with jq?

Pass a jq expression via --jq, for example --jq 'select(.chat_type=="p2p") | .content' to keep only direct messages. Note that .content is pre-rendered plain text for most message types, so only apply fromjson to interactive card messages.

Can I consume multiple Lark event keys in one process?

No, each consume process takes exactly one EventKey; wildcards and comma-separated keys are unsupported. To listen to N keys, spawn N subprocesses, which all share a single local bus daemon over UDS with independent --as, --jq, and timeout settings.

Why does my Lark event consumer exit immediately?

Unbounded runs treat stdin EOF as a graceful shutdown signal, so running with /dev/null stdin or nohup causes an immediate exit. Feed stdin a source that never EOFs such as tail -f /dev/null, or run bounded with --max-events or --timeout.

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

kill -9 skips the OAPI unsubscribe step for keys with a PreConsume hook, leaking server-side subscriptions and causing subscription already exists errors or duplicate delivery on restart. Use SIGTERM or close stdin for a graceful exit instead.

Which Lark event keys require user identity instead of bot?

The VC keys (vc.meeting.participant_meeting_ended_v1, vc.note.generated_v1) and minutes.minute.generated_v1 require --as user with their respective scopes. Whiteboard updates support both --as user and --as bot but require manage access to the target whiteboard.