본문으로 건너뛰기
Skillpedia
자동화18k · #10731

lark-event

하는 일

이 스킬은 AI 에이전트가 Lark 또는 Feishu에서 새 채팅 메시지나 작업 변경 같은 실시간 업데이트를 받도록 돕습니다. 이벤트에 따라 반응하는 봇이나 업무 흐름을 만드는 분들을 위한 스킬입니다.

사용하는 경우

  • ✓새 메시지가 도착할 때 Lark 또는 Feishu 봇이 답장하기를 원하는 경우.
  • ✓Lark에서 승인 상태 변경을 추적하고 각각에 대응해야 하는 경우.
  • ✓Lark 이벤트를 하나씩 처리하는 장시간 리스너를 만들고 있을 때.

스킬 링크

https://github.com/larksuite/cli/blob/main/skills/lark-event/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/larksuite/cli/blob/main/skills/lark-event/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 Lark 그룹에 새 메시지가 오면 반응하고 각 메시지를 기록하는 리스너를 설정해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 선택한 이벤트 유형을 듣는 Lark 명령을 시작하고, 각 이벤트를 한 줄의 데이터로 받습니다. 이벤트를 걸러내거나, 읽는 개수를 제한하거나, 정해진 시간이 지나면 멈출 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Lark Events

Prerequisite: Read ../lark-shared/SKILL.md first for authentication, --as user/bot switching, Permission denied handling, and safety rules.

Core commands

Command Purpose
lark-cli event list [--json] List all subscribable EventKeys
lark-cli event schema <EventKey> [--json] Show an EventKey's params and output schema
lark-cli event consume <EventKey> [flags] Blocking consume; events → stdout NDJSON
lark-cli event status [--json] [--fail-on-orphan] Inspect the local bus daemon status
lark-cli event stop [--all] [--force] Stop the bus daemon

Common flags

Flag Description
--param key=value / -p Business params (repeatable; comma-separated for multi-value). Unknown keys fail with valid names listed inline
--jq <expr> jq expression to filter / transform each event; empty output skips the event
--max-events N Exit after N events. Default 0 = unlimited
--timeout D Exit after duration D (e.g. 30s, 2m). Default 0 = no timeout. Whichever of --max-events / --timeout fires first wins
--output-dir <dir> Write each event as a file (relative paths only; prevents traversal)
--quiet Suppress ready/exit markers and per-event stderr diagnostics, including drop warnings. This can hide event loss. AI should not use this — it removes readiness and integrity signals
--as user|bot|auto Identity for the session (see lark-shared)

Examples

# Default: stream every event for the key (no filter, no projection)
lark-cli event consume im.message.receive_v1 --as bot

# List every EventKey of one domain (the authoritative, always-current catalog)
lark-cli event list --domain vc --json

# Grab one sample event to inspect payload shape
lark-cli event consume im.message.receive_v1 --max-events 1 --timeout 30s --as bot

# Run for 10 minutes then auto-exit
lark-cli event consume im.message.receive_v1 --timeout 10m --as bot

# Consume multiple EventKeys concurrently (one shape per process, no dispatcher)
lark-cli event consume im.message.receive_v1          --as bot > receive.ndjson &
lark-cli event consume im.message.reaction.created_v1 --as bot > reaction.ndjson &
wait

Call flow

  1. lark-cli event list --json → pick a legal key. --domain <d> narrows to one domain; the domains are application, approval, board, card, im, minutes, task, vc. An unknown domain fails with the valid set listed in the hint.
  2. lark-cli event schema <key> --json → read resolved_output_schema + jq_root_path to determine field paths
  3. lark-cli event consume <key> [--jq '<expr>'] → consume

Subprocess contract

Ready marker

event consume's stderr emits a fixed line [event] ready event_key=<key>. Parent processes should block on stderr until this line appears, then start reading stdout. Do not fall back to sleep.

stdin EOF = graceful exit

event consume treats stdin close as a shutdown signal (wired for AI subprocess callers). Bounded runs are exempt: when --max-events or --timeout is set (> 0), stdin EOF is ignored and the run exits only via its own bound, timeout, or SIGTERM. For unbounded runs, < /dev/null / nohup / systemd's default StandardInput=null will cause an immediate graceful exit (stderr reason: signal). To keep an unbounded run alive:

  • Feed stdin a source that never EOFs: < <(tail -f /dev/null)
  • Or run bounded: --max-events N / --timeout D

Exit codes & reason

On exit, the last stderr line is [event] exited — received N event(s) in Xs (reason: ...).

exit code reason Trigger
0 reason: limit --max-events reached
0 reason: timeout --timeout reached
0 reason: signal Ctrl+C / SIGTERM / stdin EOF (stdin EOF applies to unbounded runs only)
1 JSON error envelope on stderr Lark API business failure during pre-consume setup (for example subscription create/delete)
2 JSON error envelope on stderr (no exited line) Validation failure (unknown EventKey, bad --param / --jq, another bus already connected)
3 JSON error envelope on stderr Auth failure (missing token, missing scopes)
4 / 5 JSON error envelope on stderr Network / internal failure (bus startup, handshake, file I/O)

Startup and runtime failures emit a structured JSON envelope on stderr: `{"ok":false,"error":{"type"

자주 묻는 질문

Lark를 쓰기 전에 로그인해야 하나요?

네. 스킬은 로그인과 권한을 다루는 공용 Lark 설정 가이드를 가리키며, 이 가이드를 먼저 읽어야 합니다.

에이전트가 받는 이벤트 수를 제한할 수 있나요?

네. 리스너는 정해진 이벤트 수나 정해진 시간이 지나면 멈출 수 있습니다.

각 이벤트를 파일로 저장할 수 있나요?

네. 스킬은 선택한 폴더에 각 이벤트를 파일로 기록할 수 있습니다.

상세 정보

작성자의 원본 설명

Lark/Feishu real-time event listening / subscribing / consuming: stream events as NDJSON via `lark-cli event consume <EventKey>` (covers IM messages/reactions/chat changes, Approval status changes, Task updates, VC meeting started/joined/ended, Minutes generated, Whiteboard updated, etc.). Use for Lark bots, real-time message processing, long-running subscribers, streaming webhook/push handlers. Supports `--max-events` / `--timeout` bounded runs and a stderr ready-marker contract — designed for AI agents running as subprocesses.

repo: larksuite/cli

인기도

GitHub 스타
18k
순위
#10731
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

비슷한 스킬