Skip to content

Pinvou/pinvou-agent / pinvou3-app/src-tauri/resources/common/bundle/lark-skills/lark-im

lark-im

Verified

【何时用:仅当用户明确指向飞书/Lark(发到飞书、飞书文档等)时使用;泛指做个文档或PPT或表格或方案默认走本地工具,不要误用飞书】飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)与卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索或创建群聊/话题群、管理标记数据、Feed 置顶与标签数据、处理卡片回调时使用。

FileKindSize
SKILL.mdskill md24.6 KB
references/card/card-2.0-schema.mdmarkdown6.0 KB
references/card/components/button.mdmarkdown2.8 KB
references/card/components/chart.mdmarkdown2.2 KB
references/card/components/checker.mdmarkdown1.9 KB
references/card/components/collapsible_panel.mdmarkdown1.8 KB
references/card/components/column_set.mdmarkdown2.5 KB
references/card/components/date_picker.mdmarkdown1.6 KB
references/card/components/div.mdmarkdown1.7 KB
references/card/components/form.mdmarkdown2.2 KB
references/card/components/header.mdmarkdown1.6 KB
references/card/components/hr.mdmarkdown425 B
references/card/components/img.mdmarkdown1.4 KB
references/card/components/img_combination.mdmarkdown1.0 KB
references/card/components/input.mdmarkdown2.0 KB
references/card/components/interactive_container.mdmarkdown2.2 KB
references/card/components/markdown.mdmarkdown3.2 KB
references/card/components/multi_select_person.mdmarkdown1.6 KB
references/card/components/multi_select_static.mdmarkdown1.6 KB
references/card/components/overflow.mdmarkdown1.5 KB
references/card/components/person.mdmarkdown907 B
references/card/components/person_list.mdmarkdown1.2 KB
references/card/components/picker_datetime.mdmarkdown1.5 KB
references/card/components/picker_time.mdmarkdown1.5 KB
references/card/components/recycling_container.mdmarkdown1.5 KB
references/card/components/select_img.mdmarkdown1.9 KB
references/card/components/select_person.mdmarkdown1.5 KB
references/card/components/select_static.mdmarkdown1.8 KB
references/card/components/table.mdmarkdown2.1 KB
references/card/lark-im-card-create.mdmarkdown10.8 KB
references/card/lark-im-card-style.mdmarkdown18.3 KB
references/card/resource/colors.mdmarkdown1.4 KB
references/card/resource/icons.mdmarkdown2.3 KB
references/lark-im-card-action-reply.mdmarkdown9.5 KB
references/lark-im-chat-create.mdmarkdown7.9 KB
references/lark-im-chat-identity.mdmarkdown3.3 KB
references/lark-im-chat-list.mdmarkdown9.3 KB
references/lark-im-chat-members-list.mdmarkdown5.2 KB
references/lark-im-chat-messages-list.mdmarkdown11.1 KB
references/lark-im-chat-search.mdmarkdown8.4 KB
references/lark-im-chat-update.mdmarkdown3.5 KB
references/lark-im-feed-group-list-item.mdmarkdown3.1 KB
references/lark-im-feed-group-list.mdmarkdown2.7 KB
references/lark-im-feed-group-query-item.mdmarkdown2.3 KB
references/lark-im-feed-groups.mdmarkdown18.3 KB
references/lark-im-feed-shortcut-create.mdmarkdown4.2 KB
references/lark-im-feed-shortcut-list.mdmarkdown5.0 KB
references/lark-im-feed-shortcut-remove.mdmarkdown2.1 KB
references/lark-im-flag-cancel.mdmarkdown2.9 KB
references/lark-im-flag-create.mdmarkdown2.7 KB
references/lark-im-flag-list.mdmarkdown4.6 KB
references/lark-im-message-enrichment.mdmarkdown7.0 KB
references/lark-im-message-read-status.mdmarkdown4.3 KB
references/lark-im-messages-edit.mdmarkdown6.4 KB
references/lark-im-messages-mget.mdmarkdown6.8 KB
references/lark-im-messages-reply.mdmarkdown17.1 KB
references/lark-im-messages-resources-download.mdmarkdown4.2 KB
references/lark-im-messages-search.mdmarkdown13.6 KB
references/lark-im-messages-send.mdmarkdown19.3 KB
references/lark-im-reactions.mdmarkdown10.3 KB
references/lark-im-scopes.mdmarkdown2.2 KB
references/lark-im-threads-messages-list.mdmarkdown6.4 KB

references/lark-im-threads-messages-list.md

View on GitHub
# im +threads-messages-list

