
Lark Markdown
FreeManage Markdown files in Lark Drive efficiently.
Free · Opens the source repo
What Lark Markdown does
Lark Markdown is a command-line skill designed for users who need to create, edit, upload, and compare Markdown files within Lark Drive. This skill provides a set of commands that streamline the process of handling Markdown documents, making it easier for developers and designers to manage their documentation workflow. With commands like +create, +diff, +fetch, +patch, and +overwrite, users can perform a variety of file operations directly from the CLI, which enhances productivity and simplifies the interaction with Markdown files.
The skill is particularly useful for those who frequently work with Markdown files stored in Lark Drive. It allows users to create new Markdown files, fetch existing ones, and compare different versions to track changes effectively. The +patch command enables users to perform localized text replacements within Markdown files, which can be a significant time-saver when making updates. Additionally, the +diff command helps users understand the changes made between different versions of a file, ensuring that they can maintain accurate documentation.
However, it is important to note that Lark Markdown does not handle operations related to converting Markdown to other formats like docx, nor does it manage file permissions, comments, or other cloud storage management tasks. Users must rely on the Lark Drive skill for those functionalities. This skill is ideal for users who are comfortable with command-line interfaces and need a reliable way to manage Markdown files without the overhead of a graphical user interface.
In summary, Lark Markdown is a focused tool for Markdown file management within Lark Drive, providing essential commands for creation, editing, and comparison while leaving broader file management tasks to other skills.
When to use it
Use Lark Markdown when you need to create, edit, or compare Markdown files directly in Lark Drive from the command line.
When not to use it
This skill is not suitable for converting Markdown files to other formats or for managing file permissions and comments.
What you can build with it
Creating a Markdown File
Use the `lark-cli markdown +create` command to create a new Markdown file in Lark Drive.
Comparing Markdown Versions
Utilize the `lark-cli markdown +diff` command to compare changes between different versions of a Markdown file.
Fetching Existing Markdown Files
Fetch the content of an existing Markdown file from Lark Drive using the `lark-cli markdown +fetch` command.
How to install Lark Markdown
View source1. Install with the skills CLI
npx skills add larksuite/cli/lark-markdown --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by larksuitemarkdown (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-drive的lark-cli drive +version-history -
用户要把本地 Markdown 导入成在线新版文档(docx),不要用本 skill,改用
lark-drive的lark-cli drive +import --type docx -
用户要对 Markdown 文件做rename / move / delete / 搜索 / 权限 / 评论等云空间(云盘/云存储)操作,不要留在本 skill,切到
lark-drive -
markdown +create/+overwrite命中missing scope、permission denied、not found、quota_exceeded、version limit时,默认停止重试并按报错 hint 处理;只有rate_limit、server_error或临时网络错误才做有限退避重试。 -
markdown +create的目标参数不要猜:Drive 文件夹用--folder-token,Wiki 节点用--wiki-token。如果用户给的是 URL,可以直接传完整 URL;CLI 会归一成 token。不要把 doc/sheet/wiki URL 放进--folder-token试错。
核心边界
- 本 skill 处理的是 Drive 中作为普通文件存储的 Markdown,不是 docx 文档
--name和本地--file文件名都必须显式带.md后缀;不满足时 shortcut 会直接报错--content支持:- 直接传字符串
@file从本地文件读取内容-从 stdin 读取内容
markdown +patch的内部语义是:先完整下载 Markdown,再本地替换,再整文件覆盖上传markdown +patch不是服务端原子 patch;它是 CLI 侧编排出来的局部更新能力markdown +patch当前只支持单组--pattern/--contentmarkdown +patch替换后的最终内容不能为空;CLI 会拒绝上传空文件,因为 Drive 不支持零字节 Markdown,且空文件通常是误操作--file只接受本地.md文件路径
正则替换时要特别注意 --pattern 的转义:
# BAD: 未转义正则特殊字符,可能匹配到错误位置
lark-cli markdown +patch --file-token boxcnxxxx --regex --pattern "version (1.0)" --content "version (2.0)"
# GOOD: 显式转义括号和点号
lark-cli markdown +patch --file-token boxcnxxxx --regex --pattern "version \\(1\\.0\\)" --content "version (2.0)"
Shortcuts(推荐优先使用)
Shortcut 是对常用操作的高级封装(lark-cli markdown +<verb> [flags])。有 Shortcut 的操作优先使用。
| Shortcut | 说明 |
|---|---|
+create | Create a Markdown file in Drive |
+diff | Compare two remote Markdown versions, or compare remote Markdown against a local file |
+fetch | Fetch a Markdown file from Drive |
+patch | Patch a Markdown file in Drive via fetch-local-replace-overwrite |
+overwrite | Overwrite an existing Markdown file in Drive |
参考
- lark-shared — 认证和全局参数
- lark-drive — Drive 文件管理、导入 docx、move/delete/search 等
Frequently asked questions about Lark Markdown
Similar skills
Slidev
Create interactive web-based presentations with Markdown.
Axiom
Audit your assumptions for clearer decision-making.
2slides Presentation Generation
Generate professional presentations with AI.
Performance Review Writer
Draft personalized performance reviews effortlessly.
Legal Team Briefing
Generate contextual briefings for legal workflows.
Search
Efficiently find documents and discussions across connected sources.
