Feishu Sheets Skill

实现飞书在线表格的创建、读写、增删行/列及工作表管理。

已扫描
适合谁
需要自动化处理飞书表格的办公人员、使用飞书进行团队协作的数据管理者
不适合谁
不熟悉飞书表格结构的初学者、无需与飞书集成的独立文档使用者
国内可用性
需网络配置。可能需要网络配置或第三方服务可访问。
安装难度
新手友好(★☆☆)。基于终端操作、依赖、API Key 和本地环境要求的初步判断。

安装与下载

openclaw skills install @wesley138cn/feishu-sheets-skill

Skill 说明

命令、参数、文件名以原文为准

飞书表格工具

单一工具 feishu_sheets,通过动作参数支持所有电子表格操作。

令牌提取

从 URL https://xxx.feishu.cn/sheets/shtABC123spreadsheet_token = shtABC123

动作

创建电子表格

{ "action": "create", "title": "新建电子表格" }

可选文件夹:

{ "action": "create", "title": "新建电子表格", "folder_token": "fldcnXXX" }

返回:spreadsheet_token、url、title

写入数据

{
  "action": "write",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx",
  "range": "A1:C3",
  "values": [["Name", "Age", "City"], ["Alice", 25, "Beijing"], ["Bob", 30, "Shanghai"]]
}

读取数据

{
  "action": "read",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx",
  "range": "A1:C10"
}

追加数据

{
  "action": "append",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx",
  "values": [["Charlie", 28, "Shenzhen"]]
}

插入行/列

{
  "action": "insert_dimension",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx",
  "dimension": "ROWS",
  "start_index": 5,
  "end_index": 7
}

删除行/列

{
  "action": "delete_dimension",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx",
  "dimension": "ROWS",
  "start_index": 5,
  "end_index": 7
}

获取电子表格信息

{ "action": "get_info", "spreadsheet_token": "shtABC123" }

返回:元数据,包括所有 sheet_id 和标题

添加工作表

{
  "action": "add_sheet",
  "spreadsheet_token": "shtABC123",
  "title": "Sheet2"
}

删除工作表

{
  "action": "delete_sheet",
  "spreadsheet_token": "shtABC123",
  "sheet_id": "0bxxxx"
}

范围格式

  • 单个单元格:A1B5
  • 区域范围:A1:C10B2:D5
  • 整列:A:AB:D
  • 整行:1:13:5
  • 指定工作表时:0bxxxx!A1:C10

工作表 ID

  • 从 URL 获取:https://xxx.feishu.cn/sheets/shtABC123?sheet=0bxxxx
  • 通过 get_info 动作获取
  • 默认第一个工作表通常具有类似 0bxxxx 的简单 ID

数据类型

值可以是:

  • 字符串:"Hello"
  • 数字:12345.67
  • 公式:{"type": "formula", "text": "=SUM(A1:A10)"}
  • 链接:{"type": "url", "text": "点击这里", "link": "https://..."}

配置

channels:
  feishu:
    tools:
      sheets: true  # 默认值:true

所需权限

  • sheets:spreadsheet - 创建和管理电子表格
  • sheets:spreadsheet:readonly - 读取电子表格数据
  • drive:drive - 访问云存储

API 参考

基础地址:https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/

详细 API 文档请参见 references/api-reference.md。

W
@wesley138cn

已收录 1 个 Skill

相关推荐