> **Prerequisite:** Read [`../../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.

Fetch the reply message list inside a thread. When `im +chat-messages-list` returns messages that include a `thread_id` field, use this command to inspect all replies in that thread.

By default each reply also carries a `reactions` block (counts + details from `im.reactions.batch_query`) when the server has reactions for it, and `update_time` for messages that were actually edited. Pass `--no-reactions` to skip the extra round-trip. Pass `--download-resources` to additionally download message resources (image/file/audio/video/media + post-embedded, excluding stickers) into `./lark-im-resources/` and attach a `resources` block — off by default, no extra requests when omitted. See [message enrichment](lark-im-message-enrichment.md) for the full contract.

This skill maps to the shortcut: `lark-cli im +threads-messages-list` (internally calls `GET /open-apis/im/v1/messages` with `container_id_type=thread` to fetch thread messages).

## Commands

```bash
# Get thread replies (ascending by time by default, table output)
lark-cli im +threads-messages-list --thread omt_xxx

# Reverse chronological order (latest first)
lark-cli im +threads-messages-list --thread omt_xxx --order desc

# Control page size
lark-cli im +threads-messages-list --thread omt_xxx --page-size 20

# Pagination
lark-cli im +threads-messages-list --thread omt_xxx --page-token <PAGE_TOKEN>

# Fetch multiple pages automatically, up to 10 pages by default
lark-cli im +threads-messages-list --thread omt_xxx --page-all

# Output format options
lark-cli im +threads-messages-list --thread omt_xxx --format pretty
lark-cli im +threads-messages-list --thread omt_xxx --format table
lark-cli im +threads-messages-list --thread omt_xxx --format csv

# Read thread context as compact Markdown
lark-cli im +threads-messages-list --thread omt_xxx --concise

# View as a bot
lark-cli im +threads-messages-list --thread omt_xxx --as bot

# Preview the request without executing it
lark-cli im +threads-messages-list --thread omt_xxx --dry-run
```

## Parameters

| Parameter | Required | Description |
|------|------|------|
| `--thread <id>` | Yes | Thread ID (`om_xxx` or `omt_xxx` format) |
| `--no-reactions` | No | Skip auto-fetching the `reactions` block |
| `--download-resources` | No | Download message resources (image/file/audio/video/media + post-embedded, excluding stickers) into `./lark-im-resources/` and attach a `resources` block. Off by default |
| `--order <order>` | No | Sort order: `asc` (default) / `desc` |
| `--page-size <n>` | No | Number of items per page (default 50, range 1-50) |
| `--page-token <token>` | No | Starting cursor, normally returned by a previous response |
| `--page-all` | No | Automatically fetch and merge subsequent pages; capped by `--page-limit` |
| `--page-limit <n>` | No | Maximum pages fetched by `--page-all` (default 10, range 1-1000) |
| `--format <fmt>` | No | Output format: `json` (default) / `pretty` / `table` / `ndjson` / `csv` |
| `--concise` | No | Render compact Markdown for thread context |
| `--as <identity>` | No | Identity type: `user` (default) / `bot` |
| `--dry-run` | No | Print the request only, do not execute it |

## Core Constraints

### 1. Source of `thread_id`

`thread_id` (`omt_xxx` or `om_xxx`) comes from the `thread_id` field in results returned by `im +chat-messages-list` or `im +messages-search`. Do not guess a thread ID. Fetch messages first and use the returned value.

### 2. No time filtering support

Thread messages do not support `start_time` / `end_time` filtering because of Feishu API limitations. Use pagination and sort order to control the scope.

### 3. Pagination (`has_more` / `page_token`)

Default is one page. With `--page-all`, `--page-token` sets the starting cursor; if `meta.pagination.complete=false`, resume from `meta.pagination.next_token` or raise `--page-limit`.

### 4. Recommended expansion strategy

| Scenario | Recommended Parameters |
|------|---------|
| Quickly inspect recent replies | `--order desc --page-size 10` |
| Read the full thread in chronological order | `--order asc --page-size 50`, then paginate as needed |
| Just confirm whether replies exist | `--order desc --page-size 1` |

## Usage Scenarios

### Scenario 1: Expand a thread discovered in group messages

```bash
# Step 1: Fetch group messages and find one that contains thread_id
lark-cli im +chat-messages-list --chat-id oc_xxx

# Step 2: Extract thread_id from the JSON output and fetch thread replies
lark-cli im +threads-messages-list --thread omt_xxx
```

### Scenario 2: Paginate through a long thread

```bash
# First page
lark-cli im +threads-messages-list --thread omt_xxx

# If has_more=true is returned, continue with page_token
lark-cli im +threads-messages-list --thread omt_xxx --page-token <PAGE_TOKEN>
```

## Resource Rendering

Thread replies are rendered into human-readable text. Image messages appear as placeholders such as `![Image](img_xxx)`; `folder` replies are expanded one level (children rendered inside a `<folder ...>` tag); by default resource binaries are **not** downloaded.

Pass `--download-resources` to download every eligible resource (image/file/audio/video/media + post-embedded, excluding stickers) into `./lark-im-resources/` in one pass and attach a `resources` block to each reply (see [message enrichment](lark-im-message-enrichment.md#resource-auto-download---download-resources-opt-in)). Otherwise download individual resources manually through `im +messages-resources-download` (see [lark-im-messages-resources-download](lark-im-messages-resources-download.md)).

## Common Errors and Troubleshooting

| Symptom | Root Cause | Solution |
|---------|---------|---------|
| "Invalid thread ID format" | `thread_id` does not start with `om_` or `omt_` | Use a valid `om_xxx` or `omt_xxx` value |
| Empty thread result | Wrong thread_id or no replies in the thread | Confirm the thread_id came from `im +chat-messages-list` output |
| Permission denied | The user is not authorized or is not a conversation member | Make sure OAuth authorization is complete and the identity is a chat member |

## References

- [lark-im](../SKILL.md) - all message-related commands
- [lark-im-chat-messages-list](lark-im-chat-messages-list.md) - fetch conversation messages (source of `thread_id`)
- [lark-shared](../../lark-shared/SKILL.md) - authentication and global parameters
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall