Lark Workflow Doc Perm logo

Lark Workflow Doc Perm

Community
liangdabiao
lark-workflow-doc-perm

文档权限管家:批量设置飞书文档权限,按角色或人员批量授权(可编辑/只读/完整权限),通知被授权用户。当用户需要'设置文档权限'、'批量授权'、'文档权限管理'、'分享文档给团队'、'文档权限配置'、'把文档分享给XX'时使用。

Overview

Publisherliangdabiao
Repositorylark-workflow-feishu-cli
Skill namelark-workflow-doc-perm
Stars
68
Forks
10
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by liangdabiao on GitHub. Read the source before you install it.

Installation

Install the Lark Workflow Doc Perm AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/liangdabiao/lark-workflow-feishu-cli/tree/main/.claude/skills/lark-workflow-doc-perm
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/liangdabiao/lark-workflow-feishu-cli.git /tmp/lark-workflow-feishu-cli
mkdir -p .claude/skills
cp -r /tmp/lark-workflow-feishu-cli/.claude/skills/lark-workflow-doc-perm .claude/skills/lark-workflow-doc-perm
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lark Workflow Doc Perm in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lark Workflow Doc Perm on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lark Workflow Doc Perm is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

文档权限管家工作流

CRITICAL — 开始前 MUST 先用 Read 工具读取 ../lark-shared/SKILL.md,其中包含认证、权限处理

适用场景

  • "把文档XXX分享给张三、李四,可编辑" / "设置文档权限"
  • "项目文档权限批量设置:工程组只读,产品组可编辑" / "批量授权"
  • "把这篇文档的编辑权限给整个团队" / "文档权限管理"
  • "分享文档给团队" / "文档权限配置"

前置条件

需要 user 身份(操作自己文档的权限)和 bot 身份(发消息通知)。执行前确保已授权:

bash
lark-cli auth login --domain drive,wiki,contact,im

工作流

{文档 URL 或 file_token + 授权人列表 + 权限级别}
  │
  ├── [wiki 链接] wiki spaces get_node ──► 解析真实 token + obj_type
  │
  ├── drive permission.members create ──► 批量授权(逐个,间隔 1s)
  │
  └── im +messages-send ────────────────► 通知被授权用户

Step 1: 解析文档 token

wiki 链接处理

如果用户提供的是知识库链接(https://xxx.feishu.cn/wiki/xxx),先解析获取真实文档 token:

bash
lark-cli wiki spaces get_node \
  --params '{"token":"<wiki_token>"}' \
  --as user

从返回结果中提取 obj_token(真实文档 token)和 obj_type(文档类型)。

直接 token

如果用户直接提供了文档 token(doccnXXX、sheetXXX、bascnXXX 等),可直接使用。

确定文档类型

obj_type说明type 参数
docx新版文档docx
sheet电子表格sheet
bitable多维表格bitable
doc旧版文档doc
mindnote思维导图mindnote
file文件file

Step 2: 查找授权目标用户

bash
lark-cli contact +search-user --query "<用户姓名>" --as user

记录每个用户的 open_id。支持批量查找多个用户。

Step 3: 设置权限

查看参数结构

bash
lark-cli schema drive.permission.members.create

逐个授权

对每个用户调用一次(间隔 1 秒,避免频率限制):

bash
lark-cli drive permission.members create \
  --params '{"token":"<file_token>","type":"<doc_type>"}' \
  --data '{
    "member_type": "openid",
    "member_id": "ou_xxx",
    "perm": "edit"
  }' \
  --as user

权限级别:

perm 值说明适用场景
full_access完整权限文档管理员、核心协作者
edit可编辑需要修改文档的协作者
view只读仅需查看的成员

按角色批量设置示例

bash
# 工程组:只读
for user_id in "ou_aaa" "ou_bbb" "ou_ccc"; do
  lark-cli drive permission.members create \
    --params '{"token":"<file_token>","type":"docx"}' \
    --data "{\"member_type\":\"openid\",\"member_id\":\"$user_id\",\"perm\":\"view\"}" \
    --as user
  sleep 1
done

# 产品组:可编辑
for user_id in "ou_ddd" "ou_eee"; do
  lark-cli drive permission.members create \
    --params '{"token":"<file_token>","type":"docx"}' \
    --data "{\"member_type\":\"openid\",\"member_id\":\"$user_id\",\"perm\":\"edit\"}" \
    --as user
  sleep 1
done

重要:

  • 设置 full_access 前必须与用户确认(安全规则)
  • 每次调用间隔至少 1 秒
  • 如果提示"无权限操作",需要确认当前用户是文档所有者或管理员

Step 4: 通知被授权用户

bash
lark-cli im +messages-send \
  --user-id "<user_open_id>" \
  --markdown "已为您开通文档「{文档标题}」的{权限级别}权限。

文档链接:{文档URL}

如有问题,请联系文档管理员。" \
  --as bot

注意:通知消息间隔 1 秒发送。如果授权人数超过 20 人,分批发送。

降级策略

场景降级方案
wiki 链接解析失败询问用户直接提供文档 token
用户查不到提示确认姓名,或直接使用 open_id
权限设置失败检查当前用户是否有文档管理权限
通知发送失败列出已授权用户,让用户手动通知
频率限制降低速度到每 2 秒一次

权限表

命令所需 scope
wiki spaces get_nodewiki:node:read
contact +search-usercontact:user.base:readonly
drive permission.members createdrive:drive:write
im +messages-sendim:message

参考

Frequently asked questions

What does the Lark Workflow Doc Perm AI skill do?

文档权限管家:批量设置飞书文档权限,按角色或人员批量授权(可编辑/只读/完整权限),通知被授权用户。当用户需要'设置文档权限'、'批量授权'、'文档权限管理'、'分享文档给团队'、'文档权限配置'、'把文档分享给XX'时使用。

Why use Lark Workflow Doc Perm on TypingMind?

Because you install it once and use it with any model. Lark Workflow Doc Perm is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lark Workflow Doc Perm in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/liangdabiao/lark-workflow-feishu-cli/tree/main/.claude/skills/lark-workflow-doc-perm. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Lark Workflow Doc Perm?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lark Workflow Doc Perm?

As many as you like. As long as a model supports skills, you can use Lark Workflow Doc Perm with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lark Workflow Doc Perm AI skill free?

It is published on GitHub by liangdabiao. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