
Feishu Cli Read
Let your coding agent read Feishu/Lark cloud docs, wikis, and spreadsheets in Markdown for analysis without writing back to Feishu.
Overview
feishu-cli-read is an agent skill for the Build phase that read-only exports Feishu cloud docs, wikis, and sheets to Markdown in /tmp for agent analysis.
Install
npx skills add https://github.com/riba2534/feishu-cli --skill feishu-cli-readWhat is this skill?
- Read-only export for docx, sheets, and wiki nodes via document ID, token, or URL
- Markdown intermediate state in /tmp with optional image download—not a local file export unless you use feishu-cli-expor
- User-token-first auth chain so one feishu-cli auth login can read others’ docs without passing --user-access-token each
- Separate write and export skills: feishu-cli-write and feishu-cli-export for mutations and deliberate local saves
- Bash-scoped feishu-cli doc, wiki, sheet, and auth subcommands plus Read/Grep for in-agent analysis
- Supports ordinary docx, ordinary sheet, knowledge-base docx, and knowledge-base sheet read paths
- Read commands use a User-token-first with Tenant-token fallback resolution chain
Adoption & trust: 761 installs on skills.sh; 1.2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your spec or data lives in Feishu and your agent cannot reason over it without a safe, read-only CLI export path.
Who is it for?
Solo builders using Claude Code or Cursor who collaborate in Feishu and want the agent to inspect docs and sheets without accidental writes.
Skip if: Teams that need batch export to a project folder or automated doc updates—use feishu-cli-export and feishu-cli-write instead of this read skill.
When should I use this skill?
User requests 查看, 阅读, 分析, 读取, 打开, read, or view Feishu/Lark documents, wikis, or spreadsheets by ID, token, or URL.
What do I get? / Deliverables
After export, the agent can grep and summarize Feishu content in Markdown without modifying the source document—use feishu-cli-export or feishu-cli-write when you need files on disk or updates in Feishu.
- Markdown representation of Feishu content under /tmp for in-session analysis
- Optional downloaded images in a configured assets directory under /tmp
Recommended Skills
Journey fit
Canonical shelf is Build because solo builders wire agents to team knowledge bases and specs stored in Feishu during product work. Integrations fits CLI-driven export from doc, wiki, and sheet APIs as a read-only connector skill.
How it compares
Integration skill around feishu-cli read paths, not a generic web scraper or full document editor.
Common Questions / FAQ
Who is feishu-cli-read for?
Indie developers and small teams who store requirements and knowledge in Feishu and want their AI coding agent to read that material through an authenticated CLI workflow.
When should I use feishu-cli-read?
Use it during Build integrations work when someone says view, read, analyze, or open a Feishu document, wiki page, or spreadsheet; also when validating scope against a Feishu PRD in Validate or checking ops notes in Operate—all via the same read-only export.
Is feishu-cli-read safe to install?
It is read-only by design, but it still needs Feishu API access and shell execution; review the Security Audits panel on this Prism page and confirm your token scopes before installing.
Workflow Chain
Then invoke: feishu cli export, feishu cli write
SKILL.md
READMESKILL.md - Feishu Cli Read
# 飞书文档阅读技能 从飞书云文档、电子表格或知识库读取内容,转换为 Markdown 格式后进行分析和展示。普通电子表格使用 `sheet export --format markdown`,知识库 sheet 使用 `wiki export`。 ## 前置条件 - **feishu-cli**:如尚未安装,请前往 [riba2534/feishu-cli](https://github.com/riba2534/feishu-cli) 获取安装方式 - 已完成认证(`feishu-cli auth login`) - App 权限:需要 `docx:document` 或 `docx:document:readonly`(普通文档)、`wiki:wiki:readonly`(知识库) - **Token 解析(所有读命令通用)**:`doc export` / `wiki export` / `sheet export` 等读类命令统一走"User 优先 + Tenant 兜底"——优先用 token.json 里的 User Token,未找到回落 App Token。所以读他人文档时只要 `auth login` 一次,后续不用再传 `--user-access-token`。详见下方"User Token 优先级链"小节。 ## 核心概念 **Markdown 作为中间态**:本地文档与飞书云文档之间通过 Markdown 格式进行转换,中间文件存储在 `/tmp` 目录中。 ## 使用方法 ```bash feishu-cli doc export <document_id> --output /tmp/feishu_doc.md --download-images --assets-dir /tmp/feishu_assets feishu-cli wiki export <node_token_or_url> --output /tmp/feishu_wiki.md --download-images --assets-dir /tmp/feishu_assets feishu-cli sheet export <spreadsheet_token_or_url> --format markdown --output /tmp/feishu_sheet.md ``` ## 获取文档元信息(doc get) 读取文档基本信息(document_id、revision_id、title),用于在 export 之前确认目标、或拿 revision_id 作为后续 API 调用参数。同样走"User 优先 + Tenant 兜底"。 | Flag | 默认值 | 说明 | | --- | --- | --- | | `<document_id>` | 必填 | 文档 ID 或 URL(`https://xxx.feishu.cn/docx/<id>`) | | `-o, --output` | text | 输出格式,可选 `json` | | `--user-access-token` | 空 | 手动覆盖 User Token;不填则自动从 `~/.feishu-cli/token.json` 读取 | ```bash # 文本摘要 feishu-cli doc get ABC123def456 # JSON 输出(脚本里拿 revision_id / title) feishu-cli doc get ABC123def456 -o json # 从 URL 直接读 feishu-cli doc get https://xxx.feishu.cn/docx/ABC123def456 ``` ## 列出文档所有块(doc blocks) `doc export` 拿不到结构化块树时(例如要分析每个块的类型、定位特定块、查 raw API 响应),用 `doc blocks`。默认列出第一页(500 块),加 `--all` 自动分页拉完。 | Flag | 默认值 | 说明 | | --- | --- | --- | | `<document_id>` | 必填 | 文档 ID(不接 URL,请先 `doc get` 拿 ID) | | `--all` | false | 自动分页获取所有块(覆盖 `--page-size` / `--page-token`) | | `--page-size` | 500 | 单页块数量 | | `--page-token` | 空 | 续页 token | | `--document-revision-id` | -1 | 文档版本(-1 = 最新) | | `--raw` | false | 输出飞书 API 原始 JSON(含未解析字段) | | `--user-id-type` | open_id | 用户 ID 类型(open_id/union_id/user_id) | | `-o, --output` | text | 输出格式,可选 `json`(CLI 归一化结构) | | `--user-access-token` | 空 | 手动覆盖 User Token | ```bash # 默认:第一页,文本摘要 feishu-cli doc blocks ABC123def456 # 全量分页 + 归一化 JSON feishu-cli doc blocks ABC123def456 --all -o json # 拿 API 原始响应(含未识别块类型的 raw 字段) feishu-cli doc blocks ABC123def456 --all --raw > /tmp/blocks_raw.json ``` ## 知识库读类(wiki get / nodes / spaces) 知识库的"目录结构遍历三件套",配合 `wiki export` 完成"找到节点 → 读内容"的链路。三个命令都走"User 优先 + Tenant 兜底"。 ### wiki get — 查节点元信息 | Flag | 默认值 | 说明 | | --- | --- | --- | | `<node_token \| url>` | 必填 | 节点 Token 或 wiki URL | | `-o, --output` | text | 输出格式,可选 `json` | | `--user-access-token` | 空 | 手动覆盖 User Token | 返回字段:`space_id` / `node_token` / `obj_token`(用于文档 API) / `obj_type`(docx/sheet/bitable/...) / `title` / `has_child`。 ### wiki nodes — 列出空间或父节点的子节点 | Flag | 默认值 | 说明 | | --- | --- | --- | | `<space_id>` | 必填 | 知识空间 ID(由 `wiki get` 或 `wiki spaces` 得到) | | `--parent` | 空 | 父节点 Token;不填 = 列空间根节点 | | `--page-size` | 50 | 单页节点数量 | | `-o, --output` | text | 输出格式,可选 `json` | | `--user-access-token` | 空 | 手动覆盖 User Token | ### wiki spaces — 列出当前身份可见的所有知识空间 | Flag | 默认值 | 说明 | | --- | --- | --- | | `--page-size` | 50 | 单页空间数量 | | `-o, --output` | text | 输出格式,可选 `json` | | `--user-access-token` | 空 | 手动覆盖 User Token | ```bash # 1. 列空间 feishu-cli wiki spaces # 2. 看某节点信息,记下 space_id fei