feishu-doc
Write, edit and read Feishu / Lark cloud docs (飞书云文档 on any feishu.cn / larksuite.com tenant) by driving the real editor, either in the user's logged-in ego browser or in a normal Google Chrome (Playwright, one-time login). Builds rich docs from Markdown — headings, lists, todos, native tables, coloured callouts (高亮块) with icons, N-column layouts (分栏), coloured text and labels, images, and editable native mind maps / flowcharts (Mermaid → 画板) — following a style guide distilled from Feishu's official templates — and edits, inserts or deletes blocks in existing docs without clobbering the user's edits. Use whenever the user asks to write or update a 飞书文档, put a report or 思维导图 into Feishu, or read what a Feishu doc currently says.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/golemkit--feishu-doc-yyds)HTML
<a href="/listings/golemkit--feishu-doc-yyds"><img src="/api/listings/golemkit--feishu-doc-yyds/badge.svg" alt="findsafeskills safety rating" /></a>Install
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 187 lines
- ---
- name: feishu-doc
- description: Write, edit and read Feishu / Lark cloud docs (飞书云文档 on any feishu.cn / larksuite.com tenant) by driving the real editor, either in the user's logged-in ego browser or in a normal Google Chrome (Playwright, one-time login). Builds rich docs from Markdown — headings, lists, todos, native tables, coloured callouts (高亮块) with icons, N-column layouts (分栏), coloured text and labels, images, and editable native mind maps / flowcharts (Mermaid → 画板) — following a style guide distilled from Feishu's official templates — and edits, inserts or deletes blocks in existing docs without clobbering the user's edits. Use whenever the user asks to write or update a 飞书文档, put a report or 思维导图 into Feishu, or read what a Feishu doc currently says.
- ---
- # feishu-doc
- There is no Feishu API access; this drives the real editor with the user's login. There are two engines, which share the same task format, ops and helpers:
- | engine | when | login |
- |---|---|---|
- | **ego** | `~/.local/bin/ego-browser` exists (ego lite installed) | the user's ego lite session |
- | **chrome** | everyone else: a normal Google Chrome / Edge / Chromium, driven by Playwright | log in once in the dedicated Chrome window |
- `run.sh` picks ego when it is installed and Chrome otherwise. Force one with `run.sh <task> --chrome` / `--ego`, or with `FEISHU_ENGINE=chrome|ego`. The ego engine was verified on 2026-11-18 and the Chrome engine on 2026-11-19 (macOS, Chrome 157): every op and rich block below works on both.
- ## How to run
- Use the directory containing this SKILL.md as SKILL_DIR. For Codex and DeepSeek Harness (dsh) pass --chrome explicitly. Claude Code can also use ego when its desktop terminal is available. See the [harness support table](README.md) and the [copyable chart gallery](references/gallery/showcase.md).
- 1. Write a task JSON to `/tmp/feishu-skill/<name>.json` (ASCII path).
- 2. Start it with `"$SKILL_DIR/scripts/run.sh" /tmp/feishu-skill/<name>.json --chrome`:
- - **ego**: replace --chrome with --ego. ego-browser fails from the Bash tool, so start it from `mcp__terminal__run_in_terminal` (the terminal rejects non-ASCII commands). Reuse the same tab for later jobs. Then, in the Bash tool, run `"$SKILL_DIR/scripts/wait.sh" /tmp/feishu-skill/<name>.json` (set timeout to 600000).
- - **chrome**: run it straight from the Bash tool (timeout 600000). It prints `done …` when finished. If it may wait for a login, run it with `run_in_background` and then `wait.sh`.
- 3. The log is `<name>.out`, one line per op: `[i] op ok …` or `FAILED: …`, ending with `EXIT n`.
- 4. Results are in `<name>.result.json`, plus `<name>.tree.txt`, `<name>.outline.json` and screenshots, depending on the ops.
- **ego:** ego lite must already be open (ask the user if `Failed to start ego lite`). The runner keeps one ego task space per doc URL in `/tmp/feishu-skill/state.json`, so the page stays loaded between jobs. It works in its own tab, and the user's open tab updates live. End the last job with `"finish": true`.
- **chrome:**
- - Needs Node 18+ and Chrome (or Edge or Chromium). On first use, `run.sh` runs `npm install` in the skill folder, which only installs `playwright-core`; no browser is downloaded.
- - The first job opens a **separate Chrome window**. It has its own profile (`~/.feishu-doc-chrome`) and a DevTools port (9333), and doesn't touch the user's normal Chrome.
- - If Feishu isn't logged in there, the log prints `LOGIN NEEDED`. Tell the user to log in in that window, by scanning the QR code with the Feishu app. The job waits up to 10 minutes and carries on.
- - The window stays open between jobs, so the login and the loaded doc are kept. `"finish": true` closes the doc's tab. If the user closed the window, the next job opens a new one (on macOS Chrome keeps running without a window, and Playwright can't attach until a tab exists).
- - Settings via env vars: `FEISHU_CHROME_PATH` (browser binary), `FEISHU_CHROME_PORT`, `FEISHU_CHROME_PROFILE`, `FEISHU_LOGIN_WAIT` (seconds) and `FEISHU_DEBUG=1`.
- - Without bash (Windows), run `node scripts/run-chrome.mjs <abs task.json>` from the skill folder, after `npm install`. Windows uses `End`, `Shift+Home` and `Control+z` instead of the Mac keys. This hasn't been tested on Windows yet.
- **Finding the doc:** when the user says they created or opened a doc, run `"$SKILL_DIR/scripts/recent_docs.sh"` in Bash. It lists recently visited Feishu doc URLs from the ego history and the feishu-doc Chrome profile. Otherwise, ask the user for the link.
- ## Task file
- ```json
- {
- "url": "https://your-company.feishu.cn/wiki/XXXX",
- "ops": [ { "op": "read" } ],
- "finish": false
- }
- ```
- Ops run in order and stop at the first failure. Set `"continueOnError": true` for batches of independent edits.
- | op | fields | does |
- |---|---|---|
- | `read` | — | Whole doc as an indented text tree → `<name>.tree.txt`. **Do this first** when updating a doc: the user often edits it by hand, so build on what is there now. |
- | `outline` | — | Top-level blocks `{id,type,text}` → `<name>.outline.json` |
- | `write` | `markdown` or `markdownFile`, `title?` | Fill a **new, empty** doc (refuses otherwise) |
- | `insert` | `after` (match, or `"end"`), `markdown`/`markdownFile` | New content after a **text or heading** block |
- | `edit` | `match`, `text` | Replace one block's text, keeping its type. Bold and other inline formatting are lost |
- | `replace` | `match`, `find`, `with` | Replace a substring inside one block. The rest of the block keeps its formatting. Prefer this for wording fixes |
- | `stripEmoji` | `match` | Remove a leading emoji (and the space after it) from a heading or paragraph |
- | `addAfter` | `match`, `text` | Add a sibling of the same type (bullet, todo…) |
- | `delete` | `match` | Delete one top-level block (image, whiteboard, paragraph). Checks that only that block went; undoes otherwise |
- | `setTitle` | `text` | Doc title |
- | `create` | — | New blank doc in the same wiki as `url`: header "+" → 文档 → 新建空白文档. Returns the new `url`; put it in the next task, starting with `setTitle` and `write`. |
- | `clearBody` | `confirm: "created-by-me"` | Select-all + delete in the body. **Only for a doc you created in this session** (scratch or test). Never use it on a doc the user wrote. |
- | `screenshot` | `match?`, `file?` | Screenshot, optionally scrolled to a block |
- | `shots` | `dir?` | Screenshot the whole doc page by page, for a final review |
- **Match** is the exact text of a block (`"六、下一步"`) or an object: `{ "type": "heading2", "text": "…" }`, `{ "startsWith": "…" }`, `{ "includes": "…" }`, `{ "id": "<record id from read/outline>" }`, `"topLevel": true`. The first match in the doc wins, so make it unique. Block types: `text heading1-9 bullet ordered todo quote_container callout grid grid_column table table_cell whiteboard image divider`.
- ## Markdown that converts
- Paste turns plain Markdown into native blocks: `#`–`######`, `-` lists (nest with 4 spaces), `1.`, `- [ ]` todos, `>` quote, `---` divider, `**bold**`, and `|` tables, which become native docx tables with equal column widths (bold the header cells yourself). Blank lines are stripped automatically; otherwise each one becomes an empty paragraph.
- Rich blocks are fenced. The runner leaves a placeholder for each, then fills them from the bottom up:
- ````markdown
- ```callout blue 💡
- **阶段结论**:…
- - 要点
- ```
- ```grid green 🌱 | blue 🎯 | orange 📌
- **左栏**
- - …
- ---col---
- **中栏**
- ---col---
- **右栏**
- ```
- ```mermaid
- mindmap
- root((中心主题))
- 分支
- 子节点 🟢 已上线
- ```
- 
- ````
- ### Colour, icons and columns
- Highlight blocks, column layouts, labels and coloured text are pasted as Feishu's own clipboard records (`scripts/lark.mjs`), so they keep colours and icons exactly, the way a copy between two Feishu docs does.
- - **Highlight block (高亮块)**: ```` ```callout <colour> <icon> [flat] ````. Colours: `blue green orange red yellow purple grey`. The icon is an emoji (💡 🎯 📌 🚀 ⚠️ 🚨 ✅ 👍 🌱 📈 📆 ⏰ 🏆 🧩 …) or a gemoji name (`bulb`, `dart`); an unknown one shows as 💡, `none` means no icon. `flat` removes the border. The default is `blue 💡`.
- - **Columns (分栏)**: ```` ```grid <spec> | <spec> | … ```` with the columns separated by `---col---`. Any number of columns works; 2 to 4 read well. Each spec is a highlight-block spec, or `plain` for a column without a box, plus an optional width such as `40%`. If there are fewer specs than columns, the last one repeats.
- - **Coloured text**: `{red:文字}`. **Highlight**: `{bg-green:文字}`, or `==文字==` for yellow. Both nest with bold: `{bg-green:**做得好的**}`. Links: `[文字](https://…)`.
- - **Label**: a line that is only `{{green:竞品名称}}` becomes a centred, bold label on a coloured background. Use it as a column header in a `plain` grid, as the official 分析报告 template does.
- - Limits:
- - Feishu doesn't allow tables inside a highlight block, so a table there is dropped. Put tables in a `plain` grid column or in the body.
- - Coloured markup in table cells is removed, keeping the text.
- - A list item with colour markup is pasted on its own and loses its nesting, so keep coloured list items top-level.
- - Markdown `>` quotes are also pasted as records, because a line right after a Markdown quote gets swallowed into it.
- ### Diagrams and images
- - Mermaid becomes an **editable 画板** whiteboard; double-clicking it opens the full-size view. Inside `mindmap` node text, use full-width ()【】: instead of ASCII `()[]{}:"`, which Mermaid treats as syntax. Emoji and `→` are fine. About 90 nodes rendered fine.
- - **Which Mermaid types render** (tested 2026-11-18): `mindmap`, `flowchart` (including `subgraph` for layered architecture), `pie`, `gantt`, `timeline`, `sequenceDiagram`, `stateDiagram-v2`, `classDiagram` and `erDiagram` become whiteboards. `quadrantChart`, `xychart-beta` (bar/line), `sankey-beta` and `journey` stay **plain code blocks**, so don't use them. For those charts, render HTML to PNG with headless Chrome (`--screenshot --force-device-scale-factor=2`) and insert the image with ``; see `references/matrix-png-example.py`.
- - `gantt` comes out small and is only readable after double-clicking. `timeline` and `pie` read well inline.
- - The doc column is about 820 px wide and a whiteboard scales its diagram down to fit it, so a long `flowchart LR` chain (more than 4 or 5 nodes) or a wide `sequenceDiagram` ends up with tiny text. For a process with stages, use `flowchart TB` with one `subgraph` per stage. Keep sequence participants to 5 or fewer, with short names and labels. `classDef` fill colours carry over to the whiteboard.
- - To replace a diagram: `insert` the new one, take a screenshot to compare, then `delete` the old whiteboard by id. Delete the empty paragraphs left around it too.
- - An HTML `<table>` would become an embedded spreadsheet, so use Markdown tables.
- ## Style guide
- Distilled on 2026-11-19 from 13 of Feishu's official templates: 双月业务总结, 项目复盘, GRAI 复盘, 团队周报, OKR 周报, 年度规划, PRD, 设计汇报, 工作汇报, 会议纪要, 产品分析报告 and others. Their structure, colours and screenshots were all read with this skill. Ready-made skeletons are in `references/templates/`: `report.md` 阶段总结/双月汇报, `review.md` 项目复盘, `meeting.md` 会议纪要, `weekly.md` 周报 and `plan.md` 方案/PRD.
- **Structure**
- - Open with what the reader needs first: either a one-line grey `>` quote saying what the doc is for, or a conclusion callout (blue). In formal docs, add an info row under it: a key-value table (汇报时间 / 汇报人 / 相关资料) or a `grid grey ⏰ flat | grey 📆 flat | grey 👤 flat` row for 版本 / 日期 / 负责人.
- - Number top-level headings `一、` `二、`, and second-level ones `1.1` or `1.`. Use at most three levels and about 4 to 8 top-level sections.
- - Put one grey `>` line under each top-level heading saying what the section covers ("记录并深入分析项目中出现的核心问题"). It is the most consistent pattern across the templates.
- - Keep sections short: 2 to 5 bullets each, one fact per bullet, with a bold lead-in where it helps (`**问题成因**:…`).
- - Separate the big parts of a long report (已完成 / 进行中 / 未来规划) with `---`.
- **Colour means something** (the same in every template):
- | colour | use for | typical icons |
- |---|---|---|
- | blue | method, explanation, background, conclusion | 💡 🎯 📝 |
- | green | results, goals, what went well, strengths | ✅ 👍 🌱 ⛳ |
- | orange | plans, in progress, things to watch, P0 | 📌 📈 ⏰ |
- | red | risks, problems, threats | 🚨 ⚠️ |
- | yellow | opportunities, highlights | 🚀 ✨ |
- | grey (`flat`) | meta info: version, date, owner, reviewer | 📆 ⏰ 👤 |
- Pick the icon for the content, not for decoration, and keep one colour per meaning throughout the doc.
- **Recurring blocks worth copying**
- - Data cards: `grid` with 3 columns, each `#### 数字` plus a grey caption line (`{grey:…}`).
- - Comparisons: a `plain` grid of 3 or 4 columns, each topped by a `{{colour:标签}}` label followed by a short list (竞品 / 行业数据 / 文档链接; 优势 / 劣势 / 未来方向).
- - SWOT: two 2-column grids: `green 👍 | blue 🗻` (S/W), `yellow 🚀 | red 🚨` (O/T).
- - Priorities: `grid orange 📌 | green 🌱 | blue 🎣` for P0 / P1 / P2, with to-dos inside.
- - Reviews: `{bg-green:**做得好的**}` / `{bg-red:**有待提升**}` lead-ins. For each problem, three bullets: 问题成因 / 深入反思 / 后续计划.
- - Tables for structured records: project cards (项目 / 背景 / 重点解决问题 / 进展), change log (时间 / 版本 / 变更人 / 变更内容), glossary, members and roles. Status goes in a cell as 🟢 已上线 / 🔵 内测 / 🟡 验证中 / 🟠 原型.
- - One diagram per major section at most (mind map for an overview, `flowchart TB` + subgraphs for architecture, `timeline` for milestones).
- **Tone.** Don't make it feel AI-written:
- - No emoji in headings, no "TL;DR", no "一句话:" lead-ins, no jargon like "builder" or "证据".
- - Write plain statements in the team's own words.
- - Templates use placeholders like "......" for unfilled items. Never leave those in a finished doc.
- **No real personal names** in docs meant for reporting, except a public figure being quoted (e.g. 李彦宏). Use roles instead: 部门负责人, 业务方, 组员, 大会嘉宾. Check headings, tables, diagram labels and mind map nodes too. Text inside a whiteboard can only be fixed by re-inserting the diagram.
- What the templates use that this skill can't create (yet): AI 摘要 blocks, 同步块, embedded 多维表格, polls, @mentions and date reminders, a cover image and a title icon. Leave them for the user to add by hand when they matter.
- ## Rules learned the hard way
- - **Never Cmd+A in the body**: if the caret misses its block it selects the whole doc, and Backspace wipes it (it happened once). Every helper checks which block the caret is in before deleting anything. Keep it that way if you extend `scripts/lib.mjs`.
- - Feishu's clipboard HTML carries a `data-lark-record-data` JSON of block snapshots (type, colours, `emoji_id`, text with an attribute pool for bold / `textHighlight` / `textHighlightBackground` / `link`). Pasting such data recreates the blocks. `lark.mjs` builds it; to learn the format of another block type, copy that block from a read-only doc (Cmd+A / Cmd+C) and read the clipboard with `osascript -e 'the clipboard as «class HTML»'`.
- - macOS: `End`/`Home` don't move the caret, and `Shift+Home` selects up to the **start of the doc**. Use `Meta+ArrowRight` / `Shift+Meta+ArrowLeft`. `lib.mjs` picks the keys per platform (`KEYS`).
- - Feishu updates its selection asynchronously. Playwright types much faster than ego, so a key pressed right after a click can act on the old caret. Wait briefly, and check `getSelection()` before deleting (as `focusSlot` does).
- - Chrome engine: paste is a synthetic `ClipboardEvent` carrying the text/html, and Feishu converts it like a real paste (Markdown, Mermaid → whiteboard). Images are pasted as a `File` the same way, because `/图片` in Chrome raises no file chooser that Playwright can intercept.
- - After the body is cleared, focus jumps to the title, so typed text lands there.
- - The doc is virtualized; `find()` scrolls to locate off-screen blocks. Whiteboards resize as they load, so fill placeholders from the bottom up (the runner does).
- - A list block's `innerText` includes its "•"; compare the `.zone-container` text.
- - Column widths can't be dragged by script; ask the user to adjust them.
- - Confirm with the user before deleting or rewriting content they wrote. Prefer `insert`, `edit` and `addAfter`.
- - Keep credentials, internal IPs and similar out of docs (documents get shared).
- - Feishu screenshots (`shots`, `screenshot`) carry a tiled watermark with the viewer's name and employee number. Use them only to check your own work. Never put them in a README, a public repo, a post or anything shared outside the company. For public images, draw a mock-up (HTML → headless Chrome) with made-up data.
- ## Extending
- To add an op, edit `scripts/runner.mjs` (the `OPS` table). Helpers live in `scripts/lib.mjs`: `find`, `clickEnd`, `caretInfo`, `slash`, `pasteRich`, `paragraphAfter`, `editText`, `addAfter`, `deleteBlock`, `tree`. They take a small ego-style Page (`evaluate`, `mouse`, `keyboard.press/type/paste`, `screenshot`…). `scripts/chrome.mjs` wraps a Playwright page in that API, so a helper written once runs on both engines.
- For a one-off action, write an ad-hoc script that imports `lib.mjs`. For Chrome, the script gets its page from `openDoc({url})` in `chrome.mjs`; run it with node from the skill folder, which is where `playwright-core` lives. See `references/example-task.json` for a full build.
- **Sharing the skill:** copy the `feishu-doc` folder without `node_modules` into the other person's `~/.claude/skills/`. If they don't have ego, it uses Chrome automatically.
- Files: `scripts/run.sh` (engine choice), `runner.mjs` (ops), `lib.mjs` (Feishu helpers), `lark.mjs` (Markdown → Feishu clipboard records: colours, icons, columns), `chrome.mjs` + `run-chrome.mjs` (Chrome engine), `wait.sh`, `recent_docs.sh`, `package.json`.
README.md · README · 115 lines
- # 谁懂啊😭 一句话让 Claude 写出大厂级飞书文档,领导以为我通宵了
- > 思维导图、彩色高亮块、四栏数据卡、架构图、时间线……全是飞书**原生可编辑**的,不是截图!
- > 打工人写周报、复盘、阶段总结直接起飞🚀
- 
- `feishu-doc` 是一个 [Claude Code](https://claude.com/claude-code) skill。它不用飞书 API,直接操作网页上的飞书编辑器,用的是你自己的登录,所以你能编辑的文档它都能写。
- ## 复制这段,让 AI 安装
- 把下面整段发给 Claude Code、Codex 或具备本地终端工具的 DeepSeek Harness(dsh):
- ```text
- 请为当前 agent 安装 https://github.com/golemkit/feishu-doc-yyds 的 feishu-doc skill(SKILL.md 在仓库根目录)。优先使用当前 harness 的 skill 安装器;没有安装器就将仓库放到此 harness 实际读取的 skills 目录下,目录名 feishu-doc。已有同名安装先检查来源与本地改动,不要直接覆盖。如果 dsh 未配置技能发现目录,可以保留独立 checkout 并告诉我以后如何显式引用 SKILL.md。检查 Node.js 18+、npm 和 Chrome/Edge/Chromium 是否可用,在安装目录按 package-lock.json 用 npm ci 安装依赖。报告实际安装路径、调用方法,以及是否需要新开会话。安装到此结束,不创建或修改飞书文档。
- ```
- | Harness | 如何调用 | 验证情况 |
- | --- | --- | --- |
- | Claude Code | 有桌面终端且已安装 ego 时可用 ego;普通终端用 Chrome | 原开发环境;项目已记录两种引擎的 macOS 验证 |
- | Codex | 从安装目录运行 `bash scripts/run.sh /绝对路径/task.json --chrome` | 已在 macOS 写入并回读分栏卡片、表格和画板 |
- | DeepSeek Harness | 让有终端工具的会话读取安装目录中的 `SKILL.md`,显式传 `--chrome` | 桌面版已读技能并连接飞书;模型上游超时,完整写入尚未验收。headless 需要可用的模型凭据 |
- **第一次写入:** 新建一份可编辑的空白飞书文档,复制链接,告诉 AI:「用 feishu-doc 把仓库的 `references/gallery/showcase.md` 写到这个链接,完成后回读,确认有一个三栏布局和三张画板。」按需在技能的独立 Chrome 窗口登录。
- ## 图表样本册:一组需求,四种看法
- 
- [复制整份飞书示例源码](references/gallery/showcase.md)。以下为同一组虚构数据的本地插图与 GitHub Mermaid 预览;飞书中的实际样式由编辑器决定。
- | 想回答的问题 | 推荐形式 | 读图提示 |
- | --- | --- | --- |
- | 做完了多少? | 三栏数字卡 | 6 项已交付、4 项设计中、2 项待验收 |
- | 哪个状态占多数? | 饼图 | 已交付占 12 项中的一半 |
- | 谁接下一棒? | 带回路的流程图 | 评审通过进入验收;修改退回原型 |
- | 何时做了决定? | 时间线 | 只放改变项目走向的节点 |
- ```mermaid
- pie showData
- title 12 项需求的去向
- "已交付" : 6
- "设计中" : 4
- "待验收" : 2
- ```
- ```mermaid
- flowchart LR
- A[绘制原型] --> B{设计评审}
- B -->|通过| C[交付验收]
- B -->|修改| A
- C --> D[发布]
- classDef stage fill:#dff7f0,stroke:#319981,color:#103f35
- class A,C,D stage
- ```
- ```mermaid
- timeline
- title 夜航计划 · 三个决策点
- 03 月 04 日 : 确定首批需求
- 03 月 11 日 : 完成原型评审
- 03 月 18 日 : 发布首批功能
- ```
- ## 🎨 写法速查
- ````markdown
- ```callout green ✅
- **阶段结论**:本季度上线 3 个功能,{green:交付周期缩短一半}
- ```
- ```grid grey 📈 | grey 🚀 | grey ⏰
- #### 12 项
- {grey:沉淀的基础能力}
- ---col---
- #### 3 个
- {grey:上线的新功能}
- ---col---
- #### 1 周
- {grey:平均交付周期}
- ```
- ```grid plain | plain
- {{green:优势}}
- - 响应快
- ---col---
- {{red:劣势}}
- - 人手不足
- ```
- - {bg-green:**做得好的**} 需求 2 天出原型
- - {bg-red:**有待提升**} 文档沉淀不足
- ```mermaid
- mindmap
- root((项目全景))
- 能力 A
- 工作 1 🟢 已上线
- ```
- ````
- 颜色:`blue green orange red yellow purple grey`。完整说明见 [SKILL.md](SKILL.md)。
- ## 🧩 原理(给好奇宝宝)
- 飞书在文档之间复制粘贴时,剪贴板里带着每个块的完整数据(类型、颜色、图标、列宽)。这个 skill 把 Markdown 编译成同样的格式再粘贴进去,所以出来的就是飞书原生的块,不是图片也不是表格嵌入。Mermaid 会被飞书转成可编辑画板,图片走粘贴上传。
- ## ⚠️ 注意
- - 只在 macOS 上完整测过,Windows 还没实测(按键已经适配)
- - 表格列宽、分栏宽度不能自动拖,需要手动调
- - 画板里的文字改不了,只能重新插入一张图
- - 不会删除整篇文档;改别人写的内容前会先问你
- - 链接打不开时会直接说明原因(文档已删除、没有权限、链接不存在),不会误报成未登录
- - 用的是你自己的飞书登录,请遵守所在公司的数据和安全规定。这不是飞书官方工具
- ## 📄 许可
- [MIT](LICENSE):随便用、随便改、随便分享,保留版权声明就行。
scripts/recent_docs.sh · Bundled script · 22 lines · 1 finding marked
- #!/bin/bash
- # Lists Feishu docs recently opened in ego lite and/or the feishu-doc Chrome profile
- # (to find the URL of a doc the user just created or opened). Usage: recent_docs.sh [limit]
- N="${1:-15}"
- for H in "$HOME/Library/Application Support/Citro Labs/ego lite/Profile 1/History" \
- "${FEISHU_CHROME_PROFILE:-$HOME/.feishu-doc-chrome}/Default/History"; do
- [ -f "$H" ] || continue
- TMP=$(mktemp /tmp/feishu-hist-XXXXXX)
- cp "$H" "$TMP" || continue
- sqlite3 "$TMP" "select last_visit_time, datetime(last_visit_time/1000000-11644473600,'unixepoch','localtime'), url, title from urls where (url like '%feishu.cn/%' or url like '%larksuite.com/%') and (url like '%/wiki/%' or url like '%/docx/%') order by last_visit_time desc limit $N;"
- rm -f "$TMP"
- done | sort -t'|' -k1,1nr | python3 -c "
- import sys,re
- seen=set(); n=0
- for line in sys.stdin:
- _,t,u,ti=(line.rstrip('\n').split('|',3)+['','',''])[:4]
- u=u.split('?')[0]
- if u in seen: continue
- seen.add(u); n+=1
- if n>$N: break
- ti=re.sub(r'[---]','',ti)
- Note: Usual in code (characters a sanitizer strips): Contains 2 bidirectional-override character(s), which make text display in a different order from how it's read
- Line 21 on GitHub
- print(t,u,ti,sep=' ')"
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.