Feishu Sheet Tabs
Use this skill to add worksheet tabs inside an existing Feishu sheet by browser automation when feishu_sheet API can create/read/write spreadsheets but cannot create worksheet tabs.
Core conclusion
Current feishu_sheet API supports spreadsheet-level actions like:
- - create
- info
- read
- write
- append
- find
- export
It can target an existing sheet via sheet_id, but it does not expose a direct action for creating worksheet tabs/pages.
When the user explicitly wants tabs/pages inside one spreadsheet, switch to browser automation.
Preconditions
Before using browser automation, ensure all of the following:
- 1. The target spreadsheet URL/token is known.
- The user is logged into Feishu in a browser tab.
- Prefer using the user's real Chrome tab via Browser Relay when available.
- If Browser Relay is not attached, isolated browser may work only if it has a valid Feishu login state.
Preferred operating mode
Mode A: User's Chrome tab (preferred)
Use
browser with
profile="chrome" if the user has attached the tab via OpenClaw Browser Relay.
Why:
- - stable login state
- real user session
- fewer auth surprises
Mode B: OpenClaw managed browser
Use
profile="openclaw" only if it is already logged into Feishu.
Reliable workflow
Step 1: Verify API limitation first
Do
not claim “can’t do it” without checking.
Confirm from tool docs / current tool signature that feishu_sheet has no add_sheet / create_worksheet / add_tab action.
Step 2: Open the spreadsheet in browser
Use browser automation to open the spreadsheet.
Step 3: Inspect runtime objects
Feishu Sheets exposes internal JS objects on the page. In practice, these were found useful:
- - INLINECODE10
- INLINECODE11
Relevant methods discovered from runtime introspection:
- - INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
- INLINECODE16
Step 4: Read current sheet ids/names
Use page evaluation to inspect current sheets before mutation.
Pattern:
CODEBLOCK0
Step 5: Rename default first tab if needed
Typical pattern:
- - rename
Sheet1 → INLINECODE18
Step 6: Add tabs with spread.addSheet(name)
For example:
- - Skills
- Workflows
- Templates
- Content
Step 7: Fill each tab with feishu_sheet write
After tabs exist and their
sheet_ids are known, return to
feishu_sheet for structured writes. This is more stable than trying to type cell-by-cell in browser automation.
Proven pattern from this workspace
For spreadsheet:
The following sequence worked:
- 1. Inspect INLINECODE24
- Discover
spread.addSheet and INLINECODE26 - Read current sheet list and ids
- Rename
Sheet1 to INLINECODE28 - Create:
-
Skills
-
Workflows
-
Templates
-
Content
- 6. Use
feishu_sheet write with returned sheet ids to populate each tab
Example evaluation snippets
Discover methods
CODEBLOCK1
Rename + create tabs
CODEBLOCK2
Important caveats
- 1. Prefer internal methods over brittle UI clicking
Clicking
+ in the UI was less reliable than runtime JS calls.
- 2. Do not assume a visible plus button is the right entry
In this case, one nearby button turned out to be a template entry, not “new tab”.
- 3. Use browser only for the tab creation step
Once tabs are created, switch back to
feishu_sheet write.
- 4. Inspect current ids before writing
New tabs get generated
sheet_ids such as
GxGIGa,
9dJYiB, etc. Use actual returned ids.
- 5. Avoid blind UI automation first
Inspect runtime objects and methods before pixel-clicking.
When to use this skill
Use this skill when the user says things like:
- - “把这个表做成分页”
- “按类别分开 sheet”
- “给这张飞书表加几个页签”
- “我就想分页,你想办法解决”
Output expectation
When done, report:
- - which tabs were created/renamed
- which tab ids were found
- whether data filling was also completed
- whether browser login / relay was required
Feishu Sheet 页签
当 feishu_sheet API 可以创建/读取/写入电子表格但无法创建工作表页签时,使用此技能通过浏览器自动化在现有飞书表格中添加工作表页签。
核心结论
当前 feishu_sheet API 支持电子表格级别的操作,例如:
它可以通过 sheet_id 定位现有工作表,但没有提供创建工作表页签/页面的直接操作。
当用户明确希望在一个电子表格内创建页签/页面时,切换到浏览器自动化。
前置条件
在使用浏览器自动化之前,请确保满足以下所有条件:
- 1. 目标电子表格的 URL/token 已知。
- 用户在浏览器标签页中已登录飞书。
- 尽可能通过 Browser Relay 使用用户真实的 Chrome 标签页。
- 如果未连接 Browser Relay,独立浏览器仅在具有有效飞书登录状态时才能工作。
首选操作模式
模式 A:用户的 Chrome 标签页(首选)
如果用户已通过 OpenClaw Browser Relay 连接了标签页,则使用 browser 并设置 profile=chrome。
原因:
模式 B:OpenClaw 管理的浏览器
仅在已登录飞书的情况下使用 profile=openclaw。
可靠的工作流程
步骤 1:首先验证 API 限制
不要未经检查就声称无法做到。
从工具文档/当前工具签名确认 feishusheet 没有 addsheet / createworksheet / addtab 操作。
步骤 2:在浏览器中打开电子表格
使用浏览器自动化打开电子表格。
步骤 3:检查运行时对象
飞书表格在页面上暴露了内部 JS 对象。实践中发现以下对象很有用:
- - window.spread
- window.spreadApp
通过运行时自省发现的相关方法:
- - spread.addSheet(name)
- spread.renameSheet(sheetId, name)
- spread.copySheet(...)
- spread.moveSheet(...)
- spread.hideSheet(...)
步骤 4:读取当前工作表 ID/名称
在修改之前,使用页面评估检查当前工作表。
模式:
js
window.spread.sheets.map((s,i)=>({
i,
id: s.id?.() ?? s._id ?? s.sheetId ?? null,
name: s.name?.() ?? s._name ?? null
}))
步骤 5:根据需要重命名默认的第一个页签
典型模式:
步骤 6:使用 spread.addSheet(name) 添加页签
例如:
- - Skills
- Workflows
- Templates
- Content
步骤 7:使用 feishu_sheet write 填充每个页签
在页签存在且其 sheet
id 已知后,返回 feishusheet 进行结构化写入。这比在浏览器自动化中逐个单元格输入更稳定。
来自此工作区的已验证模式
对于电子表格:
- - https://bytedance.larkoffice.com/sheets/Bf6qsMV9fhqrD6tPE6TcQhF7nEe
以下序列有效:
- 1. 检查 window.spread
- 发现 spread.addSheet 和 spread.renameSheet
- 读取当前工作表列表和 ID
- 将 Sheet1 重命名为 总览
- 创建:
- Skills
- Workflows
- Templates
- Content
- 6. 使用返回的工作表 ID 通过 feishu_sheet write 填充每个页签
示例评估代码片段
发现方法
js
function protoMethods(obj,name){
if(!obj) return [];
const out=[];
let p=Object.getPrototypeOf(obj);
let depth=0;
while(p && depth<4){
for(const k of Object.getOwnPropertyNames(p)){
if(k===constructor) continue;
if(/sheet|tab|workbook|insert|create|add|page|name|rename/i.test(k)) out.push(${name}.${k});
}
p=Object.getPrototypeOf(p); depth++;
}
return [...new Set(out)];
}
重命名 + 创建页签
js
async () => {
const spread = window.spread;
const results = [];
const current = spread.sheets.map(s => ({
id: s.id?.() ?? s._id ?? null,
name: s.name?.() ?? s._name ?? null
}));
const first = current[0];
if (first?.name === Sheet1) {
results.push(await spread.renameSheet(first.id, 总览));
}
for (const name of [Skills,Workflows,Templates,Content]) {
const names = spread.sheets.map(s => s.name?.() ?? s._name);
if (!names.includes(name)) {
results.push(await spread.addSheet(name));
}
}
return spread.sheets.map((s,i)=>({
i,
id: s.id?.() ?? s._id ?? null,
name: s.name?.() ?? s._name ?? null
}));
}
重要注意事项
- 1. 优先使用内部方法而非脆弱的 UI 点击
在 UI 中点击 + 不如运行时 JS 调用可靠。
- 2. 不要假设可见的加号按钮就是正确的入口
在这种情况下,附近的一个按钮实际上是模板入口,而不是新建页签。
- 3. 仅将浏览器用于页签创建步骤
一旦页签创建完成,切换回 feishu_sheet write。
- 4. 在写入前检查当前 ID
新页签会生成诸如 GxGIGa、9dJYiB 等 sheet_id。使用实际返回的 ID。
- 5. 避免盲目使用 UI 自动化
在像素级点击之前,先检查运行时对象和方法。
何时使用此技能
当用户说出以下内容时使用此技能:
- - 把这个表做成分页
- 按类别分开 sheet
- 给这张飞书表加几个页签
- 我就想分页,你想办法解决
输出预期
完成后,报告:
- - 创建/重命名了哪些页签
- 找到了哪些页签 ID
- 数据填充是否也已完成
- 是否需要浏览器登录/中继