agentleFS
hashSTACS-GlobalhashSTACS-Global/EnClaws/skills/feishu-skills/feishu-wiki/SKILL.md

feishu-wiki

Skill36 starsChanged 8 months agoApache-2.0View on GitHub

飞书知识库管理工具。支持知识空间(Space)的增删查,以及知识库节点(Node)的增删查/移动/复制。 节点是知识库中的文档,包括 docx、sheet、bitable 等类型。

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

feishu-wiki

模块兼容:所有脚本均提供 .js 和 .mjs 两个版本。优先使用 .js,若报 require is not defined 错误则改用同名 .mjs 文件。

直接用 exec 执行,不要检查文件或环境。


知识空间(Space)操作

列出所有知识空间

node ./wiki.js --open-id "ou_xxx" --action space_list
node ./wiki.js --open-id "ou_xxx" --action space_list --page-size 20

获取知识空间详情

node ./wiki.js --open-id "ou_xxx" --action space_get --space-id "SPACE_ID"

创建知识空间

node ./wiki.js --open-id "ou_xxx" --action space_create --name "项目文档" --description "描述(可选)"

知识库节点(Node)操作

列出节点(根节点或子节点)

# 列出根节点
node ./wiki.js --open-id "ou_xxx" --action node_list --space-id "SPACE_ID"

# 列出某节点的子节点
node ./wiki.js --open-id "ou_xxx" --action node_list --space-id "SPACE_ID" --parent-node-token "NODE_TOKEN"

获取节点详情(含 obj_token)

node ./wiki.js --open-id "ou_xxx" --action node_get --token "NODE_OR_WIKI_TOKEN"
node ./wiki.js --open-id "ou_xxx" --action node_get --token "NODE_TOKEN" --obj-type wiki

node_get 的核心用途:将 wiki 类型的 node_token 转换为实际文档的 obj_token(用于后续 feishu-fetch-doc、feishu-sheet 等 skill)。

返回 url 字段为节点链接(格式 https://www.feishu.cn/wiki/{node_token})。

创建节点(新文档)

# 在根目录创建 docx 文档
node ./wiki.js --open-id "ou_xxx" --action node_create \
  --space-id "SPACE_ID" --obj-type docx --node-type origin --title "新文档标题"

# 在指定父节点下创建
node ./wiki.js --open-id "ou_xxx" --action node_create \
  --space-id "SPACE_ID" --obj-type docx --node-type origin \
  --parent-node-token "PARENT_TOKEN" --title "子文档"

# 创建快捷方式
node ./wiki.js --open-id "ou_xxx" --action node_create \
  --space-id "SPACE_ID" --obj-type docx --node-type shortcut \
  --origin-node-token "ORIGIN_TOKEN"

返回 url 字段为文档链接(格式 https://www.feishu.cn/wiki/{node_token}),reply 中直接包含链接。

移动节点

# 移动到另一父节点下
node ./wiki.js --open-id "ou_xxx" --action node_move \
  --space-id "SPACE_ID" --node-token "NODE_TOKEN" --target-parent-token "NEW_PARENT_TOKEN"

# 移动到根目录(不填 --target-parent-token)
node ./wiki.js --open-id "ou_xxx" --action node_move \
  --space-id "SPACE_ID" --node-token "NODE_TOKEN"

返回 url 字段为移动后节点的链接(格式 https://www.feishu.cn/wiki/{node_token})。

复制节点

# 复制到同一知识空间的另一位置
node ./wiki.js --open-id "ou_xxx" --action node_copy \
  --space-id "SPACE_ID" --node-token "NODE_TOKEN" \
  --target-parent-token "TARGET_PARENT_TOKEN" --title "副本标题"

# 复制到另一个知识空间
node ./wiki.js --open-id "ou_xxx" --action node_copy \
  --space-id "SOURCE_SPACE_ID" --node-token "NODE_TOKEN" \
  --target-space-id "TARGET_SPACE_ID" --target-parent-token "TARGET_PARENT_TOKEN"

返回 url 字段为新节点链接(格式 https://www.feishu.cn/wiki/{node_token})。


参数总览

参数必填说明
--open-id是当前用户 open_id
--action是见下方 Action 表
--space-id多数 action 必填知识空间 ID
--tokennode_get 必填节点 token 或文档 token
--node-tokenmove/copy 必填被操作的节点 token
--parent-node-token可选node_list 时指定父节点;node_create 时指定父节点
--target-parent-token可选move/copy 目标父节点
--target-space-id可选copy 时跨空间目标 space_id
--obj-typenode_create 必填docx / sheet / bitable / mindnote / file / slides
--node-typenode_create 必填origin(新建)/ shortcut(快捷方式)
--origin-node-tokenshortcut 时必填快捷方式指向的原始节点
--title可选节点/空间标题
--namespace_create 必填知识空间名称
--description可选知识空间描述
--page-size可选分页大小
--page-token可选翻页 token
--obj-typenode_get 可选默认 wiki,可指定 doc/sheet/bitable 等

Action 速查

Action说明
space_list列出当前用户可见的知识空间
space_get获取指定知识空间详情
space_create创建知识空间
node_list列出空间内节点(根节点或指定父节点的子节点)
node_get获取节点详情(可将 wiki token 转换为 obj_token),返回 url
node_create在空间内创建新文档节点,返回 url
node_move移动节点到另一位置,返回 url
node_copy复制节点到另一位置(可跨空间),返回 url

典型场景

  • 查看知识库目录 → space_list 后 node_list
  • 在知识库里创建新文档 → node_create --obj-type docx
  • 获取知识库文档的实际 token(供 feishu-fetch-doc 使用)→ node_get
  • 整理文档结构 → node_move
  • 归档复制 → node_copy

授权

若返回 {"error":"auth_required"} 或 {"error":"permission_required"},不要询问用户是否授权,直接立即执行以下命令发送授权链接:

  • 若返回 JSON 中包含 required_scopes 字段,将其数组值用空格拼接后传入 --scope 参数:
node ../feishu-auth/auth.js --auth-and-poll --open-id "SENDER_OPEN_ID" --chat-id "CHAT_ID" --timeout 60 --scope "<required_scopes 用空格拼接>"
  • 若返回中不包含 required_scopes,则不加 --scope 参数(使用默认权限)。
  • {"status":"authorized"} → 重新执行原始命令
  • {"status":"polling_timeout"} → 立即重新执行此 auth 命令(不会重复发卡片)
  • CHAT_ID 不知道可省略

权限不足时(应用级)

若返回中包含 "auth_type":"tenant",说明需要管理员在飞书开放平台开通应用权限,必须将 reply 字段内容原样发送给用户。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.