返回顶部
f

feishu-cli-board飞书剪贴板

>-

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
178
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

feishu-cli-board

飞书画板操作技能

前置条件

  • - 认证:需要有效的 App Access Token(环境变量 FEISHUAPPID + FEISHUAPPSECRET,或 ~/.feishu-cli/config.yaml)
  • 权限:应用需开通 board:whiteboard(画板读写)和 docx:document(文档中添加画板)
  • 验证:feishu-cli auth status 确认认证状态正常

两种模式

在飞书文档中创建画板并绘制可视化图表。支持两种模式:

模式方式适用场景
精排绘图board create-notes — JSON 描述节点坐标、颜色、连线架构图、看板、自定义布局
图表导入
board import — Mermaid/PlantUML 代码自动渲染 | 标准流程图、时序图等 8 种图表 |

何时使用哪种方式

需求推荐方式说明
精确控制节点位置、颜色、坐标board create-notes(本技能)完全自定义布局,适合架构图、看板
从 Mermaid/PlantUML 代码快速生成图
board import 或 doc import | 服务端自动排版,无需手动计算坐标 | | 在文档中内嵌简单图表 | feishu-cli-write / feishu-cli-import 的 Mermaid 支持 | Markdown 中写 Mermaid 代码块,导入时自动转画板 |

简单判断:如果你只需要画个流程图且不关心精确坐标,优先用 Mermaid;如果需要精排或自定义配色布局,用 create-notes。

精排绘图工作流(create-notes)

这是画板的核心能力,通过 JSON 精确控制每个节点的位置、大小、颜色和连线。

标准四步流程

bash

1. 创建文档(或使用已有文档)


feishu-cli doc create --title 架构图 -o json

→ document_id

2. 在文档中添加画板

feishu-cli doc add-board -o json

→ whiteboard_id

3. 创建节点(先形状,再连接线)

feishu-cli board create-notes shapes.json -o json

→ node_ids(用于连接线引用)

feishu-cli board create-notes connectors.json -o json

4. 截图验证

feishu-cli board image output.png

关键原则:先创建所有形状节点获取 ID,再创建连接线引用这些 ID。

最小示例:2 个节点 + 1 条连线

在深入 JSON 格式细节之前,先看一个最小的完整示例——两个矩形节点通过一条箭头连接:

bash

shapes.json — 两个形状节点


cat > /tmp/minimal_shapes.json << EOF
[
{type:composite_shape,x:100,y:100,width:160,height:40,
compositeshape:{type:roundrect},
text:{text:服务 A,fontsize:14,fontweight:regular,horizontalalign:center,verticalalign:mid},
style:{fillcolor:#3399ff,fillopacity:100,border_style:none},
z_index:10},
{type:composite_shape,x:400,y:100,width:160,height:40,
compositeshape:{type:roundrect},
text:{text:服务 B,fontsize:14,fontweight:regular,horizontalalign:center,verticalalign:mid},
style:{fillcolor:#509863,fillopacity:100,border_style:none},
z_index:10}
]
EOF
feishu-cli board create-notes $BOARDID /tmp/minimalshapes.json -o json

→ 返回 node_ids: [o1:1, o1:2]

connector.json — 一条从服务 A 指向服务 B 的连线

cat > /tmp/minimal_connector.json << EOF [ {type:connector,width:1,height:1,z_index:50, connector:{shape:polyline, start:{arrowstyle:none,attachedobject:{id:o1:1,position:{x:1,y:0.5},snap_to:right}}, end:{arrowstyle:trianglearrow,attachedobject:{id:o1:2,position:{x:0,y:0.5},snapto:left}}}, style:{bordercolor:#646a73,borderopacity:100,borderstyle:solid,borderwidth:narrow}} ] EOF feishu-cli board create-notes $BOARDID /tmp/minimalconnector.json -o json

这就是 create-notes 的基本模式:形状定义位置和样式 → 连接线通过 ID 引用形状。下面是各字段的详细说明。

节点 JSON 格式

形状节点(composite_shape)

最常用的节点类型,支持矩形、圆角矩形等:

json
{
type: composite_shape,
x: 100, y: 100, width: 200, height: 50,
compositeshape: {type: roundrect},
text: {
text: 节点文本,
font_size: 14,
font_weight: regular,
horizontal_align: center,
vertical_align: mid
},
style: {
fill_color: #8569cb,
fill_opacity: 100,
border_style: none
},
z_index: 10
}

注意:多余字段会导致 2890002 invalid arg 错误,保持最小格式。

连接线(connector)

连接两个已创建的形状节点:

json
{
type: connector,
width: 1, height: 1, z_index: 50,
connector: {
shape: polyline,
start: {
arrow_style: none,
attached_object: {
id: nodeid>,
position: {x: 1, y: 0.5},
snap_to: right
}
},
end: {
arrowstyle: trianglearrow,
attached_object: {
id: nodeid>,
position: {x: 0, y: 0.5},
snap_to: left
}
}
},
style: {
border_color: #646a73,
border_opacity: 100,
border_style: solid,
border_width: narrow
}
}

连接方向速查

方向start positionstart snaptoend positionend snapto
→ 左到右{x:1, y:0.5}right{x:0, y:0.5}left
↓ 上到下
{x:0.5, y:1} | bottom | {x:0.5, y:0} | top | | ← 右到左 | {x:0, y:0.5} | left | {x:1, y:0.5} | right | | ↑ 下到上 | {x:0.5, y:0} | top | {x:0.5, y:1} | bottom |

position 是归一化坐标(0-1),表示节点边缘上的连接点位置。一个节点连多条线时,调整 position 避免重叠(如扇出:x:0.25、x:0.5、x:0.75)。

配色方案

为不同实体类型使用不同颜色,让图表一目了然:

用途填充色边框色适用对象
强调/标题#8569cb核心服务、标题栏
紫色辅助
#eae2fe | #8569cb | API、中间层 |
| 绿色正向 | #509863 | — | 成功、输出、完成 |
| 绿色辅助 | #d5e8d4 | #509863 | 处理步骤

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 feishu-cli-board-1776117071 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 feishu-cli-board-1776117071 技能

通过命令行安装

skillhub install feishu-cli-board-1776117071

下载

⬇ 下载 feishu-cli-board v1.0.0(免费)

文件大小: 9.05 KB | 发布时间: 2026-4-17 14:48

v1.0.0 最新 2026-4-17 14:48
feishu-cli-board 1.0.0 — 首次发布,支持飞书画板全功能(精排绘图与图表导入)

- 新增通过 create-notes API 精细控制画板节点布局、样式、连线
- 支持飞书画板一键导入 Mermaid/PlantUML 图表(自动排版或自定义坐标)
- 提供节点和连接线 JSON 格式详解、色板/z-index 建议及典型工作流示例
- 支持画板图片导出、节点列表获取、快速复制/重建画板
- 涵盖权限配置、常见错误速查与排查指南

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部