@amaster.ai/pi-lark 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/package.json +2 -2
  2. package/skills/lark-apps/SKILL.md +39 -6
  3. package/skills/lark-apps/references/lark-apps-cloud-dev.md +5 -4
  4. package/skills/lark-apps/references/lark-apps-create.md +6 -3
  5. package/skills/lark-apps/references/lark-apps-get.md +1 -1
  6. package/skills/lark-apps/references/lark-apps-list.md +1 -1
  7. package/skills/lark-apps/references/lark-apps-local-dev.md +27 -1
  8. package/skills/lark-apps/references/lark-apps-release-create.md +1 -1
  9. package/skills/lark-base/SKILL.md +14 -6
  10. package/skills/lark-base/references/lark-base-dashboard-block-get-data.md +17 -1
  11. package/skills/lark-base/references/lark-base-dashboard.md +17 -4
  12. package/skills/lark-base/references/lark-base-data-query-guide.md +8 -0
  13. package/skills/lark-base/references/lark-base-field-create.md +19 -8
  14. package/skills/lark-base/references/lark-base-field-json.md +5 -2
  15. package/skills/lark-calendar/SKILL.md +1 -1
  16. package/skills/lark-doc/SKILL.md +26 -61
  17. package/skills/lark-doc/references/genres/business-analysis.md +30 -0
  18. package/skills/lark-doc/references/genres/data-report.md +32 -0
  19. package/skills/lark-doc/references/genres/email.md +38 -0
  20. package/skills/lark-doc/references/genres/execution-plan.md +27 -0
  21. package/skills/lark-doc/references/genres/formal-doc.md +37 -0
  22. package/skills/lark-doc/references/genres/meeting-minutes.md +24 -0
  23. package/skills/lark-doc/references/genres/memo-brief.md +25 -0
  24. package/skills/lark-doc/references/genres/official-redhead.md +73 -0
  25. package/skills/lark-doc/references/genres/prd.md +26 -0
  26. package/skills/lark-doc/references/genres/proposal.md +24 -0
  27. package/skills/lark-doc/references/genres/research-report.md +32 -0
  28. package/skills/lark-doc/references/genres/retrospective.md +25 -0
  29. package/skills/lark-doc/references/genres/route-consumer.md +37 -0
  30. package/skills/lark-doc/references/genres/route-creative.md +36 -0
  31. package/skills/lark-doc/references/genres/route-knowledge.md +39 -0
  32. package/skills/lark-doc/references/genres/route-marketing.md +40 -0
  33. package/skills/lark-doc/references/genres/route-media.md +36 -0
  34. package/skills/lark-doc/references/genres/route-opinion.md +38 -0
  35. package/skills/lark-doc/references/genres/route-personal-brand.md +36 -0
  36. package/skills/lark-doc/references/genres/route-platform.md +9 -0
  37. package/skills/lark-doc/references/genres/route-report.md +10 -0
  38. package/skills/lark-doc/references/genres/route-workplace.md +17 -0
  39. package/skills/lark-doc/references/genres/sop-tutorial.md +41 -0
  40. package/skills/lark-doc/references/genres/technical-doc.md +39 -0
  41. package/skills/lark-doc/references/genres/wechat.md +39 -0
  42. package/skills/lark-doc/references/genres/weekly-report.md +24 -0
  43. package/skills/lark-doc/references/genres/white-paper.md +32 -0
  44. package/skills/lark-doc/references/genres/xiaohongshu.md +38 -0
  45. package/skills/lark-doc/references/lark-doc-create-workflow.md +121 -0
  46. package/skills/lark-doc/references/lark-doc-create.md +22 -48
  47. package/skills/lark-doc/references/lark-doc-fetch.md +75 -92
  48. package/skills/lark-doc/references/lark-doc-history.md +16 -15
  49. package/skills/lark-doc/references/lark-doc-md.md +5 -1
  50. package/skills/lark-doc/references/lark-doc-media-download.md +2 -1
  51. package/skills/lark-doc/references/lark-doc-script.md +76 -0
  52. package/skills/lark-doc/references/lark-doc-update.md +70 -222
  53. package/skills/lark-doc/references/lark-doc-whiteboard.md +5 -9
  54. package/skills/lark-doc/references/lark-doc-xml-extended-blocks.md +17 -12
  55. package/skills/lark-doc/references/lark-doc-xml.md +38 -167
  56. package/skills/lark-drive/SKILL.md +7 -5
  57. package/skills/lark-drive/references/lark-drive-apply-permission.md +1 -1
  58. package/skills/lark-drive/references/lark-drive-copy.md +87 -0
  59. package/skills/lark-drive/references/lark-drive-download.md +2 -1
  60. package/skills/lark-drive/references/lark-drive-export.md +3 -0
  61. package/skills/lark-drive/references/lark-drive-task-result.md +3 -0
  62. package/skills/lark-drive/references/lark-drive-update-title.md +78 -0
  63. package/skills/lark-event/SKILL.md +7 -4
  64. package/skills/lark-event/references/lark-event-vc.md +8 -2
  65. package/skills/lark-im/SKILL.md +8 -8
  66. package/skills/lark-im/references/lark-im-chat-list.md +9 -2
  67. package/skills/lark-im/references/lark-im-chat-members-list.md +7 -4
  68. package/skills/lark-im/references/lark-im-chat-messages-list.md +10 -3
  69. package/skills/lark-im/references/lark-im-chat-search.md +9 -2
  70. package/skills/lark-im/references/lark-im-feed-group-list-item.md +2 -2
  71. package/skills/lark-im/references/lark-im-feed-group-list.md +2 -2
  72. package/skills/lark-im/references/lark-im-feed-shortcut-list.md +1 -1
  73. package/skills/lark-im/references/lark-im-flag-list.md +2 -2
  74. package/skills/lark-im/references/lark-im-message-enrichment.md +1 -1
  75. package/skills/lark-im/references/lark-im-messages-resources-download.md +19 -25
  76. package/skills/lark-im/references/lark-im-messages-search.md +4 -5
  77. package/skills/lark-im/references/lark-im-threads-messages-list.md +8 -4
  78. package/skills/lark-mail/references/lark-mail-triage.md +19 -4
  79. package/skills/lark-minutes/SKILL.md +1 -1
  80. package/skills/lark-minutes/references/lark-minutes-search.md +6 -7
  81. package/skills/lark-shared/SKILL.md +3 -3
  82. package/skills/lark-sheets/SKILL.md +83 -82
  83. package/skills/lark-sheets/references/lark-sheets-batch-update.md +13 -58
  84. package/skills/lark-sheets/references/lark-sheets-chart.md +2 -1
  85. package/skills/lark-sheets/references/lark-sheets-conditional-format.md +1 -1
  86. package/skills/lark-sheets/references/lark-sheets-range-operations.md +5 -5
  87. package/skills/lark-sheets/references/lark-sheets-read-data.md +80 -6
  88. package/skills/lark-sheets/references/lark-sheets-sheet-structure.md +21 -10
  89. package/skills/lark-sheets/references/lark-sheets-styles-put.md +93 -0
  90. package/skills/lark-sheets/references/lark-sheets-visual-standards.md +2 -2
  91. package/skills/lark-sheets/references/lark-sheets-workbook.md +4 -3
  92. package/skills/lark-sheets/references/lark-sheets-write-cells.md +40 -12
  93. package/skills/lark-sheets/scripts/lark_detect_subtables.py +593 -0
  94. package/skills/lark-sheets/scripts/lark_inspect_workbook.py +188 -0
  95. package/skills/lark-sheets/scripts/lark_profile_table.py +614 -0
  96. package/skills/lark-sheets/scripts/lark_sheet_range.py +176 -0
  97. package/skills/lark-sheets/scripts/lark_sheet_read_cli.py +184 -0
  98. package/skills/lark-sheets/scripts/sheets_df.py +21 -3
  99. package/skills/lark-slides/SKILL.md +27 -44
  100. package/skills/lark-slides/references/lark-slides-add-slide.md +92 -0
  101. package/skills/lark-slides/references/lark-slides-create.md +77 -65
  102. package/skills/lark-slides/references/lark-slides-delete-slide.md +65 -0
  103. package/skills/lark-slides/references/lark-slides-edit-workflows.md +6 -7
  104. package/skills/lark-slides/references/lark-slides-media-upload.md +3 -25
  105. package/skills/lark-slides/references/lark-slides-replace-slide.md +22 -1
  106. package/skills/lark-slides/references/lark-slides-screenshot.md +31 -13
  107. package/skills/lark-slides/references/lark-slides-update-slide.md +146 -0
  108. package/skills/lark-slides/references/lark-slides-xml-presentations-get.md +31 -8
  109. package/skills/lark-slides/references/slides_chart_demo.xml +1 -2
  110. package/skills/lark-slides/references/slides_xml_schema_definition.xml +48 -4
  111. package/skills/lark-slides/references/troubleshooting.md +7 -8
  112. package/skills/lark-slides/references/validation-checklist.md +4 -4
  113. package/skills/lark-slides/references/xml-schema-quick-ref.md +23 -11
  114. package/skills/lark-slides/scripts/sxsd_validator.py +154 -10
  115. package/skills/lark-slides/scripts/xml_text_overlap_lint.py +360 -76
  116. package/skills/lark-slides/scripts/xml_text_overlap_lint_test.py +1138 -214
  117. package/skills/lark-whiteboard/SKILL.md +15 -8
  118. package/skills/lark-whiteboard/references/lark-whiteboard-export.md +4 -3
  119. package/skills/lark-whiteboard/references/lark-whiteboard-update.md +4 -4
  120. package/skills/lark-whiteboard/references/lark-whiteboard-workflow.md +19 -17
  121. package/skills/lark-whiteboard/routes/dsl.md +8 -2
  122. package/skills/lark-whiteboard/routes/mermaid.md +1 -1
  123. package/skills/lark-whiteboard/routes/svg-edit.md +5 -2
  124. package/skills/lark-whiteboard/routes/svg.md +3 -1
  125. package/skills/lark-whiteboard/scenes/mention.md +71 -0
  126. package/skills/lark-wiki/SKILL.md +5 -3
  127. package/skills/lark-wiki/references/lark-wiki-delete-space.md +6 -3
  128. package/skills/lark-doc/references/lark-doc-word-stat.md +0 -93
  129. package/skills/lark-doc/references/style/lark-doc-create-workflow.md +0 -47
  130. package/skills/lark-doc/references/style/lark-doc-style.md +0 -68
  131. package/skills/lark-doc/references/style/lark-doc-update-workflow.md +0 -48
  132. package/skills/lark-doc/scripts/doc_word_stat.py +0 -1243
  133. package/skills/lark-slides/references/lark-slides-replace-pages.md +0 -95
  134. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-create.md +0 -219
  135. package/skills/lark-slides/references/lark-slides-xml-presentation-slide-delete.md +0 -126
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lark-im
3
3
  version: 1.0.0
4
- description: "飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件(支持大文件分片下载)、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。"
4
+ description: "飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。"
5
5
  metadata:
6
6
  requires:
7
7
  bins: ["lark-cli"]
@@ -56,7 +56,7 @@ The four message-pulling shortcuts (`+messages-mget`, `+chat-messages-list`, `+m
56
56
 
57
57
  ### Opt-in resource auto-download (`--download-resources`)
58
58
 
59
- `+chat-messages-list`, `+messages-mget`, and `+threads-messages-list` accept `--download-resources` (**off by default** — no `resources` block and no extra requests when omitted). When set, eligible message resources (image/file/audio/video/media + post-embedded; **stickers excluded**) are downloaded into `./lark-im-resources/` and each message gains a `resources` array of `{message_id, key, type, local_path, size_bytes}`. Downloads are deduped by `(message_id, file_key)`, run with bounded concurrency, and isolate single-resource failures (`error: true` + stderr warning). **Scope:** requires `im:message:readonly` (already declared by the listing commands — no extra scope); works under both user and bot identity. For one-off downloads use [`+messages-resources-download`](references/lark-im-messages-resources-download.md). Full contract: [`references/lark-im-message-enrichment.md`](references/lark-im-message-enrichment.md).
59
+ `+chat-messages-list`, `+messages-mget`, and `+threads-messages-list` accept `--download-resources` to save eligible attachments into `./lark-im-resources/` and add a `resources` array to each message. It is off by default; stickers are not downloadable. A failed attachment is reported on that resource without aborting the message pull. Use [`+messages-resources-download`](references/lark-im-messages-resources-download.md) for one attachment. See [`references/lark-im-message-enrichment.md`](references/lark-im-message-enrichment.md) for the output contract.
60
60
 
61
61
  ### Card Messages (Interactive)
62
62
 
@@ -104,17 +104,17 @@ Shortcut 是对常用操作的高级封装(`lark-cli im +<verb> [flags]`)。
104
104
  | Shortcut | 说明 |
105
105
  |----------|------|
106
106
  | [`+chat-create`](references/lark-im-chat-create.md) | Create a group chat or topic chat; user/bot; --chat-mode group|topic; private/public; invites users/bots; optionally sets bot manager |
107
- | [`+chat-list`](references/lark-im-chat-list.md) | List chats the current user/bot is a member of; defaults to groups; pass --types=p2p,group to include p2p single chats (user-only); user/bot; supports sorting, pagination, --exclude-muted (user-only) |
107
+ | [`+chat-list`](references/lark-im-chat-list.md) | List chats the current user/bot is a member of; defaults to groups; pass --types=p2p,group to include p2p single chats (user-only); user/bot; supports sorting, auto-pagination, --exclude-muted (user-only) |
108
108
  | [`+chat-members-list`](references/lark-im-chat-members-list.md) | List members of a chat; returns separate users[] / bots[] buckets; callable as user or bot; --member-types filters which kinds to return; --page-all pagination; surfaces truncations[] when the server caps a bucket |
109
- | [`+chat-messages-list`](references/lark-im-chat-messages-list.md) | List messages in a chat or P2P conversation; user/bot; accepts --chat-id or --user-id, resolves P2P chat_id, supports time range/sort/pagination |
110
- | [`+chat-search`](references/lark-im-chat-search.md) | Search visible group chats by --query keyword and/or --member-ids; user/bot; e.g. look up chat_id by group name; supports type filters, sorting, pagination, and --exclude-muted (user identity only) |
109
+ | [`+chat-messages-list`](references/lark-im-chat-messages-list.md) | List messages in a chat or P2P conversation; user/bot; accepts --chat-id or --user-id, resolves P2P chat_id, supports time range, --order asc/desc sorting, auto-pagination |
110
+ | [`+chat-search`](references/lark-im-chat-search.md) | Search visible group chats by --query keyword and/or --member-ids; user/bot; e.g. look up chat_id by group name; supports type filters, sorting, auto-pagination, and --exclude-muted (user identity only) |
111
111
  | [`+chat-update`](references/lark-im-chat-update.md) | Update group chat name or description; user/bot; updates a chat's name or description |
112
112
  | [`+messages-mget`](references/lark-im-messages-mget.md) | Batch get messages by IDs; user/bot; fetches up to 50 om_ message IDs, formats sender names, expands thread replies |
113
113
  | [`+messages-reply`](references/lark-im-messages-reply.md) | Reply to a message (supports thread replies); user/bot; supports text/markdown/post/media replies, reply-in-thread, idempotency key |
114
- | [`+messages-resources-download`](references/lark-im-messages-resources-download.md) | Download images/files from a message; user/bot; supports automatic chunked download for large files (8MB chunks), auto-detects file extension from Content-Type |
115
- | [`+messages-search`](references/lark-im-messages-search.md) | Search messages across chats (supports keyword, sender, time range filters) with user identity; user-only; filters by chat/sender/attachment/time, supports auto-pagination via `--page-all` / `--page-limit`, enriches results via batched mget and chats batch_query |
114
+ | [`+messages-resources-download`](references/lark-im-messages-resources-download.md) | Download an image or file attached to a message; user/bot |
115
+ | [`+messages-search`](references/lark-im-messages-search.md) | Search messages across chats (supports keyword, sender, time range filters) with user or bot identity; filters by chat/sender/attachment/time, supports auto-pagination via `--page-all` / `--page-limit`, enriches results via batched mget and chats batch_query |
116
116
  | [`+messages-send`](references/lark-im-messages-send.md) | Send a message to a chat or direct message; user/bot; sends to chat-id or user-id with text/markdown/post/media, supports idempotency key |
117
- | [`+threads-messages-list`](references/lark-im-threads-messages-list.md) | List messages in a thread; user/bot; accepts om_/omt_ input, resolves message IDs to thread_id, supports sort/pagination |
117
+ | [`+threads-messages-list`](references/lark-im-threads-messages-list.md) | List messages in a thread; user/bot; accepts om_/omt_ input, resolves message IDs to thread_id, supports --order asc/desc sorting, auto-pagination |
118
118
  | [`+flag-create`](references/lark-im-flag-create.md) | Create a bookmark on a message; user-only; defaults to message-layer flag; use --flag-type feed for feed-layer flag (item_type auto-detected from chat mode) |
119
119
  | [`+flag-cancel`](references/lark-im-flag-cancel.md) | Cancel (remove) a bookmark. When no --flag-type is given, best-effort double-cancel: removes message layer and (when chat_type is determinable) feed layer |
120
120
  | [`+flag-list`](references/lark-im-flag-list.md) | List bookmarks; user-only; auto-enriches feed-type thread entries with message content; `--page-all` is capped by `--page-limit` (default 20, max 1000), and `has_more=true` means the result is incomplete |
@@ -23,6 +23,9 @@ lark-cli im +chat-list --page-size 50
23
23
  # Pagination
24
24
  lark-cli im +chat-list --page-token "xxx"
25
25
 
26
+ # Fetch multiple pages automatically, up to 10 pages by default
27
+ lark-cli im +chat-list --page-all
28
+
26
29
  # Drop muted chats (user identity only)
27
30
  lark-cli im +chat-list --exclude-muted
28
31
 
@@ -50,13 +53,17 @@ lark-cli im +chat-list --as user --types p2p
50
53
  | `--types <strings>` | No | `group`, `p2p` (comma-separated or repeated) | Chat types to include. Omitted = groups only (backward compatible). `p2p` requires user identity (`--as user`); under `--as bot`, `--types=p2p` alone is rejected and `--types=p2p,group` is silently downgraded to `group` |
51
54
  | `--sort <field>` | No | `create_time` (default, ascending), `active_time` (descending) | Result ordering |
52
55
  | `--page-size <n>` | No | 1-100, default 20 | Number of results per page |
53
- | `--page-token <token>` | No | - | Pagination token from the previous response |
56
+ | `--page-token <token>` | No | - | Starting cursor, normally returned by a previous response |
57
+ | `--page-all` | No | - | Automatically fetch and merge subsequent pages; capped by `--page-limit` |
58
+ | `--page-limit <n>` | No | 1-1000, default 10 | Maximum pages fetched by `--page-all` |
54
59
  | `--exclude-muted` | No | User identity only | Drop chats the current user has muted (do-not-disturb). Under `--as bot`, the flag is silently inactive; see "Filtering muted chats" below |
55
60
  | `--format json` | No | - | Output as JSON |
56
61
  | `--dry-run` | No | - | Preview the request without executing it |
57
62
 
58
63
  > **Note:** Supports both `--as user` (default) and `--as bot`. When using bot identity, the app must have bot capability enabled.
59
64
 
65
+ With `--page-all`, `--page-token` sets the starting cursor. If `meta.pagination.complete=false`, resume from `meta.pagination.next_token` or raise `--page-limit`.
66
+
60
67
  ## Output Fields
61
68
 
62
69
  | Field | Description |
@@ -156,7 +163,7 @@ done
156
163
 
157
164
  | Symptom | Root Cause | Solution |
158
165
  |---------|---------|---------|
159
- | `--page-size must be an integer between 1 and 100` | page-size is out of range or not an integer | Use an integer between 1 and 100 |
166
+ | `invalid --page-size 101: must be between 1 and 100` | page-size is out of range | Use an integer between 1 and 100 |
160
167
  | Permission denied (99991672) | The bot app does not have `im:chat:read` TAT permission enabled | Enable the permission for the app in the Open Platform console |
161
168
  | Permission denied (99991679) with `--as user` | UAT is not authorized for `im:chat:read` | Run `lark-cli auth login --scope "im:chat:read"` |
162
169
  | `Bot ability is not activated` (232025) | The app does not have bot capability enabled | Enable bot capability in the Open Platform console |
@@ -19,9 +19,12 @@ lark-cli im +chat-members-list --chat-id oc_xxx --member-types user,bot
19
19
  # Walk every page (capped by --page-limit; 0 = unlimited)
20
20
  lark-cli im +chat-members-list --chat-id oc_xxx --page-all --page-limit 0
21
21
 
22
- # Resume from a specific cursor (single page; --page-all is ignored)
22
+ # Fetch one page starting at a specific cursor
23
23
  lark-cli im +chat-members-list --chat-id oc_xxx --page-token "xxx"
24
24
 
25
+ # Continue automatically from a specific cursor
26
+ lark-cli im +chat-members-list --chat-id oc_xxx --page-token "xxx" --page-all
27
+
25
28
  # JSON output / preview the request
26
29
  lark-cli im +chat-members-list --chat-id oc_xxx --format json
27
30
  lark-cli im +chat-members-list --chat-id oc_xxx --dry-run
@@ -35,7 +38,7 @@ lark-cli im +chat-members-list --chat-id oc_xxx --dry-run
35
38
  | `--member-types <strings>` | No | `user`, `bot` (comma-separated or repeated) | Member types to return. Omitted = all |
36
39
  | `--member-id-type <type>` | No | `open_id` (default), `union_id`, `user_id` | ID type for `member_id` in the response |
37
40
  | `--page-size <n>` | No | 1-100, default 20 | Results per page. With `--page-all` and no explicit `--page-size`, the max (100) is used automatically to minimize round-trips |
38
- | `--page-token <token>` | No | - | Pagination cursor; **implies a single-page fetch** (disables auto-pagination) |
41
+ | `--page-token <token>` | No | - | Starting cursor, normally returned by a previous response |
39
42
  | `--page-all` | No | - | Automatically walk every page (capped by `--page-limit`) |
40
43
  | `--page-limit <n>` | No | default 10, `0` = unlimited | Max pages to fetch with `--page-all` |
41
44
  | `--page-delay <ms>` | No | default 200, `0` = no delay | Delay between pages during `--page-all` (throttle to avoid rate limits on large lists) |
@@ -70,7 +73,7 @@ A truncated result is *not* fixable by paging further — it is a server-side ca
70
73
  - With `--page-all` and no explicit `--page-size`, the shortcut uses the maximum page size (100) so a full walk takes the fewest round-trips. An explicit `--page-size` is always honored.
71
74
  - `--page-all` sleeps `--page-delay` ms (default 200) between pages to avoid hammering the API when a tenant has no server-side member cap and the list spans many pages. Set `--page-delay 0` to disable.
72
75
  - `--page-all` stops at `--page-limit` pages (default 10). When it stops early, `has_more` stays `true` so you know the result is incomplete; re-run with `--page-limit 0` for everything.
73
- - `--page-token` and `--page-all` together: `--page-token` wins (single-page fetch from the supplied cursor); a stderr warning is emitted.
76
+ - `--page-token` and `--page-all` together: automatic pagination starts at the supplied cursor and continues until exhaustion or `--page-limit`.
74
77
  - Across pages, `users[]` and `bots[]` are concatenated; `truncations` / `has_more` / `page_token` come from the last page fetched.
75
78
 
76
79
  ## Common Errors and Troubleshooting
@@ -78,6 +81,6 @@ A truncated result is *not* fixable by paging further — it is a server-side ca
78
81
  | Symptom | Root Cause | | Solution |
79
82
  |---------|---------|---|---------|
80
83
  | `--chat-id is required` | `--chat-id` omitted | | Provide the `oc_xxx` chat ID |
81
- | `--page-size must be an integer between 1 and 100` | out of range | | Use 1-100 |
84
+ | `invalid --page-size 101: must be between 1 and 100` | out of range | | Use 1-100 |
82
85
  | `--member-types contains invalid value` | value other than `user`/`bot` | | Use `user`, `bot`, or both |
83
86
  | Permission denied | missing `im:chat.members:read` | | Bot: enable the scope in the console. User: `lark-cli auth login --scope "im:chat.members:read"` |
@@ -29,6 +29,9 @@ lark-cli im +chat-messages-list --chat-id oc_xxx --order asc --page-size 20
29
29
  # Pagination
30
30
  lark-cli im +chat-messages-list --chat-id oc_xxx --page-token "xxx"
31
31
 
32
+ # Fetch multiple pages automatically, up to 10 pages by default
33
+ lark-cli im +chat-messages-list --chat-id oc_xxx --page-all
34
+
32
35
  # JSON output
33
36
  lark-cli im +chat-messages-list --chat-id oc_xxx --format json
34
37
  ```
@@ -43,7 +46,9 @@ lark-cli im +chat-messages-list --chat-id oc_xxx --format json
43
46
  | `--end <time>` | No | End time (ISO 8601 or date only) |
44
47
  | `--order <order>` | No | Sort order: `asc` / `desc` (default `desc`) |
45
48
  | `--page-size <n>` | No | Page size (default 50, max 50) |
46
- | `--page-token <token>` | No | Pagination token |
49
+ | `--page-token <token>` | No | Starting cursor, normally returned by a previous response |
50
+ | `--page-all` | No | Automatically fetch and merge subsequent pages; capped by `--page-limit` |
51
+ | `--page-limit <n>` | No | Maximum pages fetched by `--page-all` (default 10, range 1-1000) |
47
52
  | `--no-reactions` | No | Skip auto-fetching the `reactions` block |
48
53
  | `--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; no extra requests when omitted |
49
54
 
@@ -106,12 +111,14 @@ Each message contains:
106
111
 
107
112
  ## Pagination (`has_more` / `page_token`)
108
113
 
109
- `im +chat-messages-list` returns `has_more` and `page_token` when more data is available. Use `--page-token` to continue:
114
+ By default, `im +chat-messages-list` fetches one page. It returns `has_more` and `page_token` when more data is available. Use `--page-token` to continue:
110
115
 
111
116
  ```bash
112
117
  lark-cli im +chat-messages-list --chat-id oc_xxx --page-token <PAGE_TOKEN>
113
118
  ```
114
119
 
120
+ With `--page-all`, `--page-token` sets the starting cursor. If `meta.pagination.complete=false`, resume from `meta.pagination.next_token` or raise `--page-limit`.
121
+
115
122
  You can also fall back to the generic API:
116
123
 
117
124
  ```bash
@@ -149,7 +156,7 @@ lark-cli api GET /open-apis/im/v1/messages \
149
156
  lark-cli im +chat-search --as bot --query "<chat name keyword>" --format json
150
157
  lark-cli im +chat-messages-list --as bot --chat-id <chat_id> --page-size 50 --format json
151
158
  ```
152
- Do not use `im +messages-search --as bot`; `+messages-search` is user-only. Continue with `--page-token` if `has_more=true`.
159
+ If the request is keyword search across message content, `im +messages-search --as bot` is also supported. Continue with `--page-token` if `has_more=true`.
153
160
 
154
161
  ## References
155
162
 
@@ -33,6 +33,9 @@ lark-cli im +chat-search --query "project" --page-size 10
33
33
  # Pagination
34
34
  lark-cli im +chat-search --query "project" --page-token "xxx"
35
35
 
36
+ # Fetch multiple pages automatically, up to 10 pages by default
37
+ lark-cli im +chat-search --query "project" --page-all
38
+
36
39
  # JSON output
37
40
  lark-cli im +chat-search --query "project" --format json
38
41
 
@@ -52,13 +55,17 @@ lark-cli im +chat-search --query "project" --dry-run
52
55
  | `--disable-search-by-user` | No | - | Disable member-name-based matching and search by group name only |
53
56
  | `--sort <field>` | No | `create_time`, `update_time`, `member_count` | Sort field (always descending) |
54
57
  | `--page-size <n>` | No | 1-100, default 20 | Number of results per page |
55
- | `--page-token <token>` | No | - | Pagination token from the previous response |
58
+ | `--page-token <token>` | No | - | Starting cursor, normally returned by a previous response |
59
+ | `--page-all` | No | - | Automatically fetch and merge subsequent pages; capped by `--page-limit` |
60
+ | `--page-limit <n>` | No | 1-1000, default 10 | Maximum pages fetched by `--page-all` |
56
61
  | `--exclude-muted` | No | User identity only | Drop chats the current user has muted (do-not-disturb). Under `--as bot`, the flag is silently inactive (mute is a per-user setting); see "Filtering muted chats" below |
57
62
  | `--format json` | No | - | Output as JSON |
58
63
  | `--dry-run` | No | - | Preview the request without executing it |
59
64
 
60
65
  > **Note:** Supports both `--as user` (default) and `--as bot`. When using bot identity, the app must have bot capability enabled.
61
66
 
67
+ With `--page-all`, `--page-token` sets the starting cursor. If `meta.pagination.complete=false`, resume from `meta.pagination.next_token` or raise `--page-limit`.
68
+
62
69
  > **CAUTION:** `--sort` is **always descending** — the search API only ranks the chosen field high-to-low (e.g. `member_count` = most members first). There is no ascending option. If the user asks for "fewest first / ascending / 从少到多", tell them the search API does not support ascending order; any low-to-high view requires re-sorting the fetched page client-side and is not an upstream sort. Do **not** invent values like `member_count_asc` or pass `asc` (they are rejected).
63
70
 
64
71
  ## Output Fields
@@ -121,7 +128,7 @@ lark-cli im +messages-send --chat-id "$CHAT_ID" --text "Today's progress update"
121
128
  |---------|---------|---------|
122
129
  | `--query and --member-ids cannot both be empty` | Both were omitted | Provide at least `--query` or `--member-ids` |
123
130
  | Empty results | No visible chats matched the keyword or filters | Relax the keyword or filters and try again |
124
- | `--page-size must be an integer between 1 and 100` | page-size is out of range or not an integer | Use an integer between 1 and 100 |
131
+ | `invalid --page-size 101: must be between 1 and 100` | page-size is out of range | Use an integer between 1 and 100 |
125
132
  | Permission denied (99991672) | The bot app does not have `im:chat:read` TAT permission enabled | Enable the permission for the app in the Open Platform console |
126
133
  | Permission denied (99991679) with `--as user` | UAT is not authorized for `im:chat:read` | Run `lark-cli auth login --scope "im:chat:read"` |
127
134
  | `Bot ability is not activated` (232025) | The app does not have bot capability enabled | Enable bot capability in the Open Platform console |
@@ -34,13 +34,13 @@ lark-cli im +feed-group-list-item --as user --feed-group-id ofg_xxx \
34
34
  |---|---|---|
35
35
  | `--feed-group-id` | Yes | Feed group ID (`ofg_xxx`); path parameter |
36
36
  | `--page-size` | No | Records per page, 1–50 (default 50) |
37
- | `--page-token` | No | Continuation token for a specific page |
37
+ | `--page-token` | No | Starting cursor, normally returned by a previous response |
38
38
  | `--page-all` | No | Auto-paginate and merge all pages |
39
39
  | `--page-limit` | No | Max pages when `--page-all` is set, 1–1000 (default 20) |
40
40
  | `--start-time` | No | Update-time window start (Unix milliseconds as a decimal string) |
41
41
  | `--end-time` | No | Update-time window end (Unix milliseconds as a decimal string) |
42
42
 
43
- When `--page-token` is set explicitly, it wins over `--page-all` (you get exactly that page).
43
+ When `--page-token` and `--page-all` are supplied together, automatic pagination starts at that cursor and continues until exhaustion or `--page-limit`.
44
44
 
45
45
  ## Output
46
46
 
@@ -31,13 +31,13 @@ lark-cli im +feed-group-list --as user --page-all \
31
31
  | Flag | Required | Description |
32
32
  |---|---|---|
33
33
  | `--page-size` | No | Records per page, 1–50 (default 50). Caps the combined `groups` + `deleted_groups` count, so a page may hold fewer live groups than the size suggests |
34
- | `--page-token` | No | Continuation token for a specific page |
34
+ | `--page-token` | No | Starting cursor, normally returned by a previous response |
35
35
  | `--page-all` | No | Auto-paginate and merge all pages (both lists) |
36
36
  | `--page-limit` | No | Max pages when `--page-all` is set, 1–1000 (default 20) |
37
37
  | `--start-time` | No | Update-time window start (Unix milliseconds as a decimal string) |
38
38
  | `--end-time` | No | Update-time window end (Unix milliseconds as a decimal string) |
39
39
 
40
- When `--page-token` is set explicitly, it wins over `--page-all` (you get exactly that page).
40
+ When `--page-token` and `--page-all` are supplied together, automatic pagination starts at that cursor and continues until exhaustion or `--page-limit`.
41
41
 
42
42
  ## Output
43
43
 
@@ -10,7 +10,7 @@ Lists **one page** of the **current user's** feed shortcuts.
10
10
 
11
11
  - Only **CHAT-type** shortcuts are exposed via OpenAPI today (others in the IDL are not yet whitelisted).
12
12
  - The shortcut is a **thin one-page wrapper** — there is no built-in auto-pagination. Callers drive their own loop when they actually need to paginate.
13
- - Server-side page size is controlled by the service; in normal use one page usually covers the list.
13
+ - Server-side page size is controlled by the service, so this command has no `--page-size` flag; in normal use one page usually covers the list.
14
14
  - Pagination tokens are opaque. If a token is rejected because the shortcut list changed, restart by omitting `--page-token`.
15
15
 
16
16
  ## Commands
@@ -8,7 +8,7 @@ This skill maps to shortcut: `lark-cli im +flag-list`. Underlying API: `GET /ope
8
8
 
9
9
  The API returns data sorted by `update_time` in **ascending order**, meaning **oldest first, newest last**. When `has_more=true`, continue pagination until `has_more=false`; only then is the last item in the merged result authoritative as the newest flag. If pagination stops while `has_more=true`, the last item is only the newest observed flag.
10
10
 
11
- `--page-all` enables automatic pagination but is still capped by `--page-limit`. The default cap is 20 pages; **20 is not the hard maximum**. Set `--page-limit` between 1 and 1000 when a larger scan is required. A response with `has_more=true` is incomplete, even when `flag_items` is empty; increase the limit or resume from the returned `page_token` before reporting an authoritative latest item or count.
11
+ `--page-all` enables automatic pagination but is still capped by `--page-limit`. When `--page-token` is also supplied, it sets the starting cursor and pagination continues from there. The default cap is 20 pages; **20 is not the hard maximum**. Set `--page-limit` between 1 and 1000 when a larger scan is required. A response with `has_more=true` is incomplete, even when `flag_items` is empty; increase the limit or resume from the returned `page_token` before reporting an authoritative latest item or count.
12
12
 
13
13
  ## Commands
14
14
 
@@ -40,7 +40,7 @@ lark-cli im +flag-list --as user --page-all --page-limit 1000
40
40
  | Parameter | Default | Description |
41
41
  |------|------|------|
42
42
  | `--page-size <n>` | 50 | Range 1-50 (server max is 50) |
43
- | `--page-token <token>` | empty | Pagination token from previous page; empty string must still be provided |
43
+ | `--page-token <token>` | empty | Starting cursor from a previous response; an empty cursor still selects the first page |
44
44
  | `--page-all` | false | Auto-paginate and merge results, capped by `--page-limit` |
45
45
  | `--page-limit <n>` | 20 | Max pages in `--page-all` mode; configurable range 1-1000 (20 is only the default) |
46
46
  | `--enrich-feed-thread` | true | Auto-enrich feed-layer thread entries with message content (calls `im.messages.mget`) |
@@ -36,7 +36,7 @@ Use `--download-resources` when you want the binaries on disk in one pass; other
36
36
 
37
37
  ## Scope requirement
38
38
 
39
- The default enrichment requires `im:message.reactions:read`, already declared in each shortcut's `UserScopes` / `BotScopes` (or `Scopes` for the user-only search command), so the framework's pre-flight check surfaces a `missing_scope` error before the request is sent. Bots that were registered before this scope was added need an incremental authorization in the Feishu developer console; users can run:
39
+ The default enrichment requires `im:message.reactions:read`, already declared in each shortcut's `UserScopes` / `BotScopes` (or `Scopes` for the search command), so the framework's pre-flight check surfaces a `missing_scope` error before the request is sent. Bots that were registered before this scope was added need an incremental authorization in the Feishu developer console; users can run:
40
40
 
41
41
  ```bash
42
42
  lark-cli auth login --scope "im:message.reactions:read"
@@ -2,11 +2,11 @@
2
2
 
3
3
  > **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.
4
4
 
5
- Download image or file resources from a message. Supports **automatic chunked download for large files** using HTTP Range requests. Resources are identified by the combination of `message_id` + `file_key`, both of which come directly from message content returned by `im +chat-messages-list`.
5
+ Download an image or file attached to a message. Use the `message_id` and resource key returned by a message-reading command; do not guess or combine identifiers from different messages.
6
6
 
7
7
  > **Note:** read-only message commands render resource keys in message content, but they do not download binaries automatically. Use this command whenever you need to fetch the actual image/file bytes or save them to a specific path.
8
8
 
9
- This skill maps to the shortcut: `lark-cli im +messages-resources-download` (internally calls `GET /open-apis/im/v1/messages/{message_id}/resources/{file_key}`).
9
+ Shortcut: `lark-cli im +messages-resources-download`.
10
10
 
11
11
  ## Commands
12
12
 
@@ -34,27 +34,11 @@ lark-cli im +messages-resources-download --message-id om_xxx --file-key img_v3_x
34
34
  | `--message-id <id>` | Yes | Message ID (`om_xxx` format) |
35
35
  | `--file-key <key>` | Yes | Resource key (`img_xxx` or `file_xxx`) |
36
36
  | `--type <type>` | Yes | Resource type: `image` or `file` |
37
- | `--output <path>` | No | Output path (relative paths only; `..` traversal is not allowed). When omitted, the server's original filename from `Content-Disposition` is used if available; otherwise defaults to `file_key`. File extension is automatically inferred from `Content-Disposition` or `Content-Type` if not provided |
37
+ | `--output <path>` | No | Relative output path; absolute paths and `..` traversal are rejected. When omitted, the command uses the attachment name when available and otherwise falls back to the resource key |
38
38
  | `--as <identity>` | No | Identity type: `user` (default) or `bot` |
39
39
  | `--dry-run` | No | Print the request only, do not execute it |
40
40
 
41
- ## Large File Download (Auto Chunking)
42
-
43
- When downloading large files, the command automatically uses **HTTP Range requests** for reliable chunked downloading:
44
-
45
- | Behavior | Details |
46
- |----------|---------|
47
- | Probe chunk | First 128 KB to detect file size and Content-Type |
48
- | Chunk size | 8 MB per subsequent request |
49
- | Workers | Single-threaded sequential download (ensures reliability) |
50
- | Retries | Up to 2 retries for transient request failures, with exponential backoff |
51
-
52
- **Benefits:**
53
- - Reduces the impact of transient request failures during large downloads
54
- - Preserves the server's original filename via `Content-Disposition` (supports RFC 5987 UTF-8 encoding); falls back to `Content-Type`-based extension inference
55
- - Validates file size integrity after download completion
56
-
57
- ## `file_key` Sources
41
+ ## Choose `--type`
58
42
 
59
43
  Different resource markers in message content correspond to different `file_key` and `type` values:
60
44
 
@@ -65,6 +49,17 @@ Different resource markers in message content correspond to different `file_key`
65
49
  | Audio | `file_xxx` | `file_xxx` | `file` |
66
50
  | Video | `file_xxx` | `file_xxx` | `file` |
67
51
 
52
+ Stickers cannot be downloaded with this command.
53
+
54
+ ## Output
55
+
56
+ On success, read:
57
+
58
+ | Field | Meaning |
59
+ |------|---------|
60
+ | `data.saved_path` | Saved local path |
61
+ | `data.size_bytes` | Saved byte count |
62
+
68
63
  ## Usage Scenario
69
64
 
70
65
  ### Scenario: Extract and download an image from a message
@@ -82,11 +77,10 @@ lark-cli im +messages-resources-download --message-id om_xxx --file-key img_v3_x
82
77
 
83
78
  | Symptom | Root Cause | Solution |
84
79
  |---------|---------|---------|
85
- | Download failed | `file_key` does not match the `message_id` | Make sure the `file_key` came from that message's content |
86
- | Hit error code 234002 or 14005 | No permission, **not** missing API scope | no access to this chat or file was deleted — do not retry, return the error to the user |
87
- | Permission denied | `im:message:readonly` is not authorized | Run `auth login --scope "im:message:readonly"` |
88
- | File size mismatch | Chunked download integrity check failed | Network instability during download; retry the command |
89
- | Content-Range error | Server returned invalid range header | Transient API issue; retry the command |
80
+ | Resource does not match the message | `file_key` and `message_id` came from different messages | Read the message again and use its matching identifiers |
81
+ | Permission denied | `im:message:readonly` is not authorized | For user identity, run `lark-cli auth login --scope "im:message:readonly"`; for bot identity, grant the scope to the app in the developer console |
82
+ | Attachment unavailable | The message or resource is deleted, hidden, restricted, or inaccessible to the caller | Do not retry unchanged; report the exact CLI error |
83
+ | Retryable network error | The transfer did not complete | Retry the same command |
90
84
 
91
85
  ## References
92
86
 
@@ -6,8 +6,6 @@ Search Feishu messages across conversations. This shortcut automatically perform
6
6
 
7
7
  By default each result message 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. With `--page-all`, every page is enriched; pass `--no-reactions` to skip the extra round-trip. See [message enrichment](lark-im-message-enrichment.md) for the full contract.
8
8
 
9
- > **User identity only** (`--as user`). Bot identity is not supported.
10
-
11
9
  This skill maps to the shortcut: `lark-cli im +messages-search` (internally calls `POST /open-apis/im/v1/messages/search` + batched `GET /open-apis/im/v1/messages/mget`, then batch-fetches chat context).
12
10
 
13
11
  ## Commands
@@ -80,11 +78,11 @@ lark-cli im +messages-search --query "test" --dry-run
80
78
  | `--start <time>` | No | Start time with local timezone offset required (e.g. `2026-03-24T00:00:00+08:00`) |
81
79
  | `--end <time>` | No | End time with local timezone offset required (e.g. `2026-03-25T23:59:59+08:00`) |
82
80
  | `--page-size <n>` | No | Page size (default 20, range 1-50) |
83
- | `--page-token <token>` | No | Pagination token for the next page |
81
+ | `--page-token <token>` | No | Starting cursor, normally returned by a previous response |
84
82
  | `--page-all` | No | Automatically paginate through all result pages (up to 40 pages) |
85
83
  | `--page-limit <n>` | No | Max pages to fetch when auto-pagination is enabled (default 20, max 40). Setting it explicitly also enables auto-pagination |
86
84
  | `--format <fmt>` | No | Output format: `json` (default) / `pretty` / `table` / `ndjson` / `csv` |
87
- | `--as <identity>` | No | Identity type (defaults to and only supports `user`) |
85
+ | `--as <identity>` | No | Identity type: `user` or `bot` |
88
86
  | `--dry-run` | No | Print the request only, do not execute it |
89
87
 
90
88
  ## Core Constraints
@@ -135,6 +133,7 @@ Each message in JSON output contains:
135
133
  - Default behavior is still **single-page**.
136
134
  - `--page-token` is the manual continuation mechanism when you already have a token from a previous response.
137
135
  - `--page-all` enables auto-pagination and uses a default cap of **40 pages**.
136
+ - With both flags, auto-pagination starts at `--page-token` and continues from that cursor.
138
137
  - `--page-limit <n>` enables auto-pagination with an explicit cap. If you pass `--page-limit` without `--page-all`, auto-pagination is still enabled.
139
138
  - When auto-pagination stops because of the configured page cap, the response still includes the last `has_more` / `page_token` so you can continue manually.
140
139
 
@@ -162,7 +161,7 @@ Use `im +messages-resources-download` if you need to fetch the underlying image
162
161
 
163
162
  Use `--query` only for real message keywords. If the user asks for activity review such as "最近一周我和哪些 Bot 有过交互" or "整理我和某人的聊天记录", and the useful constraints are sender type, chat, person, or time range, keep `--query ""` and rely on those filters. Do not put generic instruction words such as "看看", "总结", "交互内容", or "聊天记录" into `--query`; those words often over-constrain message search and hide the relevant messages.
164
163
 
165
- This guidance applies only when using user identity. `im +messages-search` is user-only; if the user explicitly asks for application/bot identity, do not try `--as bot`. For bot identity with a named group and history/listing intent, resolve the group with `im +chat-search --as bot`, then list messages with `im +chat-messages-list --as bot --chat-id <chat_id>`.
164
+ This guidance applies to both user and bot identity. If the user explicitly asks for application/bot identity, run `im +messages-search --as bot`; for named-group history/listing intents where search is not needed, resolving the group with `im +chat-search --as bot` and listing messages with `im +chat-messages-list --as bot --chat-id <chat_id>` is still a good narrower path.
166
165
 
167
166
  ```bash
168
167
  # Review recent bot interactions without forcing a keyword
@@ -23,6 +23,9 @@ lark-cli im +threads-messages-list --thread omt_xxx --page-size 20
23
23
  # Pagination
24
24
  lark-cli im +threads-messages-list --thread omt_xxx --page-token <PAGE_TOKEN>
25
25
 
26
+ # Fetch multiple pages automatically, up to 10 pages by default
27
+ lark-cli im +threads-messages-list --thread omt_xxx --page-all
28
+
26
29
  # Output format options
27
30
  lark-cli im +threads-messages-list --thread omt_xxx --format pretty
28
31
  lark-cli im +threads-messages-list --thread omt_xxx --format table
@@ -43,8 +46,10 @@ lark-cli im +threads-messages-list --thread omt_xxx --dry-run
43
46
  | `--no-reactions` | No | Skip auto-fetching the `reactions` block |
44
47
  | `--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 |
45
48
  | `--order <order>` | No | Sort order: `asc` (default) / `desc` |
46
- | `--page-size <n>` | No | Number of items per page (default 50, range 1-500) |
47
- | `--page-token <token>` | No | Pagination token for the next page |
49
+ | `--page-size <n>` | No | Number of items per page (default 50, range 1-50) |
50
+ | `--page-token <token>` | No | Starting cursor, normally returned by a previous response |
51
+ | `--page-all` | No | Automatically fetch and merge subsequent pages; capped by `--page-limit` |
52
+ | `--page-limit <n>` | No | Maximum pages fetched by `--page-all` (default 10, range 1-1000) |
48
53
  | `--format <fmt>` | No | Output format: `json` (default) / `pretty` / `table` / `ndjson` / `csv` |
49
54
  | `--as <identity>` | No | Identity type: `user` (default) / `bot` |
50
55
  | `--dry-run` | No | Print the request only, do not execute it |
@@ -61,8 +66,7 @@ Thread messages do not support `start_time` / `end_time` filtering because of Fe
61
66
 
62
67
  ### 3. Pagination (`has_more` / `page_token`)
63
68
 
64
- - When the result includes `has_more=true`, use `page_token` to fetch the next page
65
- - If you need the complete thread, keep paginating; if you only need an overview, the first page is often enough
69
+ 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`.
66
70
 
67
71
  ### 4. Recommended expansion strategy
68
72
 
@@ -13,6 +13,8 @@ lark-cli mail +triage
13
13
 
14
14
  # 查看收件箱未读
15
15
  lark-cli mail +triage --filter '{"folder":"inbox","is_unread":true}'
16
+ lark-cli mail +triage --folder INBOX --is-unread
17
+ lark-cli mail +triage --filter is_unread
16
18
 
17
19
  # 全文搜索
18
20
  lark-cli mail +triage --query "合同审批"
@@ -25,6 +27,8 @@ lark-cli mail +triage --query "项目评审" --filter '{"time_range":{"start_tim
25
27
 
26
28
  # 指定文件夹
27
29
  lark-cli mail +triage --filter '{"folder":"sent"}'
30
+ lark-cli mail +triage --filter folder=sent
31
+ lark-cli mail +triage --folder sent
28
32
 
29
33
  # 系统标签(可通过 folder 或 label 传入,搜索时自动转为 folder)
30
34
  lark-cli mail +triage --filter '{"folder":"flagged"}'
@@ -47,17 +51,28 @@ lark-cli mail +triage --page-size 10
47
51
 
48
52
  | 参数 | 默认 | 说明 |
49
53
  |------|------|------|
50
- | `--filter <json>` | — | 筛选条件(见下方字段说明) |
54
+ | `--filter <filter>` | — | 筛选条件(见下方字段说明) |
55
+ | `--folder <name-or-id>` | — | 文件夹名称或系统文件夹 ID 筛选;等价于设置 `filter.folder` |
56
+ | `--folder-id <id>` | — | 明确的文件夹 ID 筛选;等价于设置 `filter.folder_id` |
57
+ | `--is-unread` | — | 只看未读;等价于设置 `filter.is_unread=true` |
51
58
  | `--query <text>` | — | 全文搜索关键词 |
52
59
  | `--format <mode>` | `table` | `table` / `json` / `data`(`json` 和 `data` 均输出含分页信息的对象) |
53
60
  | `--max <n>` | `20` | 最大返回条数(1-400),内部自动分页拉取 |
54
- | `--page-size <n>` | — | `--max` 的别名,两者含义相同;同时指定时 `--page-size` 优先 |
61
+ | `--page-size <n>` | — | `--max` 的别名;重复指定时后出现的值生效 |
55
62
  | `--page-token <token>` | — | 上一次响应返回的分页令牌,传入后从该位置继续拉取。令牌带 `search:` 或 `list:` 前缀,标识来源路径,不可混用 |
56
63
  | `--labels` | — | table 格式时额外显示 labels 列 |
57
64
  | `--mailbox <id>` | `me` | 邮箱地址 |
58
65
 
59
66
  ### `--filter` 支持的字段
60
67
 
68
+ `--filter` 有三种写法:
69
+
70
+ - JSON 对象:`--filter '{"folder":"INBOX","is_unread":true}'`,用于组合多个字段或传数组/对象字段
71
+ - 单个 `key=value`:`--filter folder=INBOX`、`--filter is_unread=true`
72
+ - 裸未读快捷写法:`--filter is_unread`
73
+
74
+ 多个筛选条件请使用 JSON 对象,`folder=INBOX,is_unread=true` 这种逗号拼接的 key=value 不支持。
75
+
61
76
  | 字段 | 类型 | 说明 |
62
77
  |------|------|------|
63
78
  | `folder` | string | 文件夹名称筛选。系统文件夹固定值:`inbox`/`sent`/`draft`/`trash`/`spam`/`archive`/`priority`/`flagged`/`other`/`scheduled`,也支持自定义文件夹名称。子文件夹需用 `parent_name/child_name` 格式,可通过 folder list 接口查看 |
@@ -73,7 +88,7 @@ lark-cli mail +triage --page-size 10
73
88
 
74
89
  > **系统标签说明**:`IMPORTANT`/`FLAGGED`/`OTHER` 可通过 `folder` 或 `label` 传入(也支持中文别名 `重要邮件`/`已加旗标`/`其他邮件`、搜索名 `priority`/`flagged`/`other`)。搜索时自动转为 folder 字段,列表时自动转为 label_id。label list 接口不返回这三个系统标签。
75
90
  >
76
- > **⚠️ 注意**:查询未读请用 `"is_unread":true`。
91
+ > **⚠️ 注意**:查询未读可用 `--is-unread`、`--filter is_unread`、`--filter is_unread=true` 或 JSON 写法 `"is_unread":true`。
77
92
  可运行 `mail +triage --print-filter-schema` 查看完整字段说明。
78
93
 
79
94
  ## 输出
@@ -108,7 +123,7 @@ lark-cli mail +triage --page-size 10
108
123
 
109
124
  ### `table` 格式
110
125
 
111
- `page_token` 信息输出在 stderr,自动携带 `--query`/`--filter`/`--mailbox` 参数方便续页:
126
+ `page_token` 信息输出在 stderr,自动携带 `--query`/`--filter`/`--folder`/`--folder-id`/`--is-unread`/`--mailbox` 参数方便续页:
112
127
  ```text
113
128
  15 message(s)
114
129
  next page: mail +triage --query '合同审批' --page-token 'search:abc123...'
@@ -26,7 +26,7 @@ metadata:
26
26
 
27
27
  | Shortcut | 说明 |
28
28
  |----------|------|
29
- | [`+search`](references/lark-minutes-search.md) | 按关键词、所有者、参与者、时间范围搜索妙记 |
29
+ | [`+search`](references/lark-minutes-search.md) | 按关键词、所有者、参与者、时间范围搜索妙记;支持 user/bot 身份 |
30
30
  | [`+detail`](references/lark-minutes-detail.md) | 查询妙记详情(标题和关联的纪要note_id),按需获取 AI 产物(总结、待办、章节、逐字稿、关键词) |
31
31
  | [`+download`](references/lark-minutes-download.md) | 下载妙记音视频媒体文件 |
32
32
  | [`+upload`](references/lark-minutes-upload.md) | 上传 file_token 生成妙记 |
@@ -1,7 +1,7 @@
1
1
  # minutes +search
2
2
 
3
3
 
4
- 搜索妙记列表,支持关键词、所有者、参与者以及时间范围等多条件过滤。所有者与参与者都支持传入多个 open\_id,也支持传入 `me` 表示当前用户。只读操作,不修改任何妙记数据。
4
+ 搜索妙记列表,支持关键词、所有者、参与者以及时间范围等多条件过滤。支持 user 身份和 bot / 应用身份;所有者与参与者都支持传入多个 open\_id,user 身份下也支持传入 `me` 表示当前用户。只读操作,不修改任何妙记数据。
5
5
 
6
6
  本 skill 对应 shortcut:`lark-cli minutes +search`(调用 `POST /open-apis/minutes/v1/minutes/search`)。
7
7
 
@@ -81,14 +81,14 @@ lark-cli minutes +search --query "预算复盘" --format json
81
81
 
82
82
  所有参数均可选,但必须至少提供一个过滤条件:`--query`、`--owner-ids`、`--participant-ids`、`--start` 或 `--end`。
83
83
 
84
- ### 2. 仅支持 user 身份
84
+ ### 2. 支持 user 和 bot 身份
85
85
 
86
- 该接口仅支持 `user` 身份,使用前需完成 `lark-cli auth login` 并具备 `minutes:minutes.search:read` 权限。
86
+ 该接口支持 `--as user` 和 `--as bot`。user 身份需要完成 `lark-cli auth login` 并具备 `minutes:minutes.search:read` 权限;bot 身份使用应用的 tenant access token,需要确认当前应用已开通 `minutes:minutes.search:read` scope,且运行环境能获取有效的 TAT。
87
87
 
88
88
  ### 3. `me` 表示当前用户
89
89
 
90
- 在 `--owner-ids` 和 `--participant-ids` 中可使用 `me`,表示当前登录用户。该值会在本地解析为当前用户的 `open_id`,无需手动先查询自己的用户 ID。
91
- 若当前环境尚未完成用户登录,或 CLI 无法解析出当前用户的 `open_id`,则应先执行 `lark-cli auth login`,再重新执行搜索。
90
+ 在 `--owner-ids` 和 `--participant-ids` 中可使用 `me`,表示当前登录用户。该值会在本地解析为当前用户的 `open_id`,无需手动先查询自己的用户 ID。`me` 只适合 user 身份;bot 身份没有“当前用户”,请直接传 `ou_` open_id。
91
+ 若当前环境尚未完成用户登录,或 CLI 无法解析出当前用户的 `open_id`,则应先执行 `lark-cli auth login`,再重新执行搜索。该恢复方式只适用于 user 身份和 `me` 解析;bot 身份应检查 tenant access token 与应用 scope,不应通过 `auth login` 修复。
92
92
 
93
93
  ### 4. 自然语言中的“参与的妙记”默认按并集理解
94
94
 
@@ -182,7 +182,7 @@ lark-cli minutes +detail --minute-tokens <minute_token> --summary
182
182
  | 时间参数校验失败 | `--start` 或 `--end` 格式不合法 | 改用 ISO 8601 或 `YYYY-MM-DD` |
183
183
  | `owner-ids` 校验失败 | 传入的不是 open\_id,且也不是 `me`;或传了 `me` 但当前用户 open\_id 不可解析 | 改为 `ou_` 开头的用户 ID,或先完成 `auth login` 后再传 `me` |
184
184
  | `participant-ids` 校验失败 | 传入的不是 open\_id,且也不是 `me`;或传了 `me` 但当前用户 open\_id 不可解析 | 改为 `ou_` 开头的用户 ID,或先完成 `auth login` 后再传 `me` |
185
- | 权限不足 | 未授权 `minutes:minutes.search:read` | 使用 `auth login` 完成授权 |
185
+ | 权限不足 | 未授权 `minutes:minutes.search:read` | user 身份使用 `auth login` 完成用户授权;bot 身份检查 tenant access token 和应用 scope |
186
186
 
187
187
  ## 提示
188
188
 
@@ -199,4 +199,3 @@ lark-cli minutes +detail --minute-tokens <minute_token> --summary
199
199
  - [lark-minutes](../SKILL.md) -- 妙记相关命令
200
200
  - [lark-minutes-detail](lark-minutes-detail.md) -- 基于 `minute_token` 获取逐字稿、总结、待办、章节等产物
201
201
  - [lark-vc](../../lark-vc/SKILL.md) -- 视频会议全部命令
202
-
@@ -80,8 +80,8 @@ LARKSUITE_CLI_NO_UPDATE_NOTIFIER=1 LARKSUITE_CLI_NO_SKILLS_NOTIFIER=1 lark-cli a
80
80
  #### User 身份(`--as user`)
81
81
 
82
82
  ```bash
83
- lark-cli auth login --domain <domain> # 按业务域授权
84
- lark-cli auth login --scope "<missing_scope>" # 按具体 scope 授权(推荐,符合最小权限原则)
83
+ lark-cli auth login --domain <domain> --no-wait --json # 按业务域发起授权
84
+ lark-cli auth login --scope "<missing_scope>" --no-wait --json # 按具体 scope 发起授权(推荐,符合最小权限原则)
85
85
  ```
86
86
 
87
87
  **规则**:auth login 必须指定范围(`--domain` 或 `--scope`)。多次 login 的 scope 会累积(增量授权)。
@@ -124,7 +124,7 @@ lark-cli auth login --device-code <device_code>
124
124
 
125
125
  - **你必须亲自执行 `--device-code` 命令**,不要指示用户自行执行
126
126
  - **不要在同一轮中展示 URL 后立刻执行 `--device-code`**,这会导致用户看不到 URL
127
- - **禁止缓存 `verification_url` 或 `device_code`**:每次需要授权时,必须重新执行 `lark-cli auth login --no-wait --json` 生成新的链接。不要将授权链接和 device code 存入上下文供后续复用
127
+ - **禁止缓存 `verification_url` 或 `device_code`**:每次需要重新发起授权时,必须沿用所需的 `--scope`、`--domain` 或 `--recommend` 选择以及任何 `--exclude` 值,并附加 `--no-wait --json` 生成新的链接。不要复用已过期的授权链接或 device code
128
128
 
129
129
  ## 更新检查
130
130