lark-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLark CLI
Lark CLI
This skill uses the CLI to operate Feishu/Lark products (IM, Drive, Docs, Sheets, Mail, Calendar, Wiki, Bitable, Tasks, and more), with the shortest-path examples and reference links.
lark本技能使用 CLI操作飞书/Lark产品(即时通讯、云盘、文档、表格、邮箱、日历、知识库、多维表格、任务等),提供最简路径示例及参考链接。
larkWhat this repo provides
本仓库提供的内容
- CLI: a single binary to access Feishu/Lark products (IM, Drive, Docs, Sheets, Mail, Calendar, Wiki, Bitable, Tasks).
lark - Two output modes: human tables by default, JSON with for automation.
--json - SDK-first implementation via the official .
oapi-sdk-go
- CLI:一款可访问飞书/Lark全产品(即时通讯、云盘、文档、表格、邮箱、日历、知识库、多维表格、任务)的单二进制文件工具。
lark - 两种输出模式:默认输出易读的表格格式,添加参数可输出JSON格式以支持自动化场景。
--json - 基于官方实现的SDK优先架构。
oapi-sdk-go
Quickstart (minimal)
快速入门(最简版)
- Install the CLI (see ).
references/INSTALL.md - Authenticate:
- Tenant token (app-only, bot/app identity):
lark auth tenant - User token (user-scoped, on behalf of a user): See
lark auth user loginfor details and scopes.references/AUTH.md
- Tenant token (app-only, bot/app identity):
- Run a command:
bash
lark whoami
lark chats list --limit 10
lark users search "Ada" --json- 安装CLI(详见)。
references/INSTALL.md - 身份验证:
- 租户令牌(仅应用身份,机器人/应用身份):
lark auth tenant - 用户令牌(用户范围,代表特定用户操作):详见
lark auth user login了解详细信息及权限范围。references/AUTH.md
- 租户令牌(仅应用身份,机器人/应用身份):
- 运行命令:
bash
lark whoami
lark chats list --limit 10
lark users search "Ada" --jsonCore concepts (tl;dr)
核心概念(简述)
- Feishu = Lark (global brand). Same API surface, different API endpoints.
- Most commands follow: .
lark <product> <action> [args] [flags] - Required IDs are positional args (no required flags).
--id - Many commands accept a Lark/Feishu web URL in place of IDs.
- prints machine-readable output to stdout; logs/errors go to stderr.
--json
See for a longer primer.
references/CONCEPTS.md- 飞书 = Lark(全球品牌)。API接口一致,仅API端点不同。
- 大多数命令遵循格式:。
lark <产品> <操作> [参数] [标志] - 必填ID为位置参数(无需必填的标志)。
--id - 许多命令支持使用Lark/飞书网页URL替代ID。
- 参数会将机器可读的输出打印到标准输出;日志/错误信息输出到标准错误输出。
--json
如需更详细的介绍,请查看。
references/CONCEPTS.mdWhen to use tenant vs user tokens
何时使用租户令牌 vs 用户令牌
- Tenant token: app-level operations as your bot/app identity.
- User token: user-scoped operations on behalf of a specific user.
If a command fails with scope errors, check .
references/TROUBLESHOOTING.md- 租户令牌:以机器人/应用身份执行应用级操作。
- 用户令牌:代表特定用户执行用户范围的操作。
如果命令因权限范围错误失败,请查看。
references/TROUBLESHOOTING.mdToken Type Usage
令牌类型使用
Use to force the access token type:
--token-type- : default, auto-select based on command needs.
--token-type auto - : force tenant token.
--token-type tenant - : force user token.
--token-type user
Examples:
bash
lark whoami --token-type tenant
lark drive list --token-type user使用参数强制指定访问令牌类型:
--token-type- :默认值,根据命令需求自动选择。
--token-type auto - :强制使用租户令牌。
--token-type tenant - :强制使用用户令牌。
--token-type user
示例:
bash
lark whoami --token-type tenant
lark drive list --token-type userAgent-friendly workflow
适配Agent的工作流
- Prefer and parse in tools/scripts.
--json - Use /
--limitfor pagination-heavy commands.--pages - Reuse or
--accountfor multi-user scenarios.LARK_ACCOUNT
- 优先使用参数并在工具/脚本中解析输出。
--json - 对涉及分页的命令,使用/
--limit参数。--pages - 在多用户场景下,复用参数或
--account环境变量。LARK_ACCOUNT
Common recipes
常用操作示例
See for common tasks (send message, search users, read docs, etc.).
references/RECIPES.md查看获取常见任务示例(发送消息、搜索用户、读取文档等)。
references/RECIPES.mdDeep references
深度参考文档
- Install:
references/INSTALL.md - Auth & scopes:
references/AUTH.md - Concepts & IDs:
references/CONCEPTS.md - Recipes:
references/RECIPES.md - Troubleshooting:
references/TROUBLESHOOTING.md - Completion:
references/COMPLETION.md - Docs:
references/DOCS.md - Sheets:
references/SHEETS.md - Bitable bases:
references/BASES.md - Drive:
references/DRIVE.md - Minutes:
references/MINUTES.md - Calendars:
references/CALENDARS.md - Meetings:
references/MEETINGS.md - Chats:
references/CHATS.md - Messages:
references/MESSAGES.md - Contacts:
references/CONTACTS.md - Mail:
references/MAIL.md - Tasklists:
references/TASKLISTS.md - Tasks:
references/TASKS.md - Users:
references/USERS.md - Config:
references/CONFIG.md - Whoami:
references/WHOAMI.md - Wiki:
references/WIKI.md
- 安装:
references/INSTALL.md - 身份验证与权限范围:
references/AUTH.md - 概念与ID:
references/CONCEPTS.md - 操作示例:
references/RECIPES.md - 故障排查:
references/TROUBLESHOOTING.md - 命令补全:
references/COMPLETION.md - 文档:
references/DOCS.md - 表格:
references/SHEETS.md - 多维表格:
references/BASES.md - 云盘:
references/DRIVE.md - 会议纪要:
references/MINUTES.md - 日历:
references/CALENDARS.md - 会议:
references/MEETINGS.md - 群组:
references/CHATS.md - 消息:
references/MESSAGES.md - 通讯录:
references/CONTACTS.md - 邮箱:
references/MAIL.md - 任务列表:
references/TASKLISTS.md - 任务:
references/TASKS.md - 用户:
references/USERS.md - 配置:
references/CONFIG.md - 身份查询:
references/WHOAMI.md - 知识库:
references/WIKI.md