Skip to content

Releases: riba2534/feishu-cli

v1.11.0

18 Mar 17:04

Choose a tag to compare

What's New

New Features

  • Device Flow Authentication (RFC 8628): auth login --method device — no redirect URL configuration needed, supports --scopes
  • Direct file/image sending: msg send --file <path> / msg send --image <path> — auto-upload and send in one step
  • Multipart upload for large files: file upload automatically uses chunked upload for files >20MB
  • User Token passthrough for exports: doc export, wiki export, doc export-file now support --user-access-token for accessing user-authorized documents

Bug Fixes

  • sheet style: Rename BgColor to BackColor to match Feishu API field name
  • wiki create: Separate --node-type (origin/shortcut) from --obj-type (docx/doc/sheet)
  • QuoteContainer export: Skip empty text children to avoid spurious > lines
  • wiki export: Pass User Access Token through to block fetching (was only passed to node info)
  • perm commands: Accept IM API style member type aliases (open_id, user_id, chat_id, union_id)
  • Device Flow --scopes: Now correctly passed to the authorization request (was silently ignored)
  • IM upload: Add file size pre-check (30MB file / 10MB image) and use 5-minute timeout
  • msg send: Output upload progress to stderr to avoid polluting --output json
  • doc export: Unify file permission to 0600

Skills Updated

  • feishu-cli-auth, feishu-cli-msg, feishu-cli-export, feishu-cli-perm, feishu-cli-toolkit

Full Changelog: v1.10.0...v1.11.0

v1.10.0

18 Mar 15:12

Choose a tag to compare

What's Changed

Breaking Change: User Token Required for msg/chat Commands

11 msg/chat commands now require User Token (previously optional):

  • msg get, msg list, msg history, msg pins, msg pin, msg unpin
  • msg reaction add/remove/list, msg delete, msg search-chats
  • chat get, chat update, chat delete, chat member list/add/remove

Run feishu-cli auth login with updated scopes to use these commands.

New: feishu-cli-chat Skill

New Claude Code skill covering session browsing, message interaction (Reaction/Pin/delete/get), and group management — all under User Token.

Auto-Fallback for msg history

When User Token list API returns empty results for groups where the bot is absent, CLI automatically degrades to search+get mode transparently.

Skill Documentation Sync

Updated 8 skill SKILL.md files:

  • auth: Three-tier Token classification, added im:chat:readonly + im:chat.members:read scopes
  • msg: Slimmed to send-only, Reaction/Pin/delete redirected to chat skill
  • chat: New skill with full permission table
  • search: Added scopes + cross-skill routing table
  • toolkit: Clarified module 4 as "群聊创建"
  • write/import/perm: Clarified App Token usage

v1.9.0

15 Mar 07:37
e9b263a

Choose a tag to compare

