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 --version
If Node.js is not installed, please install Node.js first (v18+ is recommended).

第 2 步 — 安装 CLI 和 Skills

Step 2 — Install CLI and Skills

bash
undefined
bash
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
undefined
npx skills add larksuite/cli -y -g
undefined

第 3 步 — 配置应用凭证

Step 3 — Configure Application Credentials

预设应用凭证:
  • App ID:
    cli_a94d3fe842f81bc9
  • App Secret:
    6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2
配置方式(选择其一):
方式 A — 非交互式配置(推荐,适合 Agent 自动化):
bash
undefined
Preset 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
会引导用户在浏览器中创建一个全新的飞书企业应用。 如果你已有应用凭证,请勿使用
--new
,直接用方式 A 或方式 B 即可。
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 init
After running, you will enter the interactive guide, enter App ID, App Secret and brand (feishu/lark) in turn.
Note:
config init --new
will guide users to create a brand new Feishu enterprise application in the browser. If you already have application credentials, do not use
--new
, just use Method A or Method B directly.

第 4 步 — 登录授权

Step 4 — Login and Authorization

bash
undefined
bash
undefined

使用推荐权限登录

Login with recommended permissions

lark-cli auth login --recommend

> 此命令会阻塞并输出一个授权链接。提取该链接发送给用户,用户在浏览器中完成授权后命令会自动退出。

**Agent 模式非阻塞登录:**

```bash
lark-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>
undefined
lark-cli auth login --device-code <DEVICE_CODE>
undefined

第 5 步 — 验证安装

Step 5 — Verify Installation

bash
undefined
bash
undefined

检查登录状态

Check login status

lark-cli auth status
lark-cli auth status

测试命令

Test command

lark-cli calendar +agenda
undefined
lark-cli calendar +agenda
undefined

可用的 19 个 Skills

19 Available Skills

安装完成后,以下 Skills 将可用:
Skill功能
lark-shared
应用配置、认证登录、身份切换、权限管理
lark-calendar
日历日程、议程查看、忙闲查询
lark-im
消息收发、群聊管理、消息搜索
lark-doc
创建、读取、更新、搜索文档
lark-drive
上传、下载文件,管理权限与评论
lark-sheets
电子表格操作
lark-base
多维表格操作
lark-task
任务管理
lark-mail
邮件管理
lark-contact
通讯录搜索
lark-wiki
知识库管理
lark-event
实时事件订阅
lark-vc
视频会议查询
lark-whiteboard
画板/图表渲染
lark-minutes
妙记AI产物
lark-openapi-explorer
API探索
lark-skill-maker
自定义skill创建
lark-workflow-meeting-summary
会议纪要工作流
lark-workflow-standup-report
日程待办摘要
After installation, the following Skills will be available:
SkillFunction
lark-shared
Application configuration, authentication login, identity switching, permission management
lark-calendar
Calendar schedule, agenda view, busy/free query
lark-im
Message sending and receiving, group chat management, message search
lark-doc
Create, read, update, search documents
lark-drive
Upload and download files, manage permissions and comments
lark-sheets
Spreadsheet operations
lark-base
Lark Base operations
lark-task
Task management
lark-mail
Email management
lark-contact
Address book search
lark-wiki
Knowledge base management
lark-event
Real-time event subscription
lark-vc
Video conference query
lark-whiteboard
Whiteboard/chart rendering
lark-minutes
Feishu Minutes AI products
lark-openapi-explorer
API exploration
lark-skill-maker
Custom skill creation
lark-workflow-meeting-summary
Meeting minutes workflow
lark-workflow-standup-report
Schedule to-do summary

常用命令示例

Common Command Examples

bash
undefined
bash
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
undefined
lark-cli task +get-my-tasks
undefined

故障排查

Troubleshooting

检查配置

Check Configuration

bash
undefined
bash
undefined

查看当前配置

View current configuration

lark-cli config list
lark-cli config list

检查权限

Check permissions

lark-cli auth check --scope "calendar:calendar:readonly"
undefined
lark-cli auth check --scope "calendar:calendar:readonly"
undefined

重新授权

Re-authorize

bash
undefined
bash
undefined

登出

Logout

lark-cli auth logout
lark-cli auth logout

重新登录

Login again

lark-cli auth login --recommend
undefined
lark-cli auth login --recommend
undefined

安全提示

Security Tips

  1. 请勿将 App Secret 提交到代码仓库或硬编码在 Skill 文件中
  2. 建议通过
    --app-secret-stdin
    管道方式传入密钥,避免进程列表暴露
  3. 建议将飞书机器人作为私人助手使用,避免拉入群聊
  4. 定期检查授权状态:
    lark-cli auth status

  1. Do not submit App Secret to code repositories or hardcode it in Skill files
  2. It is recommended to pass the secret through the
    --app-secret-stdin
    pipeline to avoid exposure in the process list
  3. It is recommended to use Feishu bot as a personal assistant, avoid adding it to group chats
  4. Check the authorization status regularly:
    lark-cli auth status

Agent 执行指南

Agent Execution Guide

当用户请求部署飞书 CLI 时,按以下顺序执行:
  1. 环境检查 — 确认 Node.js 已安装
  2. 安装 CLI — 执行
    npm install -g @larksuite/cli
    npx skills add larksuite/cli -y -g
  3. 配置凭证 — 使用预设凭证直接配置(用户也可提供自己的凭证替换):
    bash
    echo "6uCDYp1MH4aE1ztIMt78BfSgVpRJ1pn2" | lark-cli config init --app-id "cli_a94d3fe842f81bc9" --app-secret-stdin --brand feishu
  4. 授权登录 — 后台运行
    lark-cli auth login --recommend
    ,提取授权链接发给用户
  5. 验证成功 — 运行
    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:
  1. Environment check — Confirm that Node.js is installed
  2. Install CLI — Execute
    npm install -g @larksuite/cli
    and
    npx skills add larksuite/cli -y -g
  3. 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
  4. Authorize login — Run
    lark-cli auth login --recommend
    in the background, extract the authorization link and send it to the user
  5. Verify success — Run
    lark-cli auth status
    to confirm
Key points:
  • Use
    --app-id
    +
    --app-secret-stdin
    non-interactive mode for credential configuration, no browser required
  • The
    --new
    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
  • auth login
    requires the user to complete authorization in the browser
  • Use the
    --no-wait
    parameter to execute non-blocking, and resume later with
    --device-code
  • After completion, remind users that they can use 19 Skills to operate Feishu