技能图谱SKILLSGROVE
技能图谱/效率工具/cklxx/elephant.ai/feishu-doc

feishu-doc

安装

$npx skills add https://github.com/cklxx/elephant.ai --skill feishu-doc
$git clone --depth 1 https://github.com/cklxx/elephant.ai.git /tmp/elephant.ai && mkdir -p ~/.claude/skills && cp -r /tmp/elephant.ai/skills/feishu-doc ~/.claude/skills/feishu-doc
请帮我安装这个 Agent Skill:https://github.com/cklxx/elephant.ai/tree/bc94628f41b7daba20825b86069ae8e0fa83dc5e/skills/feishu-doc ,先阅读它的 SKILL.md 和脚本,确认安全后再安装到我的技能目录。

简介

原文描述 · MITWhen 飞书云文档 needs creating, reading, or updating → CRUD docs with Lark-flavored Markdown syntax.
以下 SKILL.md 内容转载自 cklxx/elephant.ai(提交 bc94628),依据 MIT 许可证转载正文(文字未改动;仅省略文件头元数据、将图片显示为链接,超长内容会截断);版权归 2025 cklxx 所有。许可证:LICENSE。仅展示说明文件,附带脚本请在原仓库查看。

Feishu Doc Skill

快速索引

文档操作

用户意图 module tool_action 必填参数
创建文档 doc create 可空(建议 title)
读取文档 doc read document_id
读取文档内容 doc read_content document_id
写入 Markdown doc write_markdown document_id, content(或 markdown)
列出文档块 doc list_blocks document_id
更新文本块 doc update_block_text document_id, block_id, content

Wiki 操作

用户意图 module tool_action 必填参数
列出知识空间 wiki list_spaces -
列出节点 wiki list_nodes space_id
创建节点 wiki create_node space_id, title
获取节点 wiki get_node space_id, node_token

调用示例

创建文档

python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "create",
  "title": "Q1 工作总结",
  "folder_token": "fldcnXXXX"
}'

读取文档内容

python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "read_content",
  "document_id": "doccnXXXX"
}'

写入 Markdown 内容

python3 skills/feishu-cli/run.py '{
  "action": "tool",
  "module": "doc",
  "tool_action": "write_markdown",
  "document_id": "doccnXXXX",
  "content": "## 概述\n\n本季度完成了以下关键目标:\n\n1. 项目 A 上线\n2. 性能优化 30%"
}'

Wiki 操作

# 列出知识空间
python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_spaces"}'

# 列出节点
python3 skills/feishu-cli/run.py '{"action":"tool","module":"wiki","tool_action":"list_nodes","space_id":"7xxx"}'

核心约束

文档 ID 来源

  • URL 中提取:https://xxx.feishu.cn/docx/doccnXXXX → document_id = "doccnXXXX"
  • Wiki URL:先用 wiki get_node 获取 obj_token,再作为 document_id 使用
  • API 返回:创建文档后返回

Lark Markdown 与标准 Markdown 差异

飞书文档支持的 Markdown 是 Lark 风味,与标准 GFM 有一些差异:

  • 标题: 支持 # 到 ######
  • 代码块: 支持 ```language 语法
  • 表格: 使用 | col1 | col2 | 标准表格语法
  • 任务列表: 使用 - [ ] 和 - [x]
  • 引用: 使用 > 前缀
  • 特殊块: 支持 callout、grid、mermaid、plantuml 等

权限与默认行为

  • 读取需要 docx:document:readonly scope
  • 写入需要 docx:document scope
  • Wiki 操作需要 wiki:wiki 相关 scope
  • 通过 CLI 创建文档时,会自动返回 url 与 applink_url
  • 创建文档后,CLI 会尝试默认给当前用户开启 管理权限(full_access),无需额外参数;若当前调用身份无法修改协作者权限,则会在返回中给出 manage_permission_warning
查看许可证全文(MIT)
MIT License

Copyright (c) 2025 cklxx

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.