lark-markdown

Installation
Summary

Markdown file operations for Feishu Drive: create, read, edit, patch, and compare native .md files.

  • Five core commands: create new files, fetch remote content, overwrite existing files, apply local text/regex patches, and diff versions or remote vs. local drafts
  • Patch operation downloads the full file, applies replacements locally, then re-uploads; supports single pattern-content pairs and rejects empty results
  • File names must explicitly include .md suffix; content input accepts strings, local files via @file, or stdin via -
  • Requires lark-cli binary and authentication via shared Feishu credentials; file management tasks like rename, move, delete, and permissions belong in lark-drive skill
SKILL.md

markdown (v1)

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

快速决策

  • 身份:Markdown 文件通常属于用户云空间资源,优先使用 --as user。如为自动化场景,或应用已创建并持有目标文件权限,可按场景使用 --as bot。首次以 user 身份访问前执行 lark-cli auth login

  • markdown +create / +overwrite 失败时,先判断是不是身份和权限问题:bot 更常见的是 app scope 或目标目录 ACL,user 更常见的是用户授权或用户 ACL;不要不加判断地来回切身份重试。

  • 用户要上传、创建一个原生 .md 文件,使用 lark-cli markdown +create

  • 用户要比较原生 .md 文件的历史版本差异,或比较远端 Markdown 与本地草稿,使用 lark-cli markdown +diff

  • 用户要读取 Drive 里某个 .md 文件内容,使用 lark-cli markdown +fetch

  • 用户要对 Markdown 文件做局部文本替换 / 正则替换,优先使用 lark-cli markdown +patch

  • 用户要覆盖更新 Drive 里某个 .md 文件内容,使用 lark-cli markdown +overwrite

  • 用户要先拿 Markdown 文件的历史版本号,再做比较/下载/回滚,先用 lark-drivelark-cli drive +version-history

  • 用户要把本地 Markdown 导入成在线新版文档(docx),不要用本 skill,改用 lark-drivelark-cli drive +import --type docx

  • 用户要对 Markdown 文件做rename / move / delete / 搜索 / 权限 / 评论等云空间(云盘/云存储)操作,不要留在本 skill,切到 lark-drive

  • markdown +create / +overwrite 命中 missing scopepermission deniednot foundversion limit 时,默认停止重试并按报错 hint 处理;只有 rate limit 或临时网络错误才做有限重试。

Installs
145.4K
Repository
larksuite/cli
GitHub Stars
14.1K
First Seen
Apr 30, 2026
lark-markdown — larksuite/cli