@amaster.ai/pi-lark 0.1.2-beta.60 → 0.1.2-beta.62

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 (113) hide show
  1. package/README.md +1 -3
  2. package/package.json +2 -2
  3. package/skills/lark-approval/SKILL.md +2 -2
  4. package/skills/lark-approval/references/lark-approval-instances-initiated.md +5 -0
  5. package/skills/lark-approval/references/lark-approval-tasks-add-sign.md +68 -20
  6. package/skills/lark-approval/references/lark-approval-tasks-query.md +5 -0
  7. package/skills/lark-apps/SKILL.md +1 -1
  8. package/skills/lark-apps/references/lark-apps-cache.md +38 -5
  9. package/skills/lark-base/SKILL.md +131 -11
  10. package/skills/lark-base/references/lark-base-app.md +18 -0
  11. package/skills/lark-base/references/lark-base-dashboard-block-config.md +28 -1
  12. package/skills/lark-base/references/lark-base-dashboard.md +29 -11
  13. package/skills/lark-base/references/lark-base-data-query.md +2 -6
  14. package/skills/lark-base/references/lark-base-field-extension.md +170 -0
  15. package/skills/lark-base/references/lark-base-field-lookup.md +1 -1
  16. package/skills/lark-base/references/lark-base-field-schema.md +10 -1
  17. package/skills/lark-base/references/lark-base-filter-condition.md +32 -5
  18. package/skills/lark-base/references/lark-base-form-detail.md +1 -1
  19. package/skills/lark-base/references/lark-base-form-questions-create.md +36 -5
  20. package/skills/lark-base/references/lark-base-form-submit.md +2 -2
  21. package/skills/lark-base/references/lark-base-record-history-list.md +1 -1
  22. package/skills/lark-base/references/lark-base-record-query-and-analysis-sop.md +95 -205
  23. package/skills/lark-base/references/lark-base-template-center.md +199 -0
  24. package/skills/lark-calendar/SKILL.md +14 -5
  25. package/skills/lark-calendar/references/lark-calendar-join-event.md +43 -0
  26. package/skills/lark-calendar/references/lark-calendar-transfer.md +89 -0
  27. package/skills/lark-doc/references/lark-doc-fetch.md +1 -1
  28. package/skills/lark-drive/references/lark-drive-add-comment.md +2 -2
  29. package/skills/lark-drive/references/lark-drive-member-remove.md +2 -1
  30. package/skills/lark-im/SKILL.md +15 -3
  31. package/skills/lark-im/references/lark-im-message-read-status.md +96 -0
  32. package/skills/lark-mail/references/lark-mail-draft-create.md +12 -12
  33. package/skills/lark-mail/references/lark-mail-forward.md +17 -17
  34. package/skills/lark-mail/references/lark-mail-reply-all.md +8 -8
  35. package/skills/lark-mail/references/lark-mail-reply.md +6 -6
  36. package/skills/lark-mail/references/lark-mail-send.md +20 -20
  37. package/skills/lark-mail/references/lark-mail-template-create.md +7 -6
  38. package/skills/lark-mail/references/lark-mail-template-update.md +7 -6
  39. package/skills/lark-markdown/SKILL.md +1 -1
  40. package/skills/lark-meeting/SKILL.md +150 -0
  41. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-apply-permission.md +2 -5
  42. package/skills/lark-meeting/references/lark-minutes-detail.md +52 -0
  43. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-download.md +3 -5
  44. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-search.md +4 -34
  45. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-speaker-replace.md +3 -4
  46. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-summary.md +3 -5
  47. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-todo.md +44 -16
  48. package/skills/{lark-minutes → lark-meeting}/references/lark-minutes-update.md +2 -3
  49. package/skills/lark-meeting/references/lark-minutes-upload.md +71 -0
  50. package/skills/lark-meeting/references/lark-note-detail.md +15 -0
  51. package/skills/lark-meeting/references/lark-note-transcript.md +19 -0
  52. package/skills/lark-meeting/references/lark-vc-agent-meeting-end.md +26 -0
  53. package/skills/lark-meeting/references/lark-vc-agent-meeting-invite.md +32 -0
  54. package/skills/{lark-vc-agent → lark-meeting}/references/lark-vc-agent-meeting-join.md +11 -56
  55. package/skills/{lark-vc-agent → lark-meeting}/references/lark-vc-agent-meeting-leave.md +2 -41
  56. package/skills/lark-meeting/references/lark-vc-detail.md +31 -0
  57. package/skills/lark-meeting/references/lark-vc-meeting-countdown.md +103 -0
  58. package/skills/{lark-vc → lark-meeting}/references/lark-vc-meeting-events.md +9 -98
  59. package/skills/{lark-vc → lark-meeting}/references/lark-vc-meeting-list-active.md +4 -29
  60. package/skills/{lark-vc → lark-meeting}/references/lark-vc-meeting-message-send.md +3 -5
  61. package/skills/lark-meeting/references/lark-vc-meeting-screenshot.md +34 -0
  62. package/skills/{lark-vc → lark-meeting}/references/lark-vc-recording.md +3 -64
  63. package/skills/{lark-vc → lark-meeting}/references/lark-vc-search.md +9 -28
  64. package/skills/lark-meeting/scenes/create-and-edit-minutes.md +147 -0
  65. package/skills/lark-meeting/scenes/live-meeting-attend.md +164 -0
  66. package/skills/lark-meeting/scenes/live-meeting-interact.md +101 -0
  67. package/skills/lark-meeting/scenes/query-meeting-and-artifacts.md +90 -0
  68. package/skills/lark-meeting/scenes/query-minutes-and-artifacts.md +70 -0
  69. package/skills/lark-meeting/scenes/query-note-and-artifacts.md +127 -0
  70. package/skills/lark-minutes/SKILL.md +5 -203
  71. package/skills/lark-note/SKILL.md +5 -88
  72. package/skills/lark-sheets/SKILL.md +76 -60
  73. package/skills/lark-sheets/references/lark-sheets-batch-update.md +82 -13
  74. package/skills/lark-sheets/references/lark-sheets-chart.md +296 -159
  75. package/skills/lark-sheets/references/lark-sheets-conditional-format.md +5 -3
  76. package/skills/lark-sheets/references/lark-sheets-filter.md +1 -1
  77. package/skills/lark-sheets/references/lark-sheets-formula-translation.md +78 -65
  78. package/skills/lark-sheets/references/lark-sheets-formula-verify.md +21 -17
  79. package/skills/lark-sheets/references/lark-sheets-pivot-table.md +2 -1
  80. package/skills/lark-sheets/references/lark-sheets-range-operations.md +1 -1
  81. package/skills/lark-sheets/references/lark-sheets-read-data.md +7 -4
  82. package/skills/lark-sheets/references/lark-sheets-search-replace.md +4 -4
  83. package/skills/lark-sheets/references/lark-sheets-sheet-structure.md +2 -2
  84. package/skills/lark-sheets/references/lark-sheets-sparkline.md +1 -0
  85. package/skills/lark-sheets/references/lark-sheets-styles-put.md +3 -3
  86. package/skills/lark-sheets/references/lark-sheets-visual-standards.md +6 -4
  87. package/skills/lark-sheets/references/lark-sheets-workbook.md +3 -1
  88. package/skills/lark-sheets/references/lark-sheets-write-cells.md +49 -47
  89. package/skills/lark-sheets/scripts/lark_chart_layout_check.py +472 -0
  90. package/skills/lark-slides/SKILL.md +2 -0
  91. package/skills/lark-slides/references/cli/lark-slides-add-slide.md +6 -6
  92. package/skills/lark-slides/references/cli/lark-slides-delete-slide.md +3 -3
  93. package/skills/lark-slides/references/cli/lark-slides-replace-slide.md +11 -11
  94. package/skills/lark-slides/references/cli/lark-slides-xml-presentation-slide-get.md +1 -1
  95. package/skills/lark-slides/references/cli/lark-slides-xml-presentation-slide-replace.md +2 -2
  96. package/skills/lark-slides/references/workflow/slides-editing.md +11 -11
  97. package/skills/lark-slides/references/xml/slides_xml_schema_definition.xml +103 -14
  98. package/skills/lark-task/SKILL.md +1 -1
  99. package/skills/lark-vc/SKILL.md +5 -205
  100. package/skills/lark-vc-agent/SKILL.md +5 -206
  101. package/skills/lark-workflow-meeting-summary/SKILL.md +10 -14
  102. package/skills/lark-base/references/lark-base-cell-value.md +0 -165
  103. package/skills/lark-base/references/lark-base-data-analysis-pandas.md +0 -93
  104. package/skills/lark-base/references/lark-base-data-analysis-python-stdlib.md +0 -120
  105. package/skills/lark-base/references/lark-base-record-batch-create.md +0 -63
  106. package/skills/lark-base/references/lark-base-record-batch-update.md +0 -57
  107. package/skills/lark-base/references/lark-base-record-query-and-analysis-cloud-sop.md +0 -145
  108. package/skills/lark-minutes/references/lark-minutes-detail.md +0 -63
  109. package/skills/lark-minutes/references/lark-minutes-upload.md +0 -104
  110. package/skills/lark-note/references/lark-note-detail.md +0 -29
  111. package/skills/lark-note/references/lark-note-transcript.md +0 -25
  112. package/skills/lark-vc/references/lark-vc-detail.md +0 -49
  113. package/skills/lark-vc/references/vc-domain-boundaries.md +0 -203
