Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计提醒

feishu-block-ops飞书封锁行动

Agent Skill

feishu-block-ops 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

8,404

周安装

361

GitHub Stars

公开资料未说明

下载量

2,946
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:feishu-block-ops(飞书封锁行动)
来源仓库:https://github.com/deadblue22/feishu-block-ops
安装命令:
openclaw skills install feishu-block-ops
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install feishu-block-ops

简介

feishu-block-ops 用于辅助前端页面与组件开发,支持低级文档块操作。

  • 适合在 OpenClaw 中维护前端项目或生成界面组件的场景。
  • 通过 clawhub 安装,命令为 openclaw skills install feishu-block-ops。
  • 建议安装前确认权限范围、维护状态及是否触发文件读写或 API 调用。
  • 可结合来源仓库和原始文档核验批量更新与插入操作的适用场景。

SKILL.md

name
feishu-block-ops
description
|

Feishu Block Operations

Direct REST API operations for Feishu cloud documents when the feishu_doc tool's built-in actions don't cover your needs.

When to Use This (vs feishu_doc)

NeedUse
Read/write/append documentfeishu_doc
Create simple tablefeishu_doc create_table_with_values
Upload image/filefeishu_doc upload_image/upload_file
Batch update 200 cells at onceThis skill
Insert content at exact positionThis skill (or feishu-md2blocks)
Traverse block treeThis skill
Table row/column insert/deleteThis skill
Merge/unmerge table cellsThis skill
Replace images in-placeThis skill
Delete blocks by index rangeThis skill

Authentication

Get tenant access token from OpenClaw config:

import json, urllib.request

def get_feishu_token():
    with open(os.path.expanduser("~/.openclaw/openclaw.json")) as f:
        c = json.load(f)["channels"]["feishu"]
    payload = json.dumps({"app_id": c["appId"], "app_secret": c["appSecret"]}).encode()
    req = urllib.request.Request(
        "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
        data=payload, headers={"Content-Type": "application/json"}, method="POST")
    return json.loads(urllib.request.urlopen(req).read())["tenant_access_token"]

All API calls use header: Authorization: Bearer {token}

Rate Limits

OperationLimit
Read (GET)5 req/sec per app
Write (POST/PATCH/DELETE)3 req/sec per app, 3 req/sec per document

Use time.sleep(0.35) between write calls. For reads, time.sleep(0.25).

API Reference

Base URL: https://open.feishu.cn/open-apis/docx/v1/documents

1. Get Block

GET /docx/v1/documents/{doc}/blocks/{block_id}

Returns single block with full content (type, elements, children IDs, styles).

2. Get Children (with optional full tree)

GET /docx/v1/documents/{doc}/blocks/{block_id}/children
    ?with_descendants=true    # get ALL descendants, not just direct children
    &page_size=500            # max 500
    &document_revision_id=-1  # latest revision

Tip: Use with_descendants=true on table blocks to get all cells + cell content in one call.

3. Create Blocks (simple, flat only)

POST /docx/v1/documents/{doc}/blocks/{parent_id}/children
Body: {"children": [...blocks], "index": 0}
  • Max 50 blocks per call
  • Cannot create nested structures (e.g. table with cell content)
  • index in body: 0=beginning, -1=end (default)

4. Create Nested Blocks (tables, grids, etc.)

POST /docx/v1/documents/{doc}/blocks/{parent_id}/descendant
Body: {
    "children_id": ["temp_id_1", "temp_id_2"],
    "descendants": [...all_blocks_with_parent_child_relations],
    "index": 0
}
  • Max 1000 blocks per call
  • children_id: only first-level child IDs (NOT grandchildren — causes error 1770006)
  • descendants: flat array of ALL blocks including nested ones, each with block_id, block_type, children (list of child temp IDs)
  • ⚠️ index MUST be in request body, NOT as URL query parameter?index=N is silently ignored

5. Batch Update Blocks

PATCH /docx/v1/documents/{doc}/blocks/batch_update
Body: {"requests": [...update_requests]}

Max 200 blocks per call. Each request object contains block_id + one operation:

OperationPurpose
update_text_elementsReplace text content + inline elements
update_text_styleChange alignment, folded, language, wrap, background_color
update_table_propertyModify column widths, header rows/columns
insert_table_rowInsert rows at index
insert_table_columnInsert columns at index
delete_table_rowsDelete rows by index + count
delete_table_columnsDelete columns by index + count
merge_table_cellsMerge cells (row_start, row_end, column_start, column_end)
unmerge_table_cellsUnmerge previously merged cells
replace_imageReplace image block's content with new file_token

Example: batch update text in multiple cells

requests = []
for block_id, new_text in updates.items():
    requests.append({
        "block_id": block_id,
        "update_text_elements": {
            "elements": [{"text_run": {"content": new_text}}]
        }
    })