What's New

  • feat: Support User Access Token for doc export — automatically reads saved User Token from auth login, enabling export of documents the App has no access to (e.g., documents owned by others) (#33, by @mojitote)
  • refactor: Extract resolveOptionalUserTokenWithFallback helper for consistent token resolution pattern
  • docs: Update skills and README with User Token usage, error codes (1770032/99991679), and --user-access-token flag

Usage

# Export with App Token (default)
feishu-cli doc export <doc_id> -o output.md

# Export others' documents (auto-reads User Token from auth login)
feishu-cli doc export <doc_id> -o output.md

# Or specify User Token explicitly
feishu-cli doc export <doc_id> -o output.md --user-access-token <token>

Install

curl -fsSL https://raw.githubusercontent.com/riba2534/feishu-cli/main/install.sh | bash

v1.8.2

10 Mar 18:00

Choose a tag to compare

Changes since v1.8.1

Bug Fixes

  • search-chats: Use Search API for server-side filtering instead of List API with client-side filtering, fixing missing results when matching chats are on later pages (4d4f20b)
  • msg list/history: Support User Access Token via raw HTTP request, bypassing Go SDK's incorrect token type validation that rejects user_access_token (bf44e6c)
  • OAuth scope names: Correct im:chat:readonlyim:chat:read, remove non-existent search:app, add drive:drive.search:readonly and im:chat:read (bf44e6c)
  • CGO disabled: Add CGO_ENABLED=0 to all cross-compilation targets for statically linked binaries (9ac8767)

Documentation

  • Add Bot vs User identity guide and --user-access-token examples to feishu-cli-msg skill (c3772db)
  • Add board image node guide and clone workflow (46463f5)
  • Add p2p search guide and im:message.group_msg:get_as_user scope (5f13af9)
  • Add skills install instructions to README (9ac8767)

v1.8.1

09 Mar 12:59

Choose a tag to compare

Bug Fix

  • fix(auth): prefer App Token over User Token for optional commands
    • resolveOptionalUserToken 不再自动从 token.json 加载 User Token
    • 能用 App Token 的 API 默认使用 App Token(租户身份),避免因 User Token scope 不足导致 99991679 Unauthorized 错误
    • 仅通过 --user-access-token 参数或 FEISHU_USER_ACCESS_TOKEN 环境变量显式指定时才使用 User Token
    • 搜索命令(search docs/messages/apps)不受影响,仍自动从 token.json 加载

文档更新

  • 更新 CLAUDE.mdfeishu-cli-auth 技能、feishu-cli-toolkit 搜索参考文档,统一 Token 使用策略描述

v1.8.0

09 Mar 05:02

Choose a tag to compare

What's New

OAuth 认证系统

  • auth login — 支持自动浏览器、手动模式(--manual)、非交互模式(--print-url + auth callback,AI Agent 推荐)
  • auth status — 查看授权状态,支持 -o json 输出
  • auth logout — 退出登录
  • Token 自动刷新(Refresh Token 30 天有效期)
  • Token 优先级链:命令行参数 > 环境变量 > token.json > config.yaml

搜索功能

  • search docs — 文档搜索,支持类型过滤(--docs-types)、分页(--count/--offset)
  • search messages — 消息搜索,支持群聊/用户/时间范围过滤
  • search apps — 应用搜索
  • 所有搜索 API 使用 User Access Token(通过 auth login 获取)

画板精排绘图

  • board create-notes — JSON 精确控制节点坐标、颜色、连线,适合架构图和看板
  • board import — Mermaid/PlantUML 代码自动渲染(服务端排版)
  • board nodes — 获取画板所有节点
  • board image — 下载画板截图

图片上传管道

  • doc import --upload-images — 自动上传本地和网络图片到飞书
  • --image-workers 参数控制并发(默认 2,API 限制 5 QPS)
  • 集成到三阶段并发导入管道

AI 技能扩展(8 → 11 个)

  • 新增 feishu-cli-auth — OAuth 认证、Token 管理、scope 配置
  • 新增 feishu-cli-search — 搜索文档/消息/应用(含 Token 前置检查流程)
  • 新增 feishu-cli-board — 画板精排绘图/Mermaid 导入/截图/节点管理

其他改进

  • User Access Token 支持统一到所有命令(wiki/task/calendar/msg)
  • Callout 导入修复:重用 API 生成的空子块,避免重复创建
  • AddOns/TextDrawing 导出:自动还原为 Mermaid/PlantUML 代码块
  • PNG 临时文件泄漏修复
  • install.sh 临时目录清理修复
  • 权限 scope 映射修正(12 处)

Contributors

感谢所有贡献者的 PR!

v1.7.0

02 Mar 03:20

Choose a tag to compare

新功能

  • 表格列数超限自动拆分:飞书 API 限制单个表格最大 9 行 × 9 列,此前仅实现行拆分。现新增列拆分,超过 9 列的 Markdown 表格自动拆分为多个子表格,保留首列作为标识列
  • 支持复合拆分:同时超过 9 行和 9 列时,先列拆分再行拆分

文档更新

  • API 限制表补充列数限制、文件夹子节点上限(1500)、文档块总数上限
  • 技能文件同步更新表格拆分说明

v1.6.0

27 Feb 08:52

Choose a tag to compare

新功能

补全飞书 SDK 缺失接口,新增 46 个 CLI 命令,覆盖 7 大模块:

Permission 模块

  • perm list — 查看协作者列表
  • perm delete — 删除协作者
  • perm public-get/public-update — 公共权限查询/更新
  • perm password create/update/delete — 文档密码管理
  • perm batch-add — 批量添加协作者
  • perm auth — 权限判断
  • perm transfer-owner — 转移文档所有权

Drive 模块

  • file download/upload — 文件下载/上传
  • doc export-file/import-file — 异步导出/导入(PDF/DOCX/XLSX)
  • file version list/create/get/delete — 文件版本管理
  • file meta — 批量获取文件元数据
  • file stats — 文件访问统计

IM 模块

  • chat create/get/update/delete/link — 群聊 CRUD
  • chat member list/add/remove — 群成员管理
  • msg merge-forward — 合并转发
  • msg reply — 回复消息
  • msg reaction add/remove/list — 表情回复
  • msg pin/unpin/pins — 消息置顶

Calendar 模块

  • calendar get/primary — 日历查询
  • calendar event-search/event-reply — 日程搜索/回复
  • calendar attendee add/list — 参与人管理
  • calendar freebusy — 忙闲查询

Task 模块

  • task subtask create/list — 子任务管理
  • task member add/remove — 任务成员管理
  • task reminder add/remove — 提醒管理
  • tasklist create/get/list/delete — 任务清单(新顶级命令)

Wiki 模块

  • wiki space-get — 知识空间详情
  • wiki member add/list/remove — 空间成员管理

Contact 模块

  • user search — 邮箱/手机号查询用户 ID
  • user list — 部门用户列表
  • dept get/children — 部门信息/子部门(新顶级命令)

Bug 修复

  • 12 处 resp.Data nil 指针保护
  • export/import 轮询逻辑修复(仅终态失败才返回 error)
  • 3 处 strings.Split 替换为 splitAndTrim 防止空元素
  • root.go PersistentPreRunE 改用 HasSubCommands 判断,修复子命令命名冲突
  • 新增 batch-add JSON 字段验证、task member role 验证

v1.5.0

12 Feb 19:38

Choose a tag to compare

新功能

  • 导出 @用户展开:导出时 @[user:ou_xxx] 自动解析为 [@姓名](mailto:邮箱) 格式(--expand-mentions,默认开启)
  • 画板 PNG 导出--download-images 同时将画板导出为本地 PNG 图片
  • 9 种新块类型导出:Agenda、LinkPreview、SyncBlock、WikiCatalogV2、AITemplate 等
  • 未知块类型可读注释<!-- 不支持的块类型: WikiCatalog (type=42) -->

Bug 修复

  • 修复 Callout 内容丢失:CAUTION/IMPORTANT Callout 导入时因 429 限流内容丢失
  • 修复嵌套列表丢失:混合嵌套列表子项导入时因 429 限流静默丢失

重构

  • 统一重试机制:新增泛型重试框架 DoWithRetry[T],统一 6 处手写重试循环
    • 退避策略:full jitter + 服务端 x-ogw-ratelimit-reset header
    • Phase 1 顶层块创建和嵌套子块创建均加入 429 重试保护
    • 支持 context.Context 取消

安装

curl -fsSL https://raw.githubusercontent.com/riba2534/feishu-cli/main/install.sh | bash

v1.4.2

06 Feb 19:56

Choose a tag to compare

修复 doc add Markdown 模式

  • 嵌套列表支持:改用 BlockNode 树结构 + 递归创建,不再打平丢失层级
  • 50 块分批处理:支持大文档,避免 API 限制报错
  • 表格填充 429 重试:最多 5 次指数退避,提升稳定性
  • 成功计数修正:输出实际成功/失败数,JSON 模式含完整统计
  • 代码风格统一:去掉 log.Printf,魔法数字改为常量引用