Lark CLI Skill: Events — Real-Time Event Subscriptions
Lark/Feishu CLI skill for event-driven workflows. WebSocket real-time event listening with regex routing and NDJSON output.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install d74aa20d-6376-47bd-8e48-8e9af76504e9 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
This is a Lark/Feishu CLI skill for event-driven workflows. It provides WebSocket real-time event listening with regex-based routing and NDJSON output, designed for automation pipelines and integrations.
The skill is part of the Lark CLI, a command-line tool for the Lark/Feishu Open Platform. It is best for teams using Lark/Feishu for workplace collaboration who want to build event-driven automations.
How it saves time or tokens
Instead of polling the Lark API for changes, this skill uses WebSocket connections to receive events in real time. Regex routing filters events at the source, reducing noise in your pipeline. NDJSON output integrates directly with tools like jq, making it easy to chain event processing without writing custom parsers. The estimated token cost is around 500 tokens.
How to use
- Install the Lark CLI and this skill:
npm install -g @larksuite/cli
npx skills add larksuite/cli -y -g
- Configure authentication:
lark-cli config init
lark-cli auth login --recommend
- Start listening for events with regex filtering
Example
# Listen for all message events
lark-cli events listen --pattern 'im.message.*'
# Filter to specific event types with NDJSON output
lark-cli events listen --pattern 'im.message.receive_v1' --format ndjson
# Pipe to jq for processing
lark-cli events listen --pattern 'im.message.*' --format ndjson | \
jq '.event.message.content'
Related on TokRepo
- Automation tools — event-driven workflow automation
- API tools — API integration and management
Common pitfalls
- Not completing the auth setup before trying to listen for events
- Using overly broad regex patterns that flood your pipeline with irrelevant events
- Forgetting that WebSocket connections need to be re-established after network interruptions
Preguntas frecuentes
The Lark CLI is a command-line tool for the Lark/Feishu Open Platform with 200+ commands and 19 AI Agent Skills. It provides programmatic access to Lark workspace features including messaging, documents, and event subscriptions.
You specify a regex pattern when subscribing to events. Only events whose type matches the pattern are forwarded to your listener. This filters at the WebSocket level, reducing the data your pipeline processes.
NDJSON (Newline Delimited JSON) outputs one JSON object per line. This format works well with streaming tools like jq, grep, and awk, making it easy to build Unix-style processing pipelines for Lark events.
Yes. The Lark CLI supports both Lark (international) and Feishu (China) platforms. The events skill works with both, using the appropriate API endpoints based on your configuration.
The WebSocket connection management is handled by the Lark CLI. If the connection drops, the CLI attempts to reconnect automatically. For production use, wrap the listener in a process manager like PM2.
Referencias (3)
- Lark CLI GitHub— Lark CLI with 200+ commands and 19 AI Agent Skills
- Lark Developer Documentation— Lark Open Platform event subscriptions
- NDJSON Specification— NDJSON format specification
Relacionados en TokRepo
Fuente y agradecimientos
Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars
Part of the Lark CLI Official Skills Collection on TokRepo.
Discusión
Activos relacionados
Lark CLI Skill: Skill Maker — Create Custom Skills
Lark/Feishu CLI skill for creating reusable custom skills. Wrap atomic APIs or orchestrate multi-step workflows.
Lark CLI Skill: Calendar — Event & Schedule Management
Lark/Feishu CLI skill for calendar management. View agenda, create events, invite attendees, check free/busy, and get time suggestions.
Lark CLI Skill: Meeting Summary Workflow
Lark/Feishu CLI workflow skill. Aggregates meeting minutes over a time range and generates structured reports.
Lark CLI Skill: Wiki — Knowledge Base Management
Lark/Feishu CLI skill for knowledge base. Create and manage knowledge spaces, organize document nodes and shortcuts.