api_call(token, "PATCH",
    f"https://open.feishu.cn/open-apis/docx/v1/documents/{doc}/blocks/batch_update",
    {"requests": requests})

6. Update Single Block

PATCH /docx/v1/documents/{doc}/blocks/{block_id}
Body: {same operations as batch_update, without block_id wrapper}

7. Delete Blocks

DELETE /docx/v1/documents/{doc}/blocks/{parent_id}/children/batch_delete
Body: {"start_index": 0, "end_index": 5}
  • ⚠️ Uses start_index/end_index (half-open interval [start, end)), NOT block_ids
  • Indices are relative to the parent block's children list

Block Types

TypeIDNotes
Page1Document root, always one
Text2Plain paragraph
Heading1–93–11
Bullet12Unordered list item
Ordered13Ordered list item
Code14Code block
Quote15Block quote
Todo17Checkbox item
Callout19Highlighted block
Divider22Horizontal rule (body: {})
Grid24Multi-column layout
GridColumn25Column in grid
Image27Image block
Table31Table container
TableCell32Cell in table
QuoteContainer34Quote wrapper (body: {})

Text Elements

Text blocks contain an elements array. Each element is one of:

# Plain text
{"text_run": {"content": "hello", "text_element_style": {"bold": True, "link": {"url": "..."}}}}

# Mention user
{"mention_user": {"user_id": "ou_xxx", "text_element_style": {}}}

# Mention document
{"mention_doc": {"token": "xxx", "obj_type": 22, "text_element_style": {}}}

# Equation (LaTeX)
{"equation": {"content": "E=mc^2"}}

# Reminder
{"reminder": {"expire_time": 1234567890, "is_whole_day": True}}

Common Patterns

Pattern 1: Read table content

# 1. Get table's descendants in one call
url = f".../blocks/{table_block_id}/children?with_descendants=true&page_size=500&document_revision_id=-1"
items = api_call(token, "GET", url)["data"]["items"]

# 2. Extract text from cells
for item in items:
    if item["block_type"] == 2 and "text" in item:
        text = "".join(e.get("text_run", {}).get("content", "") for e in item["text"]["elements"])

Pattern 2: Insert Markdown at position

Use feishu-md2blocks skill's md2blocks.py script with --after <block_id>.

Or manually:

# 1. Convert markdown
convert_resp = api_call(token, "POST", ".../blocks/convert",
    {"content_type": "markdown", "content": md_text})

# 2. Clean table blocks (remove merge_info)
for block in convert_resp["data"]["blocks"]:
    if block.get("block_type") == 31 and "table" in block:
        block["table"]["property"].pop("merge_info", None)

# 3. Insert at position (index IN BODY)
api_call(token, "POST", f".../blocks/{parent_id}/descendant", {
    "children_id": convert_resp["data"]["first_level_block_ids"],
    "descendants": convert_resp["data"]["blocks"],
    "index": target_index
})

Pattern 3: Batch edit table cells

# 1. Get all descendants of table
items = get_descendants(table_id)

# 2. Build update map
updates = []
for item in items:
    if needs_update(item):
        updates.append({
            "block_id": item["block_id"],
            "update_text_elements": {
                "elements": [{"text_run": {"content": new_value}}]
            }
        })

# 3. Batch update (max 200 per call)
for i in range(0, len(updates), 200):
    api_call(token, "PATCH", f".../blocks/batch_update",
        {"requests": updates[i:i+200]})
    time.sleep(0.35)

Pattern 4: Delete then re-insert (position workaround)

When you need to replace content at a specific position:

# 1. Find the index range to replace
children = get_doc_children(doc)
start_idx = children.index(first_block_to_replace)
end_idx = children.index(last_block_to_replace) + 1

# 2. Delete old blocks
api_call(token, "DELETE", f".../children/batch_delete",
    {"start_index": start_idx, "end_index": end_idx})

# 3. Insert new content at same position
api_call(token, "POST", f".../blocks/{doc}/descendant", {
    "children_id": new_ids,
    "descendants": new_blocks,
    "index": start_idx
})

Gotchas & Lessons Learned

  1. /descendant index in body, not URL — The most common pitfall. ?index=N compiles but is silently ignored.
  2. batch_delete uses index range{"start_index": 0, "end_index": 5} deletes children[0..4]. Do NOT pass block_ids.
  3. Table merge_info is read-only — Must strip from blocks before insertion or API returns error.
  4. children_id is first-level only — Including grandchild IDs in children_id causes error 1770006.
  5. Rate limit is per-document — Multiple concurrent edits to the same doc share the 3/sec limit.
  6. with_descendants=true saves calls — One GET instead of N+1 for reading table content.
  7. Convert API returns temp IDs — After insertion, actual block IDs differ from the temp IDs used during convert.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

92.87%
按下载量换算2,736

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills