Cette page est affichée en anglais. Une traduction française est en cours.
SkillsMar 30, 2026·1 min de lecture

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.

Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
CLI Tool
Installation
Stage only
Confiance
Confiance : Community
Point d'entrée
Lark CLI Skill: Events — Real-Time Event Subscriptions
Commande de staging sûr
npx -y tokrepo@latest install d74aa20d-6376-47bd-8e48-8e9af76504e9 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

TL;DR
Lark CLI skill that enables real-time WebSocket event listening with regex routing and NDJSON output.
§01

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.

§02

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.

§03

How to use

  1. Install the Lark CLI and this skill:
npm install -g @larksuite/cli
npx skills add larksuite/cli -y -g
  1. Configure authentication:
lark-cli config init
lark-cli auth login --recommend
  1. Start listening for events with regex filtering
§04

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'
§05

Related on TokRepo

§06

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

Questions fréquentes

What is the Lark CLI?+

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.

How does regex routing work for events?+

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.

What is NDJSON output format?+

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.

Can I use this skill with Feishu (the China version)?+

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.

Does the skill handle reconnection automatically?+

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.

Sources citées (3)
🙏

Source et remerciements

Created by LarkSuite. Licensed under MIT. larksuite/cli — 4,100+ GitHub stars

Part of the Lark CLI Official Skills Collection on TokRepo.

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires