Skip to content

Commit a173b29

Browse files
committed
feat(slides): add image upload via +media-upload and @path placeholders in +create
- New `slides +media-upload` shortcut: upload a local image to a slides presentation and return the file_token for use in <img src="...">. - `slides +create --slides` now supports `@./path.png` placeholders that are auto-uploaded and replaced with file_tokens. - Reject images >20 MB (multipart upload not supported for slide_file). - Support wiki URL resolution for --presentation flag.
1 parent fe41234 commit a173b29

64 files changed

Lines changed: 1800 additions & 4937 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cli-e2e.yml

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ on:
2525

2626
permissions:
2727
contents: read
28-
actions: read
29-
checks: write
3028

3129
jobs:
3230
cli-e2e:
@@ -67,17 +65,71 @@ jobs:
6765
echo "No CLI E2E packages to test after exclusions."
6866
exit 1
6967
fi
70-
# gotestsum requires --packages when --rerun-fails is combined with go test args after --.
71-
packages_arg=$(printf '%s\n' "$packages" | paste -sd' ' -)
72-
go run gotest.tools/gotestsum@v1.12.3 --rerun-fails=2 --rerun-fails-max-failures=20 --packages="$packages_arg" --format testname --junitfile cli-e2e-report.xml -- -count=1 -v
68+
go run gotest.tools/gotestsum@v1.12.3 --format testname --junitfile cli-e2e-report.xml -- -count=1 -v $packages
7369
74-
- name: Publish CLI E2E test report
70+
- name: Summarize CLI E2E test report
7571
if: ${{ !cancelled() }}
76-
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
77-
with:
78-
name: CLI E2E Tests
79-
path: cli-e2e-report.xml
80-
reporter: java-junit
81-
use-actions-summary: true
82-
list-suites: all
83-
list-tests: all
72+
run: |
73+
python3 - <<'PY'
74+
import os
75+
import xml.etree.ElementTree as ET
76+
77+
report_path = "cli-e2e-report.xml"
78+
summary_path = os.environ["GITHUB_STEP_SUMMARY"]
79+
80+
root = ET.parse(report_path).getroot()
81+
suites = [root] if root.tag == "testsuite" else root.findall("testsuite")
82+
83+
tests = failures = errors = skipped = 0
84+
failed_cases = []
85+
skipped_cases = []
86+
87+
for suite in suites:
88+
tests += int(suite.attrib.get("tests", 0))
89+
failures += int(suite.attrib.get("failures", 0))
90+
errors += int(suite.attrib.get("errors", 0))
91+
skipped += int(suite.attrib.get("skipped", 0))
92+
93+
for case in suite.findall("testcase"):
94+
classname = case.attrib.get("classname", "")
95+
name = case.attrib.get("name", "")
96+
label = f"{classname}.{name}" if classname else name
97+
98+
failure = case.find("failure")
99+
error = case.find("error")
100+
skipped_node = case.find("skipped")
101+
102+
if failure is not None or error is not None:
103+
message = ""
104+
node = failure if failure is not None else error
105+
if node is not None:
106+
message = node.attrib.get("message", "") or (node.text or "").strip()
107+
failed_cases.append((label, message))
108+
elif skipped_node is not None:
109+
message = skipped_node.attrib.get("message", "") or (skipped_node.text or "").strip()
110+
skipped_cases.append((label, message))
111+
112+
passed = tests - failures - errors - skipped
113+
114+
with open(summary_path, "a", encoding="utf-8") as f:
115+
f.write("## CLI E2E Test Report\n\n")
116+
f.write(f"- Total: {tests}\n")
117+
f.write(f"- Passed: {passed}\n")
118+
f.write(f"- Failed: {failures}\n")
119+
f.write(f"- Errors: {errors}\n")
120+
f.write(f"- Skipped: {skipped}\n\n")
121+
122+
if failed_cases:
123+
f.write("### Failed Tests\n\n")
124+
for label, message in failed_cases:
125+
detail = f" - {message}" if message else ""
126+
f.write(f"- `{label}`{detail}\n")
127+
f.write("\n")
128+
129+
if skipped_cases:
130+
f.write("### Skipped Tests\n\n")
131+
for label, message in skipped_cases:
132+
detail = f" - {message}" if message else ""
133+
f.write(f"- `{label}`{detail}\n")
134+
f.write("\n")
135+
PY

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ tests/mail/reports/
3535
# Generated / test artifacts
3636
internal/registry/meta_data.json
3737
cmd/api/download.bin
38-
app.log

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,11 @@ Bundled AI agent skills for intelligent assistance:
345345
- Bilingual documentation (English & Chinese).
346346
- CI/CD pipelines: linting, testing, coverage reporting, and automated releases.
347347

348+
<<<<<<< HEAD
348349
[v1.0.11]: https://github.com/larksuite/cli/releases/tag/v1.0.11
349350
[v1.0.10]: https://github.com/larksuite/cli/releases/tag/v1.0.10
351+
=======
352+
>>>>>>> 053b1e4 (feat(slides): add image upload via +media-upload and @path placeholders in +create)
350353
[v1.0.9]: https://github.com/larksuite/cli/releases/tag/v1.0.9
351354
[v1.0.8]: https://github.com/larksuite/cli/releases/tag/v1.0.8
352355
[v1.0.7]: https://github.com/larksuite/cli/releases/tag/v1.0.7

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
[中文版](./README.zh.md) | [English](./README.md)
88

9-
The official [Lark/Feishu](https://www.larksuite.com/) CLI tool, maintained by the [larksuite](https://github.com/larksuite) team — built for humans and AI Agents. Covers core business domains including Messenger, Docs, Base, Sheets, Slides, Calendar, Mail, Tasks, Meetings, and more, with 200+ commands and 22 AI Agent [Skills](./skills/).
9+
The official [Lark/Feishu](https://www.larksuite.com/) CLI tool, maintained by the [larksuite](https://github.com/larksuite) team — built for humans and AI Agents. Covers core business domains including Messenger, Docs, Base, Sheets, Slides, Calendar, Mail, Tasks, Meetings, and more, with 200+ commands and 21 AI Agent [Skills](./skills/).
1010

1111
[Install](#installation--quick-start) · [AI Agent Skills](#agent-skills) · [Auth](#authentication) · [Commands](#three-layer-command-system) · [Advanced](#advanced-usage) · [Security](#security--risk-warnings-read-before-use) · [Contributing](#contributing)
1212

1313
## Why lark-cli?
1414

15-
- **Agent-Native Design**22 structured [Skills](./skills/) out of the box, compatible with popular AI tools — Agents can operate Lark with zero extra setup
16-
- **Wide Coverage**14 business domains, 200+ curated commands, 22 AI Agent [Skills](./skills/)
15+
- **Agent-Native Design**21 structured [Skills](./skills/) out of the box, compatible with popular AI tools — Agents can operate Lark with zero extra setup
16+
- **Wide Coverage**13 business domains, 200+ curated commands, 21 AI Agent [Skills](./skills/)
1717
- **AI-Friendly & Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output to maximize Agent call success rates
1818
- **Open Source, Zero Barriers** — MIT license, ready to use, just `npm install`
1919
- **Up and Running in 3 Minutes** — One-click app creation, interactive login, from install to first API call in just 3 steps
@@ -36,7 +36,6 @@ The official [Lark/Feishu](https://www.larksuite.com/) CLI tool, maintained by t
3636
| 👤 Contact | Search users by name/email/phone, get user profiles |
3737
| 📧 Mail | Browse, search, read emails, send, reply, forward, manage drafts, watch new mail |
3838
| 🎥 Meetings | Search meeting records, query meeting minutes & recordings |
39-
| 🕐 Attendance | Query personal attendance check-in records |
4039
| ✍️ Approval | Query approval tasks, approve/reject/transfer tasks, cancel and CC instances |
4140

4241
## Installation & Quick Start
@@ -150,7 +149,6 @@ lark-cli auth status
150149
| `lark-minutes` | Minutes metadata & AI artifacts (summary, todos, chapters) |
151150
| `lark-openapi-explorer` | Explore underlying APIs from official docs |
152151
| `lark-skill-maker` | Custom skill creation framework |
153-
| `lark-attendance` | Query personal attendance check-in records |
154152
| `lark-approval` | Query approval tasks, approve/reject/transfer tasks, cancel and CC instances |
155153
| `lark-workflow-meeting-summary` | Workflow: meeting minutes aggregation & structured report |
156154
| `lark-workflow-standup-report` | Workflow: agenda & todo summary |

README.zh.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
[中文版](./README.zh.md) | [English](./README.md)
88

9-
飞书官方 CLI 工具,由 [larksuite](https://github.com/larksuite) 团队维护 — 让人类和 AI Agent 都能在终端中操作飞书。覆盖消息、文档、多维表格、电子表格、幻灯片、日历、邮箱、任务、会议等核心业务域,提供 200+ 命令及 22 个 AI Agent [Skills](./skills/)
9+
飞书官方 CLI 工具,由 [larksuite](https://github.com/larksuite) 团队维护 — 让人类和 AI Agent 都能在终端中操作飞书。覆盖消息、文档、多维表格、电子表格、幻灯片、日历、邮箱、任务、会议等核心业务域,提供 200+ 命令及 21 个 AI Agent [Skills](./skills/)
1010

1111
[安装](#安装与快速开始) · [AI Agent Skills](#agent-skills) · [认证](#认证) · [命令](#三层命令调用) · [进阶用法](#进阶用法) · [安全](#安全与风险提示使用前必读) · [贡献](#贡献)
1212

1313
## 为什么选 lark-cli?
1414

15-
- **为 Agent 原生设计**22[Skills](./skills/) 开箱即用,适配主流 AI 工具,Agent 无需额外适配即可操作飞书
16-
- **覆盖面广**14 大业务域、200+ 精选命令、22 个 AI Agent [Skills](./skills/)
15+
- **为 Agent 原生设计**21[Skills](./skills/) 开箱即用,适配主流 AI 工具,Agent 无需额外适配即可操作飞书
16+
- **覆盖面广**13 大业务域、200+ 精选命令、21 个 AI Agent [Skills](./skills/)
1717
- **AI 友好调优** — 每条命令经过 Agent 实测验证,提供更友好的参数、智能默认值和结构化输出,大幅提升 Agent 调用成功率
1818
- **开源零门槛** — MIT 协议,开箱即用,`npm install` 即可使用
1919
- **三分钟上手** — 一键创建应用、交互式登录授权,从安装到第一次 API 调用只需三步
@@ -36,7 +36,6 @@
3636
| 👤 通讯录 | 按姓名/邮箱/手机号搜索用户、获取用户信息 |
3737
| 📧 邮箱 | 浏览、搜索、阅读邮件,发送、回复、转发邮件,管理草稿,监听新邮件 |
3838
| 🎥 视频会议 | 搜索会议记录、查询会议纪要与录制 |
39-
| 🕐 考勤打卡 | 查询个人考勤打卡记录 |
4039
| ✍️ 审批 | 查询审批任务、同意/拒绝/转交审批任务、撤回与抄送审批实例 |
4140

4241
## 安装与快速开始
@@ -151,7 +150,6 @@ lark-cli auth status
151150
| `lark-minutes` | 妙记元数据与 AI 产物(总结、待办、章节) |
152151
| `lark-openapi-explorer` | 从官方文档探索底层 API |
153152
| `lark-skill-maker` | 自定义 skill 创建框架 |
154-
| `lark-attendance` | 查询个人考勤打卡记录 |
155153
| `lark-approval` | 审批任务查询、同意/拒绝/转交审批任务、撤回与抄送审批实例 |
156154
| `lark-workflow-meeting-summary` | 工作流:会议纪要汇总与结构化报告 |
157155
| `lark-workflow-standup-report` | 工作流:日程待办摘要 |

cmd/auth/login_interactive.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,27 @@ func runInteractiveLogin(ios *cmdutil.IOStreams, lang string, msg *loginMsg) (*i
184184
}
185185
fmt.Fprintf(ios.ErrOut, msg.SummaryScopes, len(scopes), scopePreview)
186186

187+
// Phase 2: confirmation
188+
var confirmed bool
189+
form2 := huh.NewForm(
190+
huh.NewGroup(
191+
huh.NewConfirm().
192+
Title(msg.ConfirmAuth).
193+
Value(&confirmed),
194+
),
195+
).WithTheme(cmdutil.ThemeFeishu())
196+
197+
if err := form2.Run(); err != nil {
198+
if err == huh.ErrUserAborted {
199+
return nil, output.ErrBare(1)
200+
}
201+
return nil, err
202+
}
203+
204+
if !confirmed {
205+
return nil, output.ErrBare(1)
206+
}
207+
187208
return &interactiveResult{
188209
Domains: selectedDomains,
189210
ScopeLevel: permLevel,

shortcuts/event/subscribe.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ var commonEventTypes = []string{
7474
"approval.approval.updated",
7575
"application.application.visibility.added_v6",
7676
"task.task.update_tenant_v1",
77-
"task.task.update_user_access_v2",
7877
"task.task.comment_updated_v1",
7978
"drive.notice.comment_add_v1",
8079
}

0 commit comments

Comments
 (0)