lark-event
यह क्या करती है
यह स्किल AI एजेंट को Lark या Feishu से रीयल-टाइम अपडेट लेने में मदद करती है, जैसे नए चैट संदेश या टास्क में बदलाव। यह उन लोगों के लिए है जो बॉट या ऐसे वर्कफ़्लो बनाते हैं जिन्हें चीज़ें होते ही प्रतिक्रिया देनी हो।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि Lark या Feishu बॉट नए संदेश आते ही उनका जवाब दे।
- ✓जब आपको Lark में मंज़ूरी की स्थिति बदलने पर नज़र रखनी और हर बदलाव पर कार्रवाई करनी हो।
- ✓जब आप एक लंबे समय तक चलने वाला listener बना रहे हों, जो Lark इवेंट एक-एक करके संभाले।
Skill का लिंक
https://github.com/larksuite/cli/blob/main/skills/lark-event/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप ऐसा listener सेट कर सकते हैं जो हमारे Lark ग्रुप में नए संदेशों पर प्रतिक्रिया दे और हर संदेश का लॉग रखे?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट चुने गए इवेंट प्रकारों को सुनने वाली Lark कमांड शुरू करता है, और हर इवेंट डेटा की एक पंक्ति के रूप में पाता है। वह इवेंट छान सकता है, पढ़े जाने वाले इवेंट की संख्या सीमित कर सकता है, या तय समय के बाद रुक सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Lark Events
Prerequisite: Read
../lark-shared/SKILL.mdfirst for authentication,--as user/botswitching,Permission deniedhandling, 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
lark-cli event list --json→ pick a legal key.--domain <d>narrows to one domain; the domains areapplication,approval,board,card,im,minutes,task,vc. An unknown domain fails with the valid set listed in the hint.lark-cli event schema <key> --json→ readresolved_output_schema+jq_root_pathto determine field pathslark-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 सेटअप गाइड की ओर इशारा करती है, जो साइन-इन और अनुमतियाँ समझाती है, और उसे पहले पढ़ना चाहिए।
क्या एजेंट इवेंट की संख्या सीमित कर सकता है?
हाँ। listener तय संख्या के इवेंट के बाद या तय समय के बाद रुक सकता है।
क्या मैं हर इवेंट को फ़ाइल में सेव कर सकता हूँ?
हाँ। स्किल हर इवेंट को आपके चुने हुए फ़ोल्डर की एक फ़ाइल में लिख सकती है।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
मिलती-जुलती skills
knowledge-automation
394kयह आपके एजेंट को एक नियमित काम सेट करने देती है जो समय-सारणी पर Knowledge vault में नई सामग्री जोड़ता है, फिर जांचता है कि काम चल रहा है।
knowledge-source-ingest
394kयह आपके एजेंट को चैट चैनल, फ़ीड या मेलबॉक्स से आई नई चीज़ों से Knowledge vault अपडेट रखने देती है, बिना वह दोबारा जोड़े जो पहले से है।
benchmark
280kयह आपके एजेंट को code की speed और performance नापने में मदद करता है। यह पक्का करने और धीमेपन की समस्याएँ ढूँढने में काम आता है।