Examples can write chat and approval events to unprotected local files indefinitely
Source references: 5Examples background multiple consumers and redirect output to `.ndjson` files without an event limit or timeout, while the documented default is unlimited. Message content is converted to human-readable text, and Approval output includes statuses, user identifiers, and approval/task identifiers.
As events continue arriving, the files can grow until disk space is exhausted and can retain chat content and business approval metadata locally. These instructions specify no file permissions, encryption, rotation, or deletion.
The active examples redirect chat and approval streams to relative NDJSON files without event-count or timeout bounds; the documented defaults allow those consumers to run and accumulate data indefinitely. Records can include readable message content, user identifiers, approval/task identifiers, and status. The source does not establish the resulting file permissions, so “unprotected” is not proven, but persistent plaintext storage creates plausible privacy, disk-usage, and retention risks. The user can require bounds, a restricted directory, and an explicit permissions/cleanup policy.
| `--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) |Show 4 other places
# 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**`.content` shape depends on `message_type`** (this key uses a flat Custom schema; see [`events/im/message_receive.go`](../../../events/im/message_receive.go)):| message_type | `.content` shape | How to read ||---|---|---|| `text` / `post` / `image` / `file` / `audio` / `sticker` / `share_chat` / `share_user` / `media` / `system` | Human-readable text (convertlib-processed; `@mentions` resolved to display names) | Use `.content` directly || `interactive` (card) | Raw card JSON string (structured actions can't be losslessly flattened) | `.content \| fromjson` to get the card object ||---|---|---|| `approval_code` | string | Approval definition code; not a subscription dimension || `instance_code` | string | Approval instance code || `task_id` | string | Approval task id || `external_id` | string | Third-party approval external id, when present || `task_external_id` | string | Third-party task external id, when emitted || `assigned_user` | object | Task assignee or operator user IDs, omitted for automatic flows without an operator || `assigned_user.open_id` | string (open_id) | Task assignee or operator open_id, when present || `assigned_user.union_id` | string (union_id) | Task assignee or operator union_id, when present || `assigned_user.user_id` | string (user_id) | Task assignee or operator tenant user_id, when present || `status` | string enum | `REVERTED`, `PENDING`, `APPROVED`, `REJECTED`, `TRANSFERRED`, `ROLLBACK`, `DONE`, `OVERTIME_CLOSE`, `OVERTIME_RECOVER` || `operate_time` | string (timestamp_ms) | Status change time |# Broad approval status listening:# run both EventKeys as separate processes; omit subscription_type so each registers both relations.lark-cli event consume approval.instance.status_changed_v4 \ --as user > approval-instance.ndjson &lark-cli event consume approval.task.status_changed_v4 \ --as user > approval-task.ndjson &wait