
Lark Event
Run long-lived Lark event consumers that stream IM, VC, and Minutes events as NDJSON for bots and agent subprocesses.
Install
npx skills add https://github.com/larksuite/cli --skill lark-eventWhat is this skill?
- event list / schema / consume / status / stop
- NDJSON on stdout for streaming handlers
- Bounded runs with timeout and max-events
Adoption & trust: 208k installs on skills.sh; 13.7k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Microsoft Foundrymicrosoft/azure-skills
Azure Aimicrosoft/azure-skills
Azure Hosted Copilot Sdkmicrosoft/azure-skills
Running Claude Code Via Litellm Copilotxixu-me/skills
Setup Matt Pocock Skillsmattpocock/skills
Codex Petagentspace-so/runcomfy-agent-skills
Journey fit
Common Questions / FAQ
Is Lark Event safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Lark Event
# Lark Events > **Prerequisite:** Read [`../lark-shared/SKILL.md`](../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 stderr diagnostics. **AI should not use this** — it silences the ready marker | | `--as user\|bot\|auto` | Identity for the session (see lark-shared) | ## Examples ```bash # Default: stream every event for the key (no filter, no projection) lark-cli event consume im.message.receive_v1 --as bot # 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 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). `< /dev/null` / `nohup` / systemd's default `StandardInput=null` will cause an immediate graceful exit (stderr `reason: signal`). To keep running: - 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 | | non-0 | `Error: ...` (no `exited` line) | Startup / runtime failure (permissions, network, params, config) | Orchestrators shou