Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsMar 30, 2026·1 min de lectura

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.

Listo para agents

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.

Stage only · 17/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
CLI Tool
Instalación
Stage only
Confianza
Confianza: Community
Entrada
Lark CLI Skill: Events — Real-Time Event Subscriptions
Comando de staging seguro
npx -y tokrepo@latest install d74aa20d-6376-47bd-8e48-8e9af76504e9 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el 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

Preguntas frecuentes

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.

Referencias (3)
🙏

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

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados