Loading...
Loading...
Compare original and translation side by side
../lark-shared/SKILL.md../lark-shared/SKILL.md--as user--as userlark-cli auth login --domain slides--as bot--as user--as bot--as user--as userlark-cli auth login --domain slides--as bot--as user--as botlark-cli slides +create --title "演示文稿标题" --slides '[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><style><fill><fillColor color=\"rgb(245,245,245)\"/></fill></style><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"100\"><content textType=\"title\"><p>页面标题</p></content></shape><shape type=\"text\" topLeftX=\"80\" topLeftY=\"200\" width=\"800\" height=\"200\"><content textType=\"body\"><p>正文内容</p><ul><li><p>要点一</p></li><li><p>要点二</p></li></ul></content></shape></data></slide>"
]'以上是最小可用示例。更丰富的页面效果(渐变背景、卡片、图表、表格等),参考下方 Workflow 和 XML 模板。
lark-cli slides +create --title "Presentation Title" --slides '[
"<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><style><fill><fillColor color=\"rgb(245,245,245)\"/></fill></style><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"100\"><content textType=\"title\"><p>Page Title</p></content></shape><shape type=\"text\" topLeftX=\"80\" topLeftY=\"200\" width=\"800\" height=\"200\"><content textType=\"body\"><p>Body Content</p><ul><li><p>Key Point 1</p></li><li><p>Key Point 2</p></li></ul></content></shape></data></slide>"
]'The above is the minimum usable example. For richer page effects (gradient background, cards, charts, tables, etc.), refer to the Workflow and XML templates below.
重要:是此 skill 唯一正确的 XML 协议来源;其他 md 仅是对它和 CLI schema 的摘要。references/slides_xml_schema_definition.xml
Important:is the only correct source of XML protocol for this skill; other md files are only summaries of it and the CLI schema.references/slides_xml_schema_definition.xml
| 文档 | 说明 |
|---|---|
| xml-schema-quick-ref.md | XML 元素和属性速查,必读 |
| Document | Description |
|---|---|
| xml-schema-quick-ref.md | XML element and attribute quick reference, mandatory reading |
| 场景 | 文档 |
|---|---|
| 需要了解详细 XML 结构 | xml-format-guide.md |
| 需要 CLI 调用示例 | examples.md |
| 需要参考真实 PPT 的 XML | slides_demo.xml |
| 需要用 table/chart 等复杂元素 | slides_xml_schema_definition.xml(完整 Schema) |
| 需要了解某个命令的详细参数 | 对应命令的 reference 文档(见下方参考文档章节) |
| Scenario | Document |
|---|---|
| Need to understand detailed XML structure | xml-format-guide.md |
| Need CLI call examples | examples.md |
| Need to refer to XML of real PPT | slides_demo.xml |
| Need to use complex elements such as table/chart | slides_xml_schema_definition.xml (complete Schema) |
| Need to understand detailed parameters of a command | Reference document for the corresponding command (see the reference document section below) |
这是演示文稿,不是文档。 每页 slide 是独立的视觉画面,信息密度要低,排版要留白。
Step 1: 需求澄清 & 读取知识
- 澄清用户需求:主题、受众、页数、风格偏好
- 如果用户没有明确风格,根据主题推荐(见下方风格判断表)
- 读取 XML Schema 参考:
· xml-schema-quick-ref.md — 元素和属性速查
· xml-format-guide.md — 详细结构与示例
· slides_demo.xml — 真实 XML 示例
Step 2: 生成大纲 → 用户确认 → 创建
- 生成结构化大纲(每页标题 + 要点 + 布局描述),交给用户确认
- 10 页以内:用 slides +create --slides '[...]' 一步创建 PPT 并添加所有页面
- 超过 10 页:先 `slides +create` 创建空白 PPT,再用 `xml_presentation.slide.create` 逐页添加
- 每页 slide 需要完整的 XML:背景、文本、图形、配色
- 复杂元素(table、chart)需参考 XSD 原文
Step 3: 审查 & 交付
- 创建完成后,用 xml_presentations.get 读取全文 XML,确认:
· 页数是否正确?每页内容是否完整?
· 配色是否统一?字号层级是否合理?
- 有问题 → 用 xml_presentation.slide.delete 删除问题页,重新创建
- 没问题 → 交付:告知用户演示文稿 ID 和访问方式This is a presentation, not a document. Each slide is an independent visual page, with low information density and sufficient white space in typesetting.
Step 1: Requirement clarification & knowledge reading
- Clarify user requirements: theme, audience, number of pages, style preference
- If the user has no clear style, recommend according to the theme (see the style judgment table below)
- Read XML Schema reference:
· xml-schema-quick-ref.md — Element and attribute quick reference
· xml-format-guide.md — Detailed structure and examples
· slides_demo.xml — Real XML example
Step 2: Generate outline → user confirmation → creation
- Generate a structured outline (title per page + key points + layout description), submit to the user for confirmation
- Less than 10 pages: Use slides +create --slides '[...]' to create PPT and add all pages in one step
- More than 10 pages: First use `slides +create` to create a blank PPT, then use `xml_presentation.slide.create` to add pages one by one
- Each slide requires complete XML: background, text, graphics, color scheme
- Complex elements (table, chart) need to refer to the original XSD
Step 3: Review & delivery
- After creation, use xml_presentations.get to read the full text XML, confirm:
· Is the number of pages correct? Is the content of each page complete?
· Is the color scheme unified? Is the font size hierarchy reasonable?
- If there is a problem → Use xml_presentation.slide.delete to delete the problematic page and recreate it
- No problem → Delivery: Inform the user of the presentation ID and access method+create --slideslark-cli slides xml_presentation.slide create \
--as user \
--params '{"xml_presentation_id":"YOUR_ID"}' \
--data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
<style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
<data>
在这里放置 shape、line、table、chart 等元素
</data>
</slide>' '{slide:{content:$content}}')"+create --slideslark-cli slides xml_presentation.slide create \
--as user \
--params '{"xml_presentation_id":"YOUR_ID"}' \
--data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
<style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
<data>
Place elements such as shape, line, table, chart here
</data>
</slide>' '{slide:{content:$content}}')"注意:渐变色必须使用格式并带百分比停靠点,如rgba()。使用linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)或省略停靠点会导致服务端回退为白色。rgb()
| 场景/主题 | 推荐风格 | 背景 | 主色 | 文字色 |
|---|---|---|---|---|
| 科技/AI/产品 | 深色科技风 | 深蓝渐变 | 蓝色系 | 白色 |
| 商务汇报/季度总结 | 浅色商务风 | 浅灰 | 深蓝 | 深灰 |
| 教育/培训 | 清新明亮风 | 白色 | 绿色系 | 深灰 |
| 创意/设计 | 渐变活力风 | 紫粉渐变 | 粉紫色系 | 白色 |
| 周报/日常汇报 | 简约专业风 | 浅灰 | 蓝色 | 深色 |
| 用户未指定 | 默认简约专业风 | 同上 | 同上 | 同上 |
Note: Gradient colors must useformat with percentage stop points, such asrgba(). Usinglinear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)or omitting stop points will cause the server to fall back to white.rgb()
| Scenario/Theme | Recommended Style | Background | Primary Color | Text Color |
|---|---|---|---|---|
| Technology/AI/Product | Dark technology style | Dark blue gradient | Blue series | White |
| Business report/Quarterly summary | Light business style | Light gray | Dark blue | Dark gray |
| Education/Training | Fresh and bright style | White | Green series | Dark gray |
| Creative/Design | Gradient dynamic style | Purple-pink gradient | Pink-purple series | White |
| Weekly report/Daily report | Simple professional style | Light gray | Blue | Dark color |
| User not specified | Default simple professional style | Same as above | Same as above | Same as above |
| 页面类型 | 布局要点 |
|---|---|
| 封面页 | 居中大标题 + 副标题 + 底部信息,背景用渐变或深色 |
| 数据概览页 | 指标卡片横排(rect 背景 + 大号数字 + 小号说明),下方列表或图表 |
| 内容页 | 左侧竖线装饰 + 标题,下方分栏或列表 |
| 对比/表格页 | table 元素或并列卡片,表头深色背景白字 |
| 图表页 | chart 元素(column/line/pie),配合文字说明 |
| 结尾页 | 居中感谢语 + 装饰线,风格与封面呼应 |
| Page Type | Layout Key Points |
|---|---|
| Cover page | Centered large title + subtitle + bottom information, use gradient or dark background |
| Data overview page | Indicator cards arranged horizontally (rect background + large number + small description), list or chart below |
| Content page | Left vertical line decoration + title, columns or list below |
| Comparison/Table page | table element or side-by-side cards, dark background with white text for table header |
| Chart page | chart element (column/line/pie), with text description |
| Closing page | Centered thank you message + decorative line, style echoes the cover page |
[PPT 标题] — [定位描述],面向 [目标受众]
页面结构(N 页):
1. 封面页:[标题文案]
2. [页面主题]:[要点1]、[要点2]、[要点3]
3. [页面主题]:[要点描述]
...
N. 结尾页:[结尾文案]
风格:[配色方案],[排版风格][PPT Title] — [Positioning Description], for [Target Audience]
Page Structure (N pages):
1. Cover page: [Title copy]
2. [Page theme]: [Key point 1], [Key point 2], [Key point 3]
3. [Page theme]: [Key point description]
...
N. Closing page: [Closing copy]
Style: [Color scheme], [Typesetting style]| URL 格式 | 示例 | Token 类型 | 处理方式 |
|---|---|---|---|
| | | URL 路径中的 token 直接作为 |
| | | ⚠️ 不能直接使用,需要先查询获取真实的 |
| URL Format | Example | Token Type | Processing Method |
|---|---|---|---|
| | | The token in the URL path is directly used as |
| | | ⚠️ Cannot be used directly, you need to query first to get the real |
/wiki/TOKENxml_presentation_id/wiki/TOKENxml_presentation_idwiki.spaces.get_nodelark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'node.obj_typeslidesnode.obj_tokennode.titleobj_typeslidesobj_tokenxml_presentation_idwiki.spaces.get_nodelark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'node.obj_typeslidesnode.obj_tokennode.titleobj_typeslidesobj_tokenxml_presentation_idundefinedundefined
返回结果示例:
```json
{
"node": {
"obj_type": "slides",
"obj_token": "xxxxxxxxxxxx",
"title": "2026 产品年度总结",
"node_type": "origin",
"space_id": "1234567890"
}
}undefined
Return result example:
```json
{
"node": {
"obj_type": "slides",
"obj_token": "xxxxxxxxxxxx",
"title": "2026 Product Annual Summary",
"node_type": "origin",
"space_id": "1234567890"
}
}undefinedundefinedundefinedWiki Space (知识空间)
└── Wiki Node (知识库节点, obj_type: slides)
└── obj_token → xml_presentation_id
Slides (演示文稿)
├── xml_presentation_id (演示文稿唯一标识)
├── revision_id (版本号)
└── Slide (幻灯片页面)
└── slide_id (页面唯一标识)Wiki Space
└── Wiki Node (obj_type: slides)
└── obj_token → xml_presentation_id
Slides (Presentation)
├── xml_presentation_id (Unique identifier of presentation)
├── revision_id (Version number)
└── Slide (Presentation page)
└── slide_id (Unique identifier of page)lark-cli slides +<verb> [flags]| Shortcut | 说明 |
|---|---|
| 创建 PPT(可选 |
lark-cli slides +<verb> [flags]| Shortcut | Description |
|---|---|
| Create PPT (optional |
lark-cli schema slides.<resource>.<method> # 调用 API 前必须先查看参数结构
lark-cli slides <resource> <method> [flags] # 调用 API重要:使用原生 API 时,必须先运行查看schema/--data参数结构,不要猜测字段格式。--params
lark-cli schema slides.<resource>.<method> # Must check parameter structure before calling API
lark-cli slides <resource> <method> [flags] # Call APIImportant: When using native API, you must first runto view theschema/--dataparameter structure, do not guess the field format.--params
getgetcreatedeletecreatedeleteslides +create --slides '[...]'slides +createxml_presentation.slide.create<slide><style><data><note><data><content><content><p>...</p></content>xml_presentation_idslide_idrevision_idslides +create --slides '[...]'slides +createxml_presentation.slide.create<style><data><note><slide><data><content><content><p>...</p></content>xml_presentation_idslide_idrevision_id| 方法 | 所需 scope |
|---|---|
| |
| |
| |
| |
| Method | Required scope |
|---|---|
| |
| |
| |
| |
| 错误码 | 含义 | 解决方案 |
|---|---|---|
| 400 | XML 格式错误 | 检查 XML 语法,确保标签闭合 |
| 400 | create 内容超出支持范围 | |
| 400 | 请求包装错误 | 检查 |
| 404 | 演示文稿不存在 | 检查 |
| 404 | 幻灯片不存在 | 检查 |
| 403 | 权限不足 | 检查是否拥有对应的 scope |
| 400 | 无法删除唯一幻灯片 | 演示文稿至少保留一页幻灯片 |
| Error Code | Meaning | Solution |
|---|---|---|
| 400 | XML format error | Check XML syntax to ensure tags are closed |
| 400 | create content exceeds supported range | |
| 400 | Request packaging error | Check whether |
| 404 | Presentation does not exist | Check whether |
| 404 | Slide does not exist | Check whether |
| 403 | Insufficient permission | Check whether you have the corresponding scope |
| 400 | Cannot delete the only slide | At least one slide must be retained in the presentation |
typetextrect&<>typetextrect&<>| 看到的问题 | 改什么 |
|---|---|
| 文字被截断/看不全 | 增大 shape 的 |
| 元素重叠 | 调整 |
| 页面大面积空白 | 缩小元素间距,或增加内容填充 |
| 文字和背景色太接近 | 深色背景用浅色文字,浅色背景用深色文字 |
| 表格列宽不合理 | 调整 |
| 图表没有显示 | 检查 |
| 渐变背景变成白色 | 渐变必须用 |
| 渐变方向不对 | 调整 |
| 整体风格不统一 | 封面页和结尾页用同一背景,内容页保持一致的配色和字号体系 |
| API 返回 400 | 检查 XML 语法:标签闭合、属性引号、特殊字符转义 |
| API 返回 3350001 | |
| Observed Problem | What to Fix |
|---|---|
| Text is truncated/not fully visible | Increase the |
| Elements overlap | Adjust |
| Large blank area on the page | Reduce element spacing, or add content to fill |
| Text color is too close to background color | Use light text on dark background, dark text on light background |
| Unreasonable table column width | Adjust the |
| Chart is not displayed | Check whether both |
| Gradient background turns white | Gradient must use |
| Wrong gradient direction | Adjust the angle of |
| Overall style is not unified | Use the same background for cover page and closing page, maintain consistent color scheme and font size system for content pages |
| API returns 400 | Check XML syntax: tag closure, attribute quotes, special character escaping |
| API returns 3350001 | |
| 文档 | 说明 |
|---|---|
| lark-slides-create.md | +create Shortcut:创建 PPT(支持 |
| xml-schema-quick-ref.md | XML Schema 精简速查(必读) |
| slide-templates.md | 可复制的 Slide XML 模板 |
| xml-format-guide.md | XML 详细结构与示例 |
| examples.md | CLI 调用示例 |
| slides_demo.xml | 真实 PPT 的完整 XML |
| slides_xml_schema_definition.xml | 完整 Schema 定义(唯一协议依据) |
| lark-slides-xml-presentations-create.md | 创建空白 PPT 命令详情 |
| lark-slides-xml-presentations-get.md | 读取 PPT 命令详情 |
| lark-slides-xml-presentation-slide-create.md | 添加幻灯片命令详情 |
| lark-slides-xml-presentation-slide-delete.md | 删除幻灯片命令详情 |
注意:如果 md 内容与或slides_xml_schema_definition.xml输出不一致,以后两者为准。lark-cli schema slides.<resource>.<method>
| Document | Description |
|---|---|
| lark-slides-create.md | +create Shortcut: Create PPT (supports |
| xml-schema-quick-ref.md | XML Schema simplified quick reference (mandatory reading) |
| slide-templates.md | Copyable Slide XML templates |
| xml-format-guide.md | Detailed XML structure and examples |
| examples.md | CLI call examples |
| slides_demo.xml | Complete XML of real PPT |
| slides_xml_schema_definition.xml | Complete Schema definition (only protocol basis) |
| lark-slides-xml-presentations-create.md | Details of command to create blank PPT |
| lark-slides-xml-presentations-get.md | Details of command to read PPT |
| lark-slides-xml-presentation-slide-create.md | Details of command to add slides |
| lark-slides-xml-presentation-slide-delete.md | Details of command to delete slides |
Note: If the content of md files is inconsistent with the output oforslides_xml_schema_definition.xml, the latter two shall prevail.lark-cli schema slides.<resource>.<method>