@@ -0,0 +1,43 @@
1
+ # calendar +join-event
2
+
3
+ 凭**分享 token** 加入日程。
4
+
5
+ ## 命令
6
+
7
+ ```bash
8
+ # 用户以自身身份加入(默认场景)
9
+ lark-cli calendar +join-event --token <token> --as user
10
+
11
+ # 以应用身份加入
12
+ lark-cli calendar +join-event --token <token> --as bot
13
+ ```
14
+
15
+ ## 参数
16
+
17
+ | 参数 | 必填 | 说明 |
18
+ |------|------|------|
19
+ | `--token <token>` | **是** | 分享 token,加入的唯一入参(别名 `--share-token`)。|
20
+
21
+ ## token 从哪来
22
+
23
+ | token 类型 | 承载来源 | 取值 |
24
+ |-----------|---------|------|
25
+ | 链接类 | 分享链接 / 二维码 | 链接 `{{domain}}/calendar/share?token=<token>` 里的 `token` |
26
+ | 卡片类 | 分享卡片 / RSVP 卡片 | 从 IM 日程分享卡片或 RSVP 卡片消息解析出的日程分享 token |
27
+
28
+ - **分享链接**:直接取 URL query 里的 `token` 值传入;无需解析日程字段。例如 `{{domain}}/calendar/share?token=29f762bdmsbd82ce9` → `--token 29f762bdmsbd82ce9`。
29
+ - **二维码**:先用 OCR/扫码解析成分享链接,再取其中的 `token`——CLI 不承接二维码图像,只承接解析后的链接 token。
30
+ - **卡片**:token 落在卡片消息 content(分享卡片 `SHARE_CALENDAR_EVENT`、RSVP 卡片 `GENERAL_CALENDER`);RSVP 卡片被转发后退化为分享卡片,同样可加入。
31
+
32
+ ## 重复性日程
33
+
34
+ 加入范围取决于 token 反解出的日程本体是「原重复性日程」还是「例外」(参见 [lark-calendar-recurring](lark-calendar-recurring.md) 的关键概念):
35
+
36
+ - 分享的是**原重复性日程**(`{event_uid}_0`):加入的是**整个序列**(含例外)。
37
+ - 分享的是某个**例外**(`originalTime > 0` 的单次实例):只加入这**一个例外日程**。
38
+
39
+ ## 参考
40
+
41
+ - [lark-calendar](../SKILL.md) -- skill 入口与路由
42
+ - [lark-calendar-rsvp](lark-calendar-rsvp.md) -- 已在日程中时回复接受/拒绝/待定(≠ 加入)
43
+ - [lark-calendar-recurring](lark-calendar-recurring.md) -- 重复性日程的序列 vs 实例操作规范
@@ -0,0 +1,89 @@
1
+ # calendar +transfer
2
+
3
+ 把一个日程的**组织者(organizer)**转让给另一个用户或机器人。用户和机器人之间可以任意互转。
4
+
5
+ ## 命令
6
+
7
+ ```bash
8
+ # 转让给某人(原组织者保留为参与人)
9
+ lark-cli calendar +transfer --event-id <event_id> --to-user-id ou_xxx --yes
10
+
11
+ # 转让并把原组织者从参与人中移除
12
+ lark-cli calendar +transfer --event-id <event_id> --to-user-id ou_xxx --remove-original-organizer --yes
13
+
14
+ # 指定日历
15
+ lark-cli calendar +transfer --calendar-id <calendar_id> --event-id <event_id> --to-user-id ou_xxx --yes
16
+
17
+ # 重复性日程:必须显式确认整个序列一起转让
18
+ lark-cli calendar +transfer --event-id <event_id> --to-user-id ou_xxx --transfer-series --yes
19
+
20
+ # 预览请求,不实际执行
21
+ lark-cli calendar +transfer --event-id <event_id> --to-user-id ou_xxx --dry-run
22
+ ```
23
+
24
+ ## 参数
25
+
26
+ | 参数 | 必填 | 说明 |
27
+ |------|------|------|
28
+ | `--event-id <id>` | **是** | 日程 ID(`uid_originalTime` 形式) |
29
+ | `--to-user-id <ou_...>` | **是** | 接收人 open_id,成为新组织者;用户和机器人都可以 |
30
+ | `--calendar-id <id>` | 否 | 日程所在日历 ID(省略则使用主日历) |
31
+ | `--remove-original-organizer` | 否 | 转让后把原组织者移出参与人;默认保留。日程在共享日历上时服务端一定会移除 |
32
+ | `--transfer-series` | 否 | 确认整个重复性序列一起转让;重复性日程必填 |
33
+ | `--yes` | **是**(非 dry-run) | 高敏写操作确认 |
34
+ | `--dry-run` | 否 | 预览 API 调用,不执行 |
35
+
36
+ ## 转让方向
37
+
38
+ 转出方和接收方是两个**互相独立**的参数,四种组合都支持:
39
+
40
+ - **转出方**由 `--as` 决定,必须是日程**当前组织者**的身份。bot 组织的日程用 `--as bot`,用户自己的日程用 `--as user`。用非组织者身份调用会返回 403。
41
+ - **接收方**由 `--to-user-id` 决定,传谁的 open_id 就转给谁,是人还是机器人不影响命令写法。
42
+
43
+ | 方向 | 命令 |
44
+ |------|------|
45
+ | user → user | `--as user --to-user-id <对方用户 open_id>` |
46
+ | user → bot | `--as user --to-user-id <bot 的 open_id>` |
47
+ | bot → user | `--as bot --to-user-id <用户 open_id>` |
48
+ | bot → bot | `--as bot --to-user-id <另一个 bot 的 open_id>` |
49
+
50
+ **取接收人 open_id**:
51
+
52
+ ```bash
53
+ # 用户
54
+ lark-cli contact +search-user --query <姓名> --as user
55
+ # 机器人:从它所在群的成员列表里取 bots[] 中的 open_id
56
+ lark-cli im +chat-members-list --chat-id <chat_id> --member-types bot
57
+ ```
58
+
59
+ 机器人的 open_id 同样是 `ou_` 开头;不要传 `cli_` 开头的 app_id,那是应用 ID,不是日程参与人身份。
60
+
61
+ 无论哪个方向,转让都要求转出方和接收方**同租户**,且接收方能通过高管模式的协作校验。
62
+
63
+ ## 重复性日程
64
+
65
+ 后端按 `uid` 定位日程,忽略 `original_time`,**无法只转让某一次实例**。因此传入任何一个实例或例外的 `event_id`,都会把整个序列(含所有例外)一起转让。
66
+
67
+ 是重复性日程且未加 `--transfer-series` 时命令直接失败(`failed_precondition`),不会发出转让请求。收到这个错误时**先向用户确认"整个重复日程都转让"**,得到确认后再带 `--transfer-series` 重跑;不要自动重试。已确认时加 `--transfer-series` 会跳过这次预读。
68
+
69
+ ## 返回中的 `original_organizer_removed`
70
+
71
+ **共享日历不属于任何组织者,转让时服务端会强制把原组织者移出日程;主日历则会把原组织者保留为参与人。** 转让接口成功时不返回这个结果,所以命令只在能确定时才输出该字段:
72
+
73
+ | 情况 | 返回 |
74
+ |------|------|
75
+ | 带 `--remove-original-organizer` | `original_organizer_removed: true` |
76
+ | 省略 `--calendar-id`(主日历) | `original_organizer_removed: false` |
77
+ | 传了 `--calendar-id` 且未传 `--remove-original-organizer` | **不返回该字段**,stderr 给一条 note 说明共享日历会强制移除 |
78
+
79
+ 字段缺失时**不要**告诉用户"原组织者已保留为参与人",也不要断言已被移除。需要确认就转让后读一次日程看参与人,或一开始就显式传 `--remove-original-organizer`。
80
+
81
+ ## 提示
82
+
83
+ - 转让不可逆,且会连同日程上的会议纪要、笔记和附件一起移交给新组织者。
84
+ - 需要 `calendar:calendar.event:transfer` 权限;转让前的重复性预读需要 `calendar:calendar.event:read`(带 `--transfer-series` 时不读)。
85
+
86
+ ## 参考
87
+
88
+ - [lark-calendar](../SKILL.md) -- skill 入口与路由
89
+ - [重复性日程操作规范](lark-calendar-recurring.md)
@@ -127,7 +127,7 @@ lark-cli docs +fetch --doc Z1Fj...tnAc --scope section --start-block-id blkTitle
127
127
  |`<whiteboard>`|提取 `token`,使用 `docs +media-download`|
128
128
  |`<sheet>`、`<cite file-type="sheets">`|提取 `token` 和 `sheet-id`,转到 [`lark-sheets`](../../lark-sheets/SKILL.md)|
129
129
  |`<bitable>`、`<cite file-type="bitable">`|提取 `token` 和 `table-id`,转到 [`lark-base`](../../lark-base/SKILL.md)|
130
- |`<vc-transcribe-tab>`|提取 `vc-node-id`,使用 [`lark-note`](../../lark-note/SKILL.md) 的 `note +detail`|
130
+ |`<vc-transcribe-tab>`|提取 `vc-node-id`,使用 [`lark-meeting`](../../lark-meeting/SKILL.md) 的 `note +detail`|
131
131
  |`<synced_reference>`|提取 `src-token` 和 `src-block-id`,读取源文档并定位 block|
132
132
 
133
133
  ## 参考
@@ -165,10 +165,10 @@ lark-cli drive +add-comment \
165
165
  - 未传 `--block-id` 时,shortcut 默认创建**全文评论**;也可以显式传 `--full-comment`。全文评论支持 `docx`、旧版 `doc` URL、白名单扩展名的 Drive file,以及最终可解析为 `doc`/`docx`/`file` 的 wiki URL。
166
166
  - **Drive file 评论**:仅支持白名单扩展名的普通文件。当前支持:`.md`、`.txt`、`.json`、`.csv`、`.go`、`.js`、`.py`、`.pptx`、`.png`、`.jpg`、`.jpeg`、`.zip`、`.mp3`、`.mp4`。
167
167
  - **Drive file 暂不支持**:`.pdf`、`.docx`、`.xlsx` 等未在白名单内的普通文件会被 CLI 拒绝,并提示“当前还不支持这种类型的评论”。这些类型虽然可能接受 OpenAPI 请求,但在页面评论展示上存在问题。
168
- - **Drive file 只支持全文评论**:file 目标不支持局部评论,不允许传 `--block-id` 或 `--selection-with-ellipsis`。
168
+ - **Drive file 只支持全文评论**:file 目标不支持局部评论,不允许传 `--block-id`。
169
169
  - 传 `--block-id` 时,shortcut 创建**局部评论(划词评论)**;该模式支持 `docx`、`sheet`、`slides`、Base / bitable,以及最终可解析为这些类型的 wiki URL。
170
170
  - **Sheet 评论**:当 `--doc` 为 sheet URL 或 wiki 解析为 sheet 时,使用 `--block-id "<sheetId>!<cell>"` 指定单元格(如 `a281f9!D6`);sheet 没有全文评论,`--full-comment` 不可用。
171
- - **Slide 评论**:当 `--doc` 为 slides URL、`--type slides`,或 wiki 解析为 slides 时,必须传 `--block-id "<SLIDE_BLOCK_TYPE>!<XML_ELEMENT_ID>"`。此时 `--full-comment` 和 `--selection-with-ellipsis` 不可用。
171
+ - **Slide 评论**:当 `--doc` 为 slides URL、`--type slides`,或 wiki 解析为 slides 时,必须传 `--block-id "<SLIDE_BLOCK_TYPE>!<XML_ELEMENT_ID>"`。此时 `--full-comment` 不可用。
172
172
  - **Base 记录局部评论**:Base 不支持全局评论,所有评论都挂在记录上;裸 token 可传 `--type bitable` 或 `--type base`,推荐 `bitable`。定位信息必须是 file token(base token)+ `--block-id "<table-id>!<record-id>!<view-id>"`,其中 table/record/view ID 通常分别以 `tbl`/`rec`/`vew` 开头;view_id 只决定被提及时点击通知打开哪个视图,不影响评论挂载点,但必须传。ID 获取参考 [`lark-base`](../../lark-base/SKILL.md)。
173
173
  - **Slide 参数映射示例**:`--block-id` 由 PPT XML 元素类型和元素 `id` 组成。例如:
174
174
  - `<slide id="pkk">` 对应 `--block-id slide!pkk`,表示给整页评论。
@@ -20,7 +20,7 @@ lark-cli drive +member-remove \
20
20
  | `--token` | 是 | 裸 token 或完整 URL。路径支持 `/drive/folder/`、`/docx/`、`/doc/`、`/sheets/`、`/base/`、`/bitable/`、`/wiki/`、`/file/`、`/mindnotes/`、`/slides/`、`/minutes/`、`/page/`;URL 可从路径推断类型,裸 token 必须同时传 `--type`。 |
21
21
  | `--type` | 条件必填 | 资源类型:`docx` / `doc` / `sheet` / `bitable` / `file` / `folder` / `wiki` / `mindnote` / `slides` / `minutes` / `apps`。完整 URL 可省略。 |
22
22
  | `--member-id` | 是 | 要移除的单个协作者 ID。逗号分隔的多成员输入会被拒绝;批量场景应逐个调用。 |
