← Back to Skills Marketplace
siyiding

Feishu Sheet

by siyiding · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ⚠ suspicious
717
Downloads
0
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install feishu-sheet
Description
飞书电子表格(Sheets)完整操作。当需要创建、读取或编辑飞书电子表格时激活此 skill。 支持:创建表格、读写单元格、追加数据、图片插入、样式设置、合并单元格、行列操作、查找替换。 需要飞书应用凭证:channels.feishu.appId 和 channels.feishu.appSecret(配置在...
README (SKILL.md)

飞书电子表格 Skill

通过 exec 调用 ~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh 脚本操作飞书电子表格。

前提条件

  1. 飞书应用凭证~/.openclaw/openclaw.json 中必须配置 channels.feishu,包含 appIdappSecret
  2. 飞书应用权限:应用需要开通「电子表格」相关权限(sheets:spreadsheet
  3. 系统依赖curlpython3bash

凭证自动从 openclaw.json 读取,无需手动配置。可通过 OPENCLAW_CONFIG 环境变量指定配置文件路径。

Token 提取

从 URL https://feishu.cn/sheets/shtcnABC123spreadsheet_token = shtcnABC123


📊 表格操作

创建电子表格

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh create '表格标题'"

返回 spreadsheet_token 和 URL。可选第二参数 folder_token

获取元数据(必须先调这个拿 sheet_id)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh meta shtcnABC123"

📖 数据读写

读取数据

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh read TOKEN 'sheetId!A1:C10'"

读取多个范围

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh read_multi TOKEN 'sheetId!A1:C10' 'sheetId!E1:F5'"

写入数据(覆盖指定范围)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh write TOKEN 'sheetId!A1:C2' '[[\"表头1\",\"表头2\",\"表头3\"],[\"数据1\",100,true]]'"

values 是 JSON 二维数组。字符串用引号,数字和布尔值不用。

追加数据(在已有数据后面添加行)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh append TOKEN 'sheetId!A1:C1' '[[\"新行1\",\"新行2\",\"新行3\"]]'"

前插数据

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh prepend TOKEN 'sheetId!A1:C1' '[[\"插入行1\",\"插入行2\",\"插入行3\"]]'"

🖼️ 图片操作

插入图片到单元格(本地文件)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh insert_image TOKEN 'sheetId!E1:E1' /path/to/image.png"

图片会填充到指定单元格内。Range 必须是单个单元格。

插入浮动图片(本地文件)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh float_image TOKEN sheetId /path/to/image.png 'sheetId!F1:F1' 400 300"

参数:token, sheet_id, 文件路径, 锚点单元格(可选), 宽度(可选), 高度(可选)

插入浮动图片(URL)

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh float_image_url TOKEN sheetId 'https://example.com/image.png' 'sheetId!F1:F1' 400 300"

🎨 样式操作

设置单元格样式

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh style TOKEN 'sheetId!A1:D1' '{\"bold\":true,\"foreColor\":\"#FFFFFF\",\"backColor\":\"#4472C4\",\"fontSize\":14}'"

支持的样式属性:

  • bold (bool) — 加粗
  • italic (bool) — 斜体
  • foreColor (string) — 字体颜色,如 #FF0000
  • backColor (string) — 背景颜色,如 #FFFF00
  • fontSize (int) — 字号,如 14
  • horizontalAlign (int) — 水平对齐:0=左, 1=中, 2=右
  • verticalAlign (int) — 垂直对齐:0=上, 1=中, 2=下
  • textDecoration (int) — 0=无, 1=下划线, 2=删除线, 3=两者都有

批量设置样式

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh style_batch TOKEN '{\"data\":[{\"ranges\":\"sheetId!A1:D1\",\"style\":{\"bold\":true}},{\"ranges\":\"sheetId!A2:D10\",\"style\":{\"fontSize\":12}}]}'"

🔗 合并单元格

合并

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh merge TOKEN 'sheetId!A1:D1' MERGE_ALL"

合并类型:MERGE_ALL(全部合并)、MERGE_ROWS(按行合并)、MERGE_COLUMNS(按列合并)

拆分

exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh unmerge TOKEN 'sheetId!A1:D1'"

📄 工作表操作

# 添加工作表
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh add_sheet TOKEN '工作表名称'"

# 删除工作表
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh delete_sheet TOKEN sheetId"

# 复制工作表
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh copy_sheet TOKEN sourceSheetId '副本名称'"

↕️ 行列操作

# 末尾加 10 行
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh add_rows TOKEN sheetId 10"

# 末尾加 5 列
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh add_cols TOKEN sheetId 5"

# 在第3行前插入到第5行(0-indexed)
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh insert_rows TOKEN sheetId 3 5"

# 删除第3到第5行
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh delete_rows TOKEN sheetId 3 5"

# 删除第2到第4列
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh delete_cols TOKEN sheetId 2 4"

🔍 查找替换

# 查找
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh find TOKEN sheetId '关键词'"

# 替换
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh replace TOKEN sheetId '旧文本' '新文本'"

常见流程示例

创建带格式的报表

# 1. 创建表格
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh create '月度报表'"
# → 得到 spreadsheet_token

# 2. 获取 sheet_id
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh meta TOKEN"
# → 得到 sheet_id

# 3. 写入表头
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh write TOKEN 'sheetId!A1:D1' '[[\"项目\",\"负责人\",\"进度\",\"备注\"]]'"

# 4. 设置表头样式(加粗+蓝底白字)
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh style TOKEN 'sheetId!A1:D1' '{\"bold\":true,\"backColor\":\"#4472C4\",\"foreColor\":\"#FFFFFF\",\"fontSize\":13}'"

# 5. 写入数据
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh write TOKEN 'sheetId!A2:D4' '[[\"功能A\",\"张三\",\"80%\",\"进行中\"],[\"功能B\",\"李四\",\"100%\",\"已完成\"],[\"功能C\",\"王五\",\"30%\",\"延期\"]]'"

# 6. 插入图片
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh float_image_url TOKEN sheetId 'https://example.com/chart.png' 'sheetId!F1:F1' 500 300"

注意事项

  • Range 格式:必须带 sheetId 前缀,用 meta 命令获取
  • 单元格图片insert_image 的 range 必须是单个单元格(如 A1:A1
  • 浮动图片:支持本地文件和 URL,会自动上传到飞书
  • values 格式:JSON 二维数组,注意 shell 中引号转义
  • 权限:表格需要对机器人开放编辑权限,或由机器人创建
  • 凭证:自动从 ~/.openclaw/openclaw.jsonchannels.feishu 读取,无需手动配置
Usage Guidance
This skill appears to do exactly what it claims: interact with Feishu Sheets using a local script and your Feishu app credentials stored in ~/.openclaw/openclaw.json (or via OPENCLAW_CONFIG). Before installing: 1) ensure you trust the skill source (scripts are included and executable); 2) create a Feishu app with minimal permissions (only sheets:spreadsheet) and use those appId/appSecret values; 3) keep the config file protected (it contains app secrets); 4) note that the skill will read local image files only when you invoke image commands and caches tenant tokens in your temporary directory. If you need higher assurance, inspect the full script (provided) or run the skill in an isolated environment/account.
Capability Analysis
Type: OpenClaw Skill Name: feishu-sheet Version: 1.2.0 The skill provides comprehensive Feishu Spreadsheet integration but contains several critical command injection vulnerabilities in `scripts/feishu-sheet.sh`. Specifically, functions like `action_insert_image` and `action_float_image` interpolate shell variables directly into Python code strings (e.g., `python3 -c "with open('$image_path','rb')..."`) without escaping, which allows for arbitrary Python code execution if the file path is manipulated via prompt injection. While the skill includes some security-conscious features like credential validation and per-user token caching in `/tmp`, the flawed implementation of its core logic poses a significant security risk.
Capability Assessment
Purpose & Capability
Name/description (Feishu Sheets) align with the included script and SKILL.md. The skill asks for Feishu app credentials and uses Feishu Open API endpoints (open.feishu.cn) to create/read/write spreadsheets, images, styles, etc., which is appropriate for the stated functionality.
Instruction Scope
SKILL.md instructs the agent to exec the included script to perform sheet operations and documents required inputs. The runtime script reads credentials from ~/.openclaw/openclaw.json and local image files only when image insertion commands are used. There are no instructions to read unrelated files, scan system state beyond token caching, or post data to endpoints other than Feishu APIs.
Install Mechanism
No install spec — the skill is instruction+script only. The script relies on standard tools (curl, python3, bash) that are declared as dependencies. No external downloads or archive extraction are performed by an installer.
Credentials
The skill legitimately needs channels.feishu.appId and channels.feishu.appSecret (stored in ~/.openclaw/openclaw.json) to call Feishu APIs. Minor inconsistency: registry metadata listed no required env vars/primary credential, while SKILL.md clearly documents required Feishu credentials in the config file. The script also uses TMPDIR/OPENCLAW_CONFIG optionally; these are reasonable and documented.
Persistence & Privilege
always:false and normal autonomous invocation settings. The script caches tenant tokens to a per-user file in $TMPDIR (no system-wide or cross-skill config modifications). It does not request persistent, global privileges or modify other skills.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-sheet
  3. After installation, invoke the skill by name or use /feishu-sheet
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.2.0
Security hardening: fixed regex validation bug (escaped $ in double-quoted python), per-user token cache isolation (uid suffix in /tmp path), switched to single-quoted python to prevent shell injection, added homepage/author/network-access/file-access declarations in metadata, documented required Feishu app permissions
v1.1.0
Security fix: replaced eval-based credential loading with safe line-based parsing; added input validation for appId/appSecret; declared required credentials in metadata
v1.0.0
feishu-sheet 1.0.0 初始版本 - 新增飞书电子表格全功能操作,包括表格创建、读写、样式、图片、合并、行列管理等。 - 支持通过 Bash 脚本一键实现 Sheets 操作,无需手动配置凭证。 - 提供详细的各类 API 使用范例和参数说明,覆盖从基础到进阶的表格需求。 - 支持依赖自动读取和环境变量指定配置文件。 - 覆盖常见报表与批量数据处理场景。
Metadata
Slug feishu-sheet
Version 1.2.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 3
Frequently Asked Questions

What is Feishu Sheet?

飞书电子表格(Sheets)完整操作。当需要创建、读取或编辑飞书电子表格时激活此 skill。 支持:创建表格、读写单元格、追加数据、图片插入、样式设置、合并单元格、行列操作、查找替换。 需要飞书应用凭证:channels.feishu.appId 和 channels.feishu.appSecret(配置在... It is an AI Agent Skill for Claude Code / OpenClaw, with 717 downloads so far.

How do I install Feishu Sheet?

Run "/install feishu-sheet" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Sheet free?

Yes, Feishu Sheet is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Sheet support?

Feishu Sheet is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Feishu Sheet?

It is built and maintained by siyiding (@siyiding); the current version is v1.2.0.

💬 Comments