lark_cli_setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese飞书CLI 自动化部署 Skill
Feishu CLI Automated Deployment Skill
此 Skill 帮助用户自动化部署飞书官方 CLI 工具及其自带的 19 个 AI Agent Skills。
核心理念: 管理员只需创建一次飞书企业应用,其他用户只需填入该应用的 App ID 和 App Secret 即可使用,无需每人创建应用。
This Skill helps users automatically deploy the official Feishu CLI tool and its 19 built-in AI Agent Skills.
Core Idea: Administrators only need to create a Feishu enterprise application once, other users only need to fill in the App ID and App Secret of the application to use it, no need for each user to create a separate application.
部署步骤
Deployment Steps
第 1 步 — 检查环境
Step 1 — Check Environment
检查是否已安装 Node.js:
bash
node --version
npm --version如果未安装 Node.js,请先安装 Node.js(建议 v18+)。
Check if Node.js is installed:
bash
node --version
npm --versionIf Node.js is not installed, please install Node.js first (v18+ is recommended).
第 2 步 — 安装 CLI 和 Skills
Step 2 — Install CLI and Skills
bash
undefinedbash
undefined安装 CLI
Install CLI
npm install -g @larksuite/cli
npm install -g @larksuite/cli
安装 CLI SKILL(必需,包含 19 个 Agent Skills)
Install CLI SKILL (required, includes 19 Agent Skills)
npx skills add larksuite/cli -y -g
undefinednpx skills add larksuite/cli -y -g
undefined第 3 步 — 配置应用凭证
Step 3 — Configure Application Credentials
预设应用凭证:
- App ID:
cli_a94d3fe842f81bc9 - App Secret:
6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2
配置方式(选择其一):
方式 A — 非交互式配置(推荐,适合 Agent 自动化):
bash
undefinedPreset application credentials:
- App ID:
cli_a94d3fe842f81bc9 - App Secret:
6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2
Configuration methods (choose one):
Method A — Non-interactive configuration (recommended, suitable for Agent automation):
bash
undefined使用预设凭证,通过管道传入 App Secret
Use preset credentials, pass App Secret via pipeline
echo "6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2" | lark-cli config init --app-id "cli_a94d3fe842f81bc9" --app-secret-stdin --brand feishu
> 此方式无需浏览器交互,适合自动化部署。
> 如果用户有自己的应用凭证,替换上述 App ID 和 App Secret 即可。
**方式 B — 交互式配置(适合手动操作):**
```bash
lark-cli config init运行后会进入交互式引导,依次输入 App ID、App Secret 和品牌(feishu/lark)。
注意:会引导用户在浏览器中创建一个全新的飞书企业应用。 如果你已有应用凭证,请勿使用config init --new,直接用方式 A 或方式 B 即可。--new
echo "6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2" | lark-cli config init --app-id "cli_a94d3fe842f81bc9" --app-secret-stdin --brand feishu
> This method does not require browser interaction, suitable for automated deployment.
> If users have their own application credentials, just replace the App ID and App Secret above.
**Method B — Interactive configuration (suitable for manual operation):**
```bash
lark-cli config initAfter running, you will enter the interactive guide, enter App ID, App Secret and brand (feishu/lark) in turn.
Note:will guide users to create a brand new Feishu enterprise application in the browser. If you already have application credentials, do not useconfig init --new, just use Method A or Method B directly.--new
第 4 步 — 登录授权
Step 4 — Login and Authorization
bash
undefinedbash
undefined使用推荐权限登录
Login with recommended permissions
lark-cli auth login --recommend
> 此命令会阻塞并输出一个授权链接。提取该链接发送给用户,用户在浏览器中完成授权后命令会自动退出。
**Agent 模式非阻塞登录:**
```bashlark-cli auth login --recommend
> This command will block and output an authorization link. Extract the link and send it to the user, the command will exit automatically after the user completes the authorization in the browser.
**Agent mode non-blocking login:**
```bash立即返回验证 URL,不阻塞
Return verification URL immediately without blocking
lark-cli auth login --domain calendar,im,docs,task --no-wait
lark-cli auth login --domain calendar,im,docs,task --no-wait
稍后恢复轮询(使用返回的 device_code)
Resume polling later (use the returned device_code)
lark-cli auth login --device-code <DEVICE_CODE>
undefinedlark-cli auth login --device-code <DEVICE_CODE>
undefined第 5 步 — 验证安装
Step 5 — Verify Installation
bash
undefinedbash
undefined检查登录状态
Check login status
lark-cli auth status
lark-cli auth status
测试命令
Test command
lark-cli calendar +agenda
undefinedlark-cli calendar +agenda
undefined可用的 19 个 Skills
19 Available Skills
安装完成后,以下 Skills 将可用:
| Skill | 功能 |
|---|---|
| 应用配置、认证登录、身份切换、权限管理 |
| 日历日程、议程查看、忙闲查询 |
| 消息收发、群聊管理、消息搜索 |
| 创建、读取、更新、搜索文档 |
| 上传、下载文件,管理权限与评论 |
| 电子表格操作 |
| 多维表格操作 |
| 任务管理 |
| 邮件管理 |
| 通讯录搜索 |
| 知识库管理 |
| 实时事件订阅 |
| 视频会议查询 |
| 画板/图表渲染 |
| 妙记AI产物 |
| API探索 |
| 自定义skill创建 |
| 会议纪要工作流 |
| 日程待办摘要 |
After installation, the following Skills will be available:
| Skill | Function |
|---|---|
| Application configuration, authentication login, identity switching, permission management |
| Calendar schedule, agenda view, busy/free query |
| Message sending and receiving, group chat management, message search |
| Create, read, update, search documents |
| Upload and download files, manage permissions and comments |
| Spreadsheet operations |
| Lark Base operations |
| Task management |
| Email management |
| Address book search |
| Knowledge base management |
| Real-time event subscription |
| Video conference query |
| Whiteboard/chart rendering |
| Feishu Minutes AI products |
| API exploration |
| Custom skill creation |
| Meeting minutes workflow |
| Schedule to-do summary |
常用命令示例
Common Command Examples
bash
undefinedbash
undefined查看今日议程
View today's agenda
lark-cli calendar +agenda
lark-cli calendar +agenda
发送消息
Send message
lark-cli im +messages-send --chat-id "oc_xxx" --text "Hello"
lark-cli im +messages-send --chat-id "oc_xxx" --text "Hello"
创建文档
Create document
lark-cli docs +create --title "周报" --markdown "# 本周进展"
lark-cli docs +create --title "Weekly Report" --markdown "# This Week's Progress"
查看任务
View tasks
lark-cli task +get-my-tasks
undefinedlark-cli task +get-my-tasks
undefined故障排查
Troubleshooting
检查配置
Check Configuration
bash
undefinedbash
undefined查看当前配置
View current configuration
lark-cli config list
lark-cli config list
检查权限
Check permissions
lark-cli auth check --scope "calendar:calendar:readonly"
undefinedlark-cli auth check --scope "calendar:calendar:readonly"
undefined重新授权
Re-authorize
bash
undefinedbash
undefined登出
Logout
lark-cli auth logout
lark-cli auth logout
重新登录
Login again
lark-cli auth login --recommend
undefinedlark-cli auth login --recommend
undefined安全提示
Security Tips
- 请勿将 App Secret 提交到代码仓库或硬编码在 Skill 文件中
- 建议通过 管道方式传入密钥,避免进程列表暴露
--app-secret-stdin - 建议将飞书机器人作为私人助手使用,避免拉入群聊
- 定期检查授权状态:
lark-cli auth status
- Do not submit App Secret to code repositories or hardcode it in Skill files
- It is recommended to pass the secret through the pipeline to avoid exposure in the process list
--app-secret-stdin - It is recommended to use Feishu bot as a personal assistant, avoid adding it to group chats
- Check the authorization status regularly:
lark-cli auth status
Agent 执行指南
Agent Execution Guide
当用户请求部署飞书 CLI 时,按以下顺序执行:
- 环境检查 — 确认 Node.js 已安装
- 安装 CLI — 执行 和
npm install -g @larksuite/clinpx skills add larksuite/cli -y -g - 配置凭证 — 使用预设凭证直接配置(用户也可提供自己的凭证替换):
bash
echo "6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2" | lark-cli config init --app-id "cli_a94d3fe842f81bc9" --app-secret-stdin --brand feishu - 授权登录 — 后台运行 ,提取授权链接发给用户
lark-cli auth login --recommend - 验证成功 — 运行 确认
lark-cli auth status
关键点:
- 配置凭证使用 +
--app-id非交互模式,无需浏览器--app-secret-stdin - 参数会创建全新应用,仅管理员首次创建应用时使用,普通用户部署时不要用
--new - 需要用户在浏览器中完成授权
auth login - 使用 参数可以非阻塞执行,稍后用
--no-wait恢复--device-code - 完成后提醒用户可以使用 19 个 Skills 操作飞书
When a user requests to deploy Feishu CLI, execute in the following order:
- Environment check — Confirm that Node.js is installed
- Install CLI — Execute and
npm install -g @larksuite/clinpx skills add larksuite/cli -y -g - Configure credentials — Use preset credentials to configure directly (users can also provide their own credentials to replace):
bash
echo "6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2" | lark-cli config init --app-id "cli_a94d3fe842f81bc9" --app-secret-stdin --brand feishu - Authorize login — Run in the background, extract the authorization link and send it to the user
lark-cli auth login --recommend - Verify success — Run to confirm
lark-cli auth status
Key points:
- Use +
--app-idnon-interactive mode for credential configuration, no browser required--app-secret-stdin - The parameter will create a new application, only used when the administrator creates an application for the first time, do not use it when ordinary users deploy
--new - requires the user to complete authorization in the browser
auth login - Use the parameter to execute non-blocking, and resume later with
--no-wait--device-code - After completion, remind users that they can use 19 Skills to operate Feishu