23
- | `--member-type` | 是 | ID 类型:`email` / `openid` / `openchat` / `opendepartmentid` / `userid` / `unionid` / `groupid` / `wikispaceid`。 |
23
+ | `--member-type` | 是 | ID 类型:`email` / `openid` / `openchat` / `opendepartmentid` / `userid` / `unionid` / `groupid` / `appid` / `wikispaceid`。 |
24
24
  | `--member-kind` | 条件必填 | 仅 `--member-type=wikispaceid` 使用:未启用知识库成员分组时传 `wiki_space_member`,启用后根据权限传 `wiki_space_viewer` 或 `wiki_space_editor`。 |
25
25
  | `--perm-type` | 否 | 仅 wiki 协作者使用:`container`(默认,当前页面及子页面)或 `single_page`(仅当前页面)。 |
26
26
  | `--dry-run` | 否 | 只预览 DELETE URL、query 和 body,不调用接口。 |
@@ -52,6 +52,7 @@ Wiki 普通协作者还会返回 `perm_type`;`wikispaceid` 返回所传的 `me
52
52
  ## 行为说明
53
53
 
54
54
  - **身份支持**:支持 `--as user` 和 `--as bot`。
55
+ - **应用协作者**:使用 `--member-type=appid`,`--member-id` 传应用 ID(通常为 `cli_xxx`)。
55
56
  - **部门协作者**:`--member-type=opendepartmentid` 只能配合 `--as user`;bot 身份会在客户端提前拒绝。
56
57
  - **安全编码**:资源 token 和 member ID 都作为独立 path segment 编码。
57
58
  - **Wiki 范围**:普通 wiki 协作者默认删除 `container` 权限;只删除当前页面权限时显式传 `single_page`。
@@ -35,6 +35,10 @@ Chat (oc_xxx)
35
35
 
36
36
  ## Important Notes
37
37
 
38
+ ### AppLink and Share Links
39
+
40
+ Prefer CLI-returned links: use `chat_app_link` to open joined conversations, `message_app_link` to open messages, and `share_link` to invite others to groups. If manually building a joined-conversation AppLink, use `https://<applink_host>/client/chat/open?openChatId=<oc_xxx>`, never `chatId=<oc_xxx>` or `lark://...chat_id=<oc_xxx>`.
41
+
38
42
  ### Identity and Token Mapping
39
43
 
40
44
  - `--as user` means **user identity** and uses `user_access_token`. Calls run as the authorized end user, so permissions depend on both the app scopes and that user's own access to the target chat/message/resource.
@@ -60,7 +64,7 @@ The four message-pulling shortcuts (`+messages-mget`, `+chat-messages-list`, `+m
60
64
 
61
65
  ### Card Messages (Interactive)
62
66
 
63
- **Before sending or replying with any `interactive` card (`+messages-send` / `+messages-reply`), you MUST read [`references/card/lark-im-card-create.md`](references/card/lark-im-card-create.md) and follow its workflow.** The card JSON passed to `--msg-type interactive --content` must be the output of that workflow — never hand-write or copy a card payload.
67
+ **Before sending, replying with, or updating any `interactive` card (`+messages-send` / `+messages-reply` / `messages.patch`), you MUST read [`references/card/lark-im-card-create.md`](references/card/lark-im-card-create.md) and follow its workflow.** The card JSON passed to `--msg-type interactive --content` (send/reply) or `messages.patch --data` (update) must be the output of that workflow — never hand-write or copy a card payload.
64
68
 
65
69
  Card messages (`interactive` type) are not yet supported for compact conversion in event subscriptions. The raw event data will be returned instead, with a hint printed to stderr.
66
70
 
@@ -109,7 +113,9 @@ Shortcut 是对常用操作的高级封装(`lark-cli im +<verb> [flags]`)。
109
113
  | [`+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
114
  | [`+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
115
  | [`+chat-update`](references/lark-im-chat-update.md) | Update group chat name or description; user/bot; updates a chat's name or description |
116
+ | [`+message-read-users`](references/lark-im-message-read-status.md) | List users who read one message; user/bot; identity-specific scopes; supports bounded auto-pagination |
112
117
  | [`+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 |
118
+ | [`+messages-read-status`](references/lark-im-message-read-status.md) | Batch query whether the current user read 1–50 messages; user-only; returns readable items and invalid message IDs |
113
119
  | [`+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
120
  | [`+messages-resources-download`](references/lark-im-messages-resources-download.md) | Download an image or file attached to a message; user/bot |
115
121
  | [`+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 |
@@ -169,10 +175,12 @@ lark-cli im <resource> <method> [flags] # 调用 API
169
175
 
170
176
  ### messages
171
177
 
178
+ - `read_status` — 批量查询当前用户对消息的已读状态。Identity: `user` only (`user_access_token`); accepts up to 50 message IDs and returns readable items plus invalid message IDs.[Must-read](references/lark-im-message-read-status.md)
172
179
  - `delete` — 撤回消息。Identity: supports `user` and `bot`; for `bot` calls, the bot must be in the chat to revoke group messages; to revoke another user's group message, the bot must be the owner, an admin, or the creator; for user P2P recalls, the target user must be within the bot's availability.
173
180
  - `forward` — 转发消息。Identity: supports `user` and `bot`.
174
181
  - `merge_forward` — 合并转发消息。Identity: `bot` only (`tenant_access_token`).
175
- - `read_users` — 查询消息已读信息。Identity: `bot` only (`tenant_access_token`); the bot must be in the chat, and can only query read status for messages it sent within the last 7 days.
182
+ - `read_users` — 查询消息已读信息。Identity: supports `user` and `bot`; the caller must still be in the chat. A user can query messages they sent within the last 7 days, while a bot can query only messages sent by that bot within the last 7 days.[Must-read](references/lark-im-message-read-status.md)
183
+ - `patch` — 更新已发送的消息卡片。Update an interactive message card sent by the app. Identity: supports `user` and `bot`; the message must have been sent within the last 14 days, and `content` must be a JSON-serialized string no larger than 30 KB.[Must-read](references/card/lark-im-card-create.md)
176
184
  - `urgent_app` — 发送应用内加急。Identity: `bot` only (`tenant_access_token`); the bot must be the message sender and must be in the conversation that contains the message.
177
185
  - `urgent_phone` — 发送电话加急。Identity: `bot` only (`tenant_access_token`); the bot must be the message sender and must be in the conversation that contains the message.
178
186
  - `urgent_sms` — 发送短信加急。Identity: `bot` only (`tenant_access_token`); the bot must be the message sender and must be in the conversation that contains the message.
@@ -229,10 +237,14 @@ lark-cli im <resource> <method> [flags] # 调用 API
229
237
  | `chat.managers.delete_managers` | `im:chat.managers:write_only` |
230
238
  | `chat.moderation.get` | `im:chat.moderation:read` |
231
239
  | `chat.moderation.update` | `im:chat:moderation:write_only` |
240
+ | `+messages-read-status` | user: `im:message:readonly` (recommended), `im:message`, or `im:message:get_as_user` |
241
+ | `+message-read-users` | user: `im:message:readonly` (recommended), `im:message`, `im:message:basic`, or `im:message:get_as_user`; bot: `im:message:readonly` |
242
+ | `messages.read_status` | `im:message:readonly` (recommended), `im:message`, or `im:message:get_as_user` |
232
243
  | `messages.delete` | `im:message:recall` |
233
244
  | `messages.forward` | `im:message` |
234
245
  | `messages.merge_forward` | `im:message` |
235
- | `messages.read_users` | `im:message:readonly` |
246
+ | `messages.read_users` | user: `im:message:readonly` (recommended), `im:message`, `im:message:basic`, or `im:message:get_as_user`; bot: `im:message:readonly` |
247
+ | `messages.patch` | `im:message:update` |
236
248
  | `messages.urgent_app` | `im:message.urgent` |
237
249
  | `messages.urgent_phone` | `im:message.urgent:phone` |
238
250
  | `messages.urgent_sms` | `im:message.urgent:sms` |
@@ -0,0 +1,96 @@
1
+ # IM message read status
2
+
3
+ > **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first for authentication and global parameters.
4
+
5
+ Use two focused shortcuts for message read-status queries:
6
+
7
+ - `im +messages-read-status` queries whether the current user has read 1–50 messages.
8
+ - `im +message-read-users` lists users who have read one message and supports automatic pagination.
9
+
10
+ Both underlying OpenAPIs support user identity through a user access token (UAT). `+message-read-users` additionally supports bot identity through a tenant access token (TAT).
11
+
12
+ ## Identity and scopes
13
+
14
+ | Shortcut | Identity | Scope |
15
+ |---|---|---|
16
+ | `+messages-read-status` | user only | `im:message:readonly` (recommended), `im:message`, or `im:message:get_as_user` |
17
+ | `+message-read-users` | user | `im:message:readonly` (recommended), `im:message`, `im:message:basic`, or `im:message:get_as_user` |
18
+ | `+message-read-users` | bot | `im:message:readonly` |
19
+
20
+ For `+message-read-users`, the caller must still be in the chat. A user can query only messages they sent within the last seven days, while a bot can query only messages sent by that bot within the last seven days.
21
+ The user scopes in the table are alternatives; the CLI preflight uses `im:message:readonly` because it is the least-privileged regular OAuth scope supported by this endpoint.
22
+
23
+ ## Batch query the current user's read status
24
+
25
+ ```bash
26
+ # Preview one request
27
+ lark-cli im +messages-read-status \
28
+ --message-ids om_xxx,om_yyy \
29
+ --as user \
30
+ --dry-run
31
+
32
+ # Execute with a user access token
33
+ lark-cli im +messages-read-status \
34
+ --message-ids om_xxx,om_yyy \
35
+ --as user \
36
+ --json
37
+ ```
38
+
39
+ The command accepts 1–50 comma-separated `om_` message IDs. The three scopes above are alternatives; any one is sufficient, and the CLI recommends the least-privileged OAuth scope `im:message:readonly`. The response keeps the OpenAPI response unchanged:
40
+
41
+ - `items[].message_id` and `items[].is_read` contain statuses the server could determine.
42
+ - `invalid_message_ids` contains messages that do not exist, are not visible to the current user, or do not support this query. The API deliberately does not expose a more specific reason.
43
+
44
+ ## List users who read one message
45
+
46
+ ```bash
47
+ # Fetch one page as the current user
48
+ lark-cli im +message-read-users \
49
+ --message-id om_xxx \
50
+ --as user \
51
+ --json
52
+
53
+ # Fetch every page as a bot, bounded to ten pages by default
54
+ lark-cli im +message-read-users \
55
+ --message-id om_xxx \
56
+ --user-id-type open_id \
57
+ --page-all \
58
+ --as bot \
59
+ --json
60
+ ```
61
+
62
+ Pagination flags:
63
+
64
+ - `--page-size`: 1–100, default 100.
65
+ - `--page-token`: start from a known cursor.
66
+ - `--page-all`: continue until the endpoint is exhausted.
67
+ - `--page-limit`: maximum pages with `--page-all`; default 10, range 1–1000.
68
+ - `--page-delay`: delay in milliseconds between pages; default 200, and 0 disables the delay.
69
+
70
+ The command preserves each server item, including `user_id_type`, `user_id`, `timestamp`, and `tenant_key`. Pagination metadata reports whether the endpoint was exhausted and retains the next token when a bounded run can be resumed.
71
+
72
+ ## Raw API commands
73
+
74
+ When Registry MR !128 is published, the corresponding raw commands remain available:
75
+
76
+ ```bash
77
+ lark-cli im messages read_status --data '{"message_ids":["om_xxx"]}' --as user
78
+ lark-cli im messages read_users --params '{"message_id":"om_xxx","user_id_type":"open_id"}' --as user
79
+ ```
80
+
81
+ Prefer the shortcuts for flag validation, identity-specific scope hints, and read-users auto-pagination.
82
+
83
+ ## Troubleshooting
84
+
85
+ | Symptom | Meaning | Action |
86
+ |---|---|---|
87
+ | `--as bot is not supported` for read status | The batch endpoint requires user identity | Switch to `--as user` |
88
+ | Missing `im:message:readonly` or `im:message` | A regular OAuth scope has not been granted | Follow the CLI authorization hint to grant one supported scope |
89
+ | Missing a user read scope | No supported regular OAuth scope has been granted | Grant `im:message:readonly` and retry |
90
+ | Bot permission denied | The application lacks a bot scope | Open the `console_url` from the typed error and enable the requested scope |
91
+ | Empty read-user list | No user has read the message, or sender/time constraints are not met | Verify chat membership, the message sender, and the seven-day window |
92
+
93
+ ## References
94
+
95
+ - [lark-im](../SKILL.md)
96
+ - [lark-shared](../../lark-shared/SKILL.md)
@@ -24,37 +24,37 @@
24
24
 
25
25
  ```bash
26
26
  # 创建 HTML 草稿(推荐)
27
- lark-cli mail +draft-create --to alice@example.com --subject '周报' \
27
+ lark-cli mail +draft-create --to 'alice@example.com' --subject '周报' \
28
28
  --body '<p>本周进展:</p><ul><li>完成 A 模块</li></ul>'
29
29
 
30
30
  # 不带收件人的 HTML 草稿(用户之后可自行添加)
31
31
  lark-cli mail +draft-create --subject '周报' --body '<p>草稿内容</p>'
32
32
 
33
33
  # 带附件和内嵌图片的 HTML 草稿(推荐:直接用相对路径,自动解析)
34
- lark-cli mail +draft-create --to alice@example.com --subject '预览图' --body '<p>见附件和图:<img src="./logo.png" /></p>' --attach ./report.pdf
34
+ lark-cli mail +draft-create --to 'alice@example.com' --subject '预览图' --body '<p>见附件和图:<img src="./logo.png" /></p>' --attach './report.pdf'
35
35
 
36
36
  # 纯文本草稿(仅在内容极简时使用)
37
- lark-cli mail +draft-create --to alice@example.com --subject '简短通知' --body '收到,谢谢'
37
+ lark-cli mail +draft-create --to 'alice@example.com' --subject '简短通知' --body '收到,谢谢'
38
38
 
39
39
  # Dry Run(仅打印请求,不执行)
40
- lark-cli mail +draft-create --to alice@example.com --subject '测试' --body 'test' --dry-run
40
+ lark-cli mail +draft-create --to 'alice@example.com' --subject '测试' --body 'test' --dry-run
41
41
  ```
42
42
 
43
43
  ## 参数
44
44
 
45
45
  | 参数 | 必填 | 说明 |
46
46
  |------|------|------|
47
- | `--to <emails>` | 否 | 完整收件人列表,多个用逗号分隔。支持 `Alice <alice@example.com>` 格式。省略时草稿不带收件人(之后可通过 `+draft-edit` 添加) |
47
+ | `--to '<email>'` | 否 | 完整收件人列表。多个收件人请重复传 `--to`,每次只放一个地址,参数值用单引号包住。支持 `Alice <alice@example.com>` 格式。省略时草稿不带收件人(之后可通过 `+draft-edit` 添加) |
48
48
  | `--subject <text>` | 是 | 草稿主题 |
49
49
  | `--body <text>` | 二选一 | 邮件正文。推荐使用 HTML 获得富文本排版;也支持纯文本(自动检测)。使用 `--plain-text` 可强制纯文本模式。支持 `<img src="./local.png" />` 相对路径自动解析为内嵌图片(仅支持相对路径,不支持绝对路径)。与 `--body-file` 互斥 |
50
50
  | `--body-file <path>` | 二选一 | 从文件读取邮件正文 HTML(相对路径,仅限 cwd 子树)。与 `--body` 互斥。文件大小上限 32 MB |
51
51
  | `--from <email>` | 否 | 发件人邮箱地址(EML From 头)。使用别名(send_as)发信时,设为别名地址并配合 `--mailbox` 指定所属邮箱。省略时使用邮箱主地址 |
52
52
  | `--mailbox <email>` | 否 | 邮箱地址,指定草稿所属的邮箱(默认回退到 `--from`,再回退到 `me`)。当发件人(`--from`)与邮箱不同时使用,如通过别名或 send_as 地址发信。可通过 `accessible_mailboxes` 查询可用邮箱 |
53
- | `--cc <emails>` | 否 | 完整抄送列表,多个用逗号分隔 |
54
- | `--bcc <emails>` | 否 | 完整密送列表,多个用逗号分隔。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
53
+ | `--cc '<email>'` | 否 | 完整抄送列表。多个抄送请重复传 `--cc`,每次只放一个地址,参数值用单引号包住 |
54
+ | `--bcc '<email>'` | 否 | 完整密送列表。多个密送请重复传 `--bcc`,每次只放一个地址,参数值用单引号包住。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
55
55
  | `--plain-text` | 否 | 强制纯文本模式,忽略 HTML 自动检测。不可与 `--inline` 同时使用。纯文本模式下也会自动追加纯文本签名(HTML 签名经 `PlainTextFromHTML` 转换,内联图片丢弃) |
56
- | `--attach <paths>` | 否 | 附件文件路径,多个用逗号分隔。相对路径。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
57
- | `--inline <json>` | 否 | 高级用法:手动指定内嵌图片 CID 映射。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。仅在需要精确控制 CID 命名时使用此参数。格式:`'[{"cid":"mycid","file_path":"./logo.png"}]'`,在 body 中用 `<img src="cid:mycid">` 引用。不可与 `--plain-text` 同时使用 |
56
+ | `--attach '<path>'` | 否 | 附件文件路径。多个附件请重复传 `--attach`,每次只放一个相对路径,参数值用单引号包住;按传入顺序追加。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
57
+ | `--inline '<json>'` | 否 | 高级用法:手动指定内嵌图片 CID 映射。多个 inline 图片请重复传 `--inline`,每次只放一个 JSON object,并用单引号包住:`'{"cid":"mycid","file_path":"./logo.png"}'`。`file_path` 必须是相对路径;CID 应唯一,例如随机十六进制字符串;在 body 中用 `<img src="cid:mycid">` 引用。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。不可与 `--plain-text` 同时使用 |
58
58
  | `--signature-id <id>` | 否 | 签名 ID。附加邮箱签名到正文末尾。运行 `mail +signature` 查看可用签名。与 `--no-signature` 互斥 |
59
59
  | `--no-signature` | 否 | 跳过默认签名自动追加。与 `--signature-id` 互斥,同时使用时返回参数校验错误(退出码 2) |
60
60
  | `--priority <level>` | 否 | 邮件优先级:`high`、`normal`、`low`。省略或 `normal` 时不设置优先级 |
@@ -94,7 +94,7 @@ lark-cli mail +draft-create --to alice@example.com --subject '测试' --body 'te
94
94
 
95
95
  ```bash
96
96
  # 1. 创建草稿
97
- lark-cli mail +draft-create --to alice@example.com --subject 'Q1 报告' --body '请查收附件中的报告。' --attach ./q1-report.pdf --format json
97
+ lark-cli mail +draft-create --to 'alice@example.com' --subject 'Q1 报告' --body '请查收附件中的报告。' --attach './q1-report.pdf' --format json
98
98
 
99
99
  # 2. 发送草稿
100
100
  lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_id":"<draft_id>"}'
@@ -107,13 +107,13 @@ lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_
107
107
  ```bash
108
108
  # 推荐:直接使用相对路径,自动解析为内嵌图片
109
109
  lark-cli mail +draft-create \
110
- --to alice@example.com \
110
+ --to 'alice@example.com' \
111
111
  --subject '通讯稿' \
112
112
  --body '<h1>你好</h1><img src="./banner.png" />'
113
113
 
114
114
  # 高级用法:手动指定 CID(CID 为唯一标识符,可用随机十六进制字符串)
115
115
  lark-cli mail +draft-create \
116
- --to alice@example.com \
116
+ --to 'alice@example.com' \
117
117
  --subject '通讯稿' \
118
118
  --body '<h1>你好</h1><img src="cid:c7d8e9f0a1b2c3d4e5f6">' \
119
119
  --inline '[{"cid":"c7d8e9f0a1b2c3d4e5f6","file_path":"./banner.png"}]'
@@ -19,7 +19,7 @@
19
19
 
20
20
  **方式 A(推荐)** — 创建转发草稿(不带 `--confirm-send`):
21
21
  ```bash
22
- lark-cli mail +forward --message-id <邮件ID> --to <收件人>
22
+ lark-cli mail +forward --message-id <邮件ID> --to '<收件人>'
23
23
  ```
24
24
  → 返回 `draft_id`
25
25
 
@@ -38,22 +38,22 @@ lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_
38
38
 
39
39
  ```bash
40
40
  # 转发邮件(默认保存为草稿)— HTML 推荐
41
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --body '<p>FYI,请看下面原邮件。</p>'
41
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com' --body '<p>FYI,请看下面原邮件。</p>'
42
42
 
43
43
  # 转发并附加说明 + 抄送(草稿)
44
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --cc bob@example.com --body '<b>请参考</b>'
44
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com' --cc 'bob@example.com' --body '<b>请参考</b>'
45
45
 
46
46
  # 转发时插入内嵌图片(推荐:直接用相对路径,自动解析)
47
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --body '<p>详见图示:<img src="./logo.png" /></p>'
47
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com' --body '<p>详见图示:<img src="./logo.png" /></p>'
48
48
 
49
49
  # 纯文本转发(仅在内容极简时使用)
50
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com
50
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com'
51
51
 
52
52
  # 确认发送(用户明确确认后才可使用)
53
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --confirm-send
53
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com' --confirm-send
54
54
 
55
55
  # Dry Run(仅打印请求,不发送)
56
- lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --dry-run
56
+ lark-cli mail +forward --message-id <邮件ID> --to 'alice@example.com' --dry-run
57
57
  ```
58
58
 
59
59
  ## 参数
@@ -61,16 +61,16 @@ lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --dry-run
61
61
  | 参数 | 必填 | 说明 |
62
62
  |------|------|------|
63
63
  | `--message-id <id>` | 是 | 被转发的邮件 ID |
64
- | `--to <emails>` | 是 | 收件人邮箱,多个用逗号分隔 |
64
+ | `--to '<email>'` | 是 | 收件人邮箱。多个收件人请重复传 `--to`,每次只放一个地址,参数值用单引号包住 |
65
65
  | `--body <text>` | 否 | 转发时附加的说明文字。推荐使用 HTML 获得富文本排版;也支持纯文本。根据转发正文和原邮件正文自动检测 HTML。使用 `--plain-text` 可强制纯文本模式。支持 `<img src="./local.png" />` 相对路径自动解析为内嵌图片(仅支持相对路径,不支持绝对路径)。与 `--body-file` 互斥 |
66
66
  | `--body-file <path>` | 否 | 从文件读取转发说明 HTML(相对路径,仅限 cwd 子树)。与 `--body` 互斥。文件大小上限 32 MB |
67
67
  | `--from <email>` | 否 | 发件人邮箱地址(EML From 头)。使用别名(send_as)发信时,设为别名地址并配合 `--mailbox` 指定所属邮箱。默认读取邮箱主地址 |
68
68
  | `--mailbox <email>` | 否 | 邮箱地址,指定草稿所属的邮箱(默认回退到 `--from`,再回退到 `me`)。当发件人(`--from`)与邮箱不同时使用。可通过 `accessible_mailboxes` 查询可用邮箱 |
69
- | `--cc <emails>` | 否 | 抄送邮箱,多个用逗号分隔 |
70
- | `--bcc <emails>` | 否 | 密送邮箱,多个用逗号分隔。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
69
+ | `--cc '<email>'` | 否 | 抄送邮箱。多个抄送请重复传 `--cc`,每次只放一个地址,参数值用单引号包住 |
70
+ | `--bcc '<email>'` | 否 | 密送邮箱。多个密送请重复传 `--bcc`,每次只放一个地址,参数值用单引号包住。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
71
71
  | `--plain-text` | 否 | 强制纯文本模式,忽略所有 HTML 自动检测。不可与 `--inline` 同时使用。纯文本模式下也会自动追加纯文本签名(HTML 签名经 `PlainTextFromHTML` 转换,内联图片丢弃) |
72
- | `--attach <paths>` | 否 | 附件文件路径,多个用逗号分隔,追加在原邮件附件之后。相对路径。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
73
- | `--inline <json>` | 否 | 高级用法:手动指定内嵌图片 CID 映射。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。仅在需要精确控制 CID 命名时使用此参数。格式:`'[{"cid":"mycid","file_path":"./logo.png"}]'`,在 body 中用 `<img src="cid:mycid">` 引用。不可与 `--plain-text` 同时使用 |
72
+ | `--attach '<path>'` | 否 | 附件文件路径。多个附件请重复传 `--attach`,每次只放一个相对路径,参数值用单引号包住;按传入顺序追加在原邮件附件之后。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
73
+ | `--inline '<json>'` | 否 | 高级用法:手动指定内嵌图片 CID 映射。多个 inline 图片请重复传 `--inline`,每次只放一个 JSON object,并用单引号包住:`'{"cid":"mycid","file_path":"./logo.png"}'`。`file_path` 必须是相对路径;CID 应唯一,例如随机十六进制字符串;在 body 中用 `<img src="cid:mycid">` 引用。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。不可与 `--plain-text` 同时使用 |
74
74
  | `--signature-id <id>` | 否 | 签名 ID。附加邮箱签名到转发正文与引用块之间。运行 `mail +signature` 查看可用签名。与 `--no-signature` 互斥 |
75
75
  | `--no-signature` | 否 | 跳过默认签名自动追加。与 `--signature-id` 互斥,同时使用时返回参数校验错误(退出码 2) |
76
76
  | `--priority <level>` | 否 | 邮件优先级:`high`、`normal`、`low`。省略或 `normal` 时不设置优先级 |
@@ -124,14 +124,14 @@ lark-cli mail +forward --message-id <邮件ID> --to alice@example.com --dry-run
124
124
 
125
125
  ### 场景 1:用户说"把这封邮件转发给 Bob"(只创建草稿)
126
126
  ```bash
127
- lark-cli mail +forward --message-id <邮件ID> --to bob@example.com --body '<p>FYI</p>'
127
+ lark-cli mail +forward --message-id <邮件ID> --to 'bob@example.com' --body '<p>FYI</p>'
128
128
  ```
129
129
  → 返回 `draft_id`,告诉用户转发草稿已创建。
130
130
 
131
131
  ### 场景 2:用户说"转发给 Bob 并发送"(需要发送)
132
132
  ```bash
133
133
  # 方式 A: 创建转发草稿
134
- lark-cli mail +forward --message-id <邮件ID> --to bob@example.com --body '<p>FYI,请查收。</p>'
134
+ lark-cli mail +forward --message-id <邮件ID> --to 'bob@example.com' --body '<p>FYI,请查收。</p>'
135
135
  # → 返回 draft_id
136
136
 
137
137
  # 向用户确认 "收件人 bob@example.com。如果你想先看效果,也可以先去飞书邮件里查看草稿。确认发送吗?"
@@ -140,13 +140,13 @@ lark-cli mail +forward --message-id <邮件ID> --to bob@example.com --body '<p>F
140
140
  lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_id":"<draft_id>"}'
141
141
 
142
142
  # 方式 B: 用户已明确确认时,直接发送
143
- lark-cli mail +forward --message-id <邮件ID> --to bob@example.com --body '<p>FYI,请查收。</p>' --confirm-send
143
+ lark-cli mail +forward --message-id <邮件ID> --to 'bob@example.com' --body '<p>FYI,请查收。</p>' --confirm-send
144
144
  ```
145
145
 
146
146
  ### 场景 3:用户说"下午 3 点转发给 Bob"(定时发送)
147
147
  ```bash
148
148
  # Step 1: 创建转发草稿
149
- lark-cli mail +forward --message-id <邮件ID> --to bob@example.com --body '<p>FYI,请查收。</p>'
149
+ lark-cli mail +forward --message-id <邮件ID> --to 'bob@example.com' --body '<p>FYI,请查收。</p>'
150
150
  # → 返回 draft_id
151
151
 
152
152
  # Step 2: 向用户确认 "转发草稿已创建:收件人 bob@example.com,定时 <目标时间> 发送。确认吗?"
@@ -174,7 +174,7 @@ lark-cli mail +thread --thread-id <THREAD_ID> --html=false --format json
174
174
  # messages 按时间升序排列,最后一条 = messages[-1].message_id
175
175
 
176
176
  # 3. 转发该消息
177
- lark-cli mail +forward --message-id <最后一条的message_id> --to recipient@example.com --body '请过目'
177
+ lark-cli mail +forward --message-id <最后一条的message_id> --to 'recipient@example.com' --body '请过目'
178
178
  ```
179
179
 
180
180
  ## 实现说明
@@ -41,10 +41,10 @@ lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_
41
41
  lark-cli mail +reply-all --message-id <邮件ID> --body '<p><b>已完成</b>,详见下方说明。</p>'
42
42
 
43
43
  # 回复全部并追加收件人/抄送(草稿)
44
- lark-cli mail +reply-all --message-id <邮件ID> --body '<p>同步更新</p>' --to lead@example.com --cc pm@example.com
44
+ lark-cli mail +reply-all --message-id <邮件ID> --body '<p>同步更新</p>' --to 'lead@example.com' --cc 'pm@example.com'
45
45
 
46
46
  # 从回复名单中排除某些地址(草稿)
47
- lark-cli mail +reply-all --message-id <邮件ID> --body '<p>见上</p>' --remove bot@example.com,noreply@example.com
47
+ lark-cli mail +reply-all --message-id <邮件ID> --body '<p>见上</p>' --remove 'bot@example.com' --remove 'noreply@example.com'
48
48
 
49
49
  # 回复全部时插入内嵌图片(推荐:直接用相对路径,自动解析)
50
50
  lark-cli mail +reply-all --message-id <邮件ID> --body '<p>详见图示:<img src="./logo.png" /></p>'
@@ -68,13 +68,13 @@ lark-cli mail +reply-all --message-id <邮件ID> --body '测试' --dry-run
68
68
  | `--body-file <path>` | 二选一 | 从文件读取回复正文 HTML(相对路径,仅限 cwd 子树)。与 `--body` 互斥。文件大小上限 32 MB |
69
69
  | `--from <email>` | 否 | 发件人邮箱地址(EML From 头)。使用别名(send_as)发信时,设为别名地址并配合 `--mailbox` 指定所属邮箱。默认读取邮箱主地址 |
70
70
  | `--mailbox <email>` | 否 | 邮箱地址,指定草稿所属的邮箱(默认回退到 `--from`,再回退到 `me`)。当发件人(`--from`)与邮箱不同时使用。可通过 `accessible_mailboxes` 查询可用邮箱 |
71
- | `--to <emails>` | 否 | 额外收件人,多个用逗号分隔(追加到自动聚合结果) |
72
- | `--cc <emails>` | 否 | 额外抄送,多个用逗号分隔 |
73
- | `--bcc <emails>` | 否 | 密送邮箱,多个用逗号分隔。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
74
- | `--remove <emails>` | 否 | 从自动聚合结果中排除的邮箱,多个用逗号分隔 |
71
+ | `--to '<email>'` | 否 | 额外收件人。多个额外收件人请重复传 `--to`,每次只放一个地址,参数值用单引号包住;追加到自动聚合结果 |
72
+ | `--cc '<email>'` | 否 | 额外抄送。多个抄送请重复传 `--cc`,每次只放一个地址,参数值用单引号包住 |
73
+ | `--bcc '<email>'` | 否 | 密送邮箱。多个密送请重复传 `--bcc`,每次只放一个地址,参数值用单引号包住。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
74
+ | `--remove '<email>'` | 否 | 从自动聚合结果中排除的邮箱。多个排除地址请重复传 `--remove`,每次只放一个地址,参数值用单引号包住;按传入顺序处理 |
75
75
  | `--plain-text` | 否 | 强制纯文本模式,忽略所有 HTML 自动检测。不可与 `--inline` 同时使用。纯文本模式下也会自动追加纯文本签名(HTML 签名经 `PlainTextFromHTML` 转换,内联图片丢弃) |
76
- | `--attach <paths>` | 否 | 附件文件路径,多个用逗号分隔。相对路径。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
77
- | `--inline <json>` | 否 | 高级用法:手动指定内嵌图片 CID 映射。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。仅在需要精确控制 CID 命名时使用此参数。格式:`'[{"cid":"mycid","file_path":"./logo.png"}]'`,在 body 中用 `<img src="cid:mycid">` 引用。不可与 `--plain-text` 同时使用 |
76
+ | `--attach '<path>'` | 否 | 附件文件路径。多个附件请重复传 `--attach`,每次只放一个相对路径,参数值用单引号包住;按传入顺序追加。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
77
+ | `--inline '<json>'` | 否 | 高级用法:手动指定内嵌图片 CID 映射。多个 inline 图片请重复传 `--inline`,每次只放一个 JSON object,并用单引号包住:`'{"cid":"mycid","file_path":"./logo.png"}'`。`file_path` 必须是相对路径;CID 应唯一,例如随机十六进制字符串;在 body 中用 `<img src="cid:mycid">` 引用。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。不可与 `--plain-text` 同时使用 |
78
78
  | `--signature-id <id>` | 否 | 签名 ID。附加邮箱签名到回复正文与引用块之间。运行 `mail +signature` 查看可用签名。与 `--no-signature` 互斥 |
79
79
  | `--no-signature` | 否 | 跳过默认签名自动追加。与 `--signature-id` 互斥,同时使用时返回参数校验错误(退出码 2) |
80
80
  | `--priority <level>` | 否 | 邮件优先级:`high`、`normal`、`low`。省略或 `normal` 时不设置优先级 |
@@ -45,7 +45,7 @@ lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"me","draft_
45
45
  lark-cli mail +reply --message-id <邮件ID> --body '<p><b>已收到</b>,稍后跟进。</p>'
46
46
 
47
47
  # 回复并追加收件人/抄送(保存为草稿)
48
- lark-cli mail +reply --message-id <邮件ID> --body '<p>已处理</p>' --to lead@example.com --cc colleague@example.com
48
+ lark-cli mail +reply --message-id <邮件ID> --body '<p>已处理</p>' --to 'lead@example.com' --cc 'colleague@example.com'
49
49
 
50
50
  # 回复时插入内嵌图片(推荐:直接用相对路径,自动解析)
51
51
  lark-cli mail +reply --message-id <邮件ID> --body '<p>详见图示:<img src="./logo.png" /></p>'
@@ -72,12 +72,12 @@ lark-cli mail +reply --message-id <邮件ID> --body '<p>测试</p>' --dry-run
72
72
  | `--body-file <path>` | 二选一 | 从文件读取回复正文 HTML(相对路径,仅限 cwd 子树)。与 `--body` 互斥。文件大小上限 32 MB |
73
73
  | `--from <email>` | 否 | 发件人邮箱地址(EML From 头)。使用别名(send_as)发信时,设为别名地址并配合 `--mailbox` 指定所属邮箱。默认读取邮箱主地址 |
74
74
  | `--mailbox <email>` | 否 | 邮箱地址,指定草稿所属的邮箱(默认回退到 `--from`,再回退到 `me`)。当发件人(`--from`)与邮箱不同时使用。可通过 `accessible_mailboxes` 查询可用邮箱 |
75
- | `--to <emails>` | 否 | 额外收件人,多个用逗号分隔(追加到原发件人) |
76
- | `--cc <emails>` | 否 | 抄送邮箱,多个用逗号分隔 |
77
- | `--bcc <emails>` | 否 | 密送邮箱,多个用逗号分隔。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
75
+ | `--to '<email>'` | 否 | 额外收件人。多个额外收件人请重复传 `--to`,每次只放一个地址,参数值用单引号包住;追加到原发件人 |
76
+ | `--cc '<email>'` | 否 | 抄送邮箱。多个抄送请重复传 `--cc`,每次只放一个地址,参数值用单引号包住 |
77
+ | `--bcc '<email>'` | 否 | 密送邮箱。多个密送请重复传 `--bcc`,每次只放一个地址,参数值用单引号包住。与 `--event-*` 不兼容(见 `+send` 日程邀请约束) |
78
78
  | `--plain-text` | 否 | 强制纯文本模式,忽略所有 HTML 自动检测。不可与 `--inline` 同时使用。纯文本模式下也会自动追加纯文本签名(HTML 签名经 `PlainTextFromHTML` 转换,内联图片丢弃) |
79
- | `--attach <paths>` | 否 | 附件文件路径,多个用逗号分隔。相对路径。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
80
- | `--inline <json>` | 否 | 高级用法:手动指定内嵌图片 CID 映射。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。仅在需要精确控制 CID 命名时使用此参数。格式:`'[{"cid":"mycid","file_path":"./logo.png"}]'`,在 body 中用 `<img src="cid:mycid">` 引用。不可与 `--plain-text` 同时使用 |
79
+ | `--attach '<path>'` | 否 | 附件文件路径。多个附件请重复传 `--attach`,每次只放一个相对路径,参数值用单引号包住;按传入顺序追加。当附件导致 EML 总大小超过 25 MB 时,超出部分自动上传为超大附件(HTML 邮件插入下载卡片,纯文本邮件追加下载链接),单个文件上限 3 GB |
80
+ | `--inline '<json>'` | 否 | 高级用法:手动指定内嵌图片 CID 映射。多个 inline 图片请重复传 `--inline`,每次只放一个 JSON object,并用单引号包住:`'{"cid":"mycid","file_path":"./logo.png"}'`。`file_path` 必须是相对路径;CID 应唯一,例如随机十六进制字符串;在 body 中用 `<img src="cid:mycid">` 引用。推荐直接在 `--body` 中使用 `<img src="./path" />`(自动解析)。不可与 `--plain-text` 同时使用 |
81
81
  | `--signature-id <id>` | 否 | 签名 ID。附加邮箱签名到回复正文与引用块之间。运行 `mail +signature` 查看可用签名。与 `--no-signature` 互斥 |
82
82
  | `--no-signature` | 否 | 跳过默认签名自动追加。与 `--signature-id` 互斥,同时使用时返回参数校验错误(退出码 2) |
83
83
  | `--priority <level>` | 否 | 邮件优先级:`high`、`normal`、`low`。省略或 `normal` 时不设置优先级 |