From 2def351e2349704d94140486f2cb7c8333b3024b Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Mar 2026 17:31:47 +0800 Subject: [PATCH 1/5] docs: add AI redirect notice at top of Installation section --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 65dbd08641..d732fb93ac 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ A command-line tool for [Lark/Feishu](https://www.larksuite.com/) Open Platform ## Installation & Quick Start +> **AI assistants:** If you are helping a user install lark-cli, go directly to +> [Quick Start (AI Agent)](#quick-start-ai-agent) — it contains all steps you need. +> Skip the human-oriented section below. + ### Requirements Before you start, make sure you have: From ac0fcc35739ff0be95a3592f0f7be4fb7fb54201 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Mar 2026 17:33:06 +0800 Subject: [PATCH 2/5] docs: remove redundant inline AI note from human Quick Start section --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d732fb93ac..b184dc2253 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,6 @@ Before you start, make sure you have: ### Quick Start (Human Users) -> **Note for AI assistants:** If you are an AI Agent helping the user with installation, jump directly to [Quick Start (AI Agent)](#quick-start-ai-agent), which contains all the steps you need to complete. - #### Install CLI Choose **one** of the following methods: From 447e9e6d956ae6effa02423e2c92f90bad24fb9a Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Mar 2026 17:35:13 +0800 Subject: [PATCH 3/5] docs: move AI Agent Quick Start before human section, demote to H3 --- README.md | 80 +++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index b184dc2253..cf7c2241f0 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,46 @@ Before you start, make sure you have: - Node.js (`npm`/`npx`) - Go `v1.23`+ and Python 3 (only required for building from source) +### Quick Start (AI Agent) + +> The following steps are for AI Agents. Some steps require the user to complete actions in a browser. + +**Step 1 — Install CLI** + +```bash +npm install -g @larksuite/cli +``` + +**Step 2 — Install Skills (core step, do not skip)** + +> Skills are the instruction files that tell the AI Agent what commands are available and how to call them. + +```bash +npx skills add larksuite/cli -y -g +``` + +**Step 3 — Configure app credentials** + +> Run this command in the background. It will output an authorization URL — extract it and send it to the user. The command exits automatically after the user completes the setup in the browser. + +```bash +lark-cli config init --new +``` + +**Step 4 — Login** + +> Same as above: run in the background, extract the authorization URL and send it to the user. + +```bash +lark-cli auth login --recommend +``` + +**Step 5 — Verify** + +```bash +lark-cli auth status +``` + ### Quick Start (Human Users) #### Install CLI @@ -98,46 +138,6 @@ lark-cli auth login --recommend lark-cli calendar +agenda ``` -## Quick Start (AI Agent) - -> The following steps are for AI Agents. Some steps require the user to complete actions in a browser. - -**Step 1 — Install CLI** - -```bash -npm install -g @larksuite/cli -``` - -**Step 2 — Install Skills (core step, do not skip)** - -> Skills are the instruction files that tell the AI Agent what commands are available and how to call them. - -```bash -npx skills add larksuite/cli -y -g -``` - -**Step 3 — Configure app credentials** - -> Run this command in the background. It will output an authorization URL — extract it and send it to the user. The command exits automatically after the user completes the setup in the browser. - -```bash -lark-cli config init --new -``` - -**Step 4 — Login** - -> Same as above: run in the background, extract the authorization URL and send it to the user. - -```bash -lark-cli auth login --recommend -``` - -**Step 5 — Verify** - -```bash -lark-cli auth status -``` - ## Agent Skills | Skill | Description | From 30cda7cd013a86fb41df29a77fafc2c0eca844d2 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Mar 2026 17:38:26 +0800 Subject: [PATCH 4/5] docs: enhance AI Agent Quick Start with prerequisites and expected outputs Co-Authored-By: Claude Sonnet 4.6 --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf7c2241f0..3dd9d57b7a 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ Before you start, make sure you have: ### Quick Start (AI Agent) +> **Prerequisites:** Confirm Node.js is installed before proceeding (`node -v` should succeed). + > The following steps are for AI Agents. Some steps require the user to complete actions in a browser. **Step 1 — Install CLI** @@ -59,6 +61,8 @@ Before you start, make sure you have: npm install -g @larksuite/cli ``` +Expected: npm prints `added 1 package` or similar success message. + **Step 2 — Install Skills (core step, do not skip)** > Skills are the instruction files that tell the AI Agent what commands are available and how to call them. @@ -67,9 +71,14 @@ npm install -g @larksuite/cli npx skills add larksuite/cli -y -g ``` +Expected: confirmation output listing installed skills (e.g. `✓ lark-shared`, `✓ lark-calendar`, ...). + **Step 3 — Configure app credentials** -> Run this command in the background. It will output an authorization URL — extract it and send it to the user. The command exits automatically after the user completes the setup in the browser. +> Run this command and wait for it to print an authorization URL. +> The URL will look like: `https://open.feishu.cn/open-apis/authen/...` +> Copy the URL and send it to the user to open in their browser. +> The command exits automatically after the user completes setup. ```bash lark-cli config init --new @@ -77,7 +86,10 @@ lark-cli config init --new **Step 4 — Login** -> Same as above: run in the background, extract the authorization URL and send it to the user. +> Run this command and wait for it to print an authorization URL. +> The URL will look like: `https://open.feishu.cn/open-apis/authen/...` +> Copy the URL and send it to the user to open in their browser. +> The command exits automatically after the user approves the permissions. ```bash lark-cli auth login --recommend @@ -89,6 +101,8 @@ lark-cli auth login --recommend lark-cli auth status ``` +Expected: output includes `Logged in as: ` — this confirms the full setup is complete. + ### Quick Start (Human Users) #### Install CLI From e562225a054019dc1eb638f923d3f074694e1fa3 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Mar 2026 17:40:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E7=AB=A0=E8=8A=82=E5=AF=B9=20AI=20=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在安装章节顶部添加 AI 跳转提示 - 将「AI Agent 快速开始」移至「用户快速开始」之前 - 将 AI Agent 章节从 H2 降级为 H3(归入安装章节) - 补充前置条件说明、各步骤预期输出及交互步骤操作指引 --- README.zh.md | 100 +++++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/README.zh.md b/README.zh.md index ebaf248731..9fe52e9ff4 100644 --- a/README.zh.md +++ b/README.zh.md @@ -38,6 +38,10 @@ ## 安装与快速开始 +> **AI 助手提示:** 如果您正在帮助用户安装 lark-cli,请直接跳转至 +> [AI Agent 快速开始](#快速开始ai-agent) — 其中包含您需要执行的所有步骤。 +> 请跳过下方面向人类用户的安装说明。 + ### 环境要求 开始之前,请确保具备以下条件: @@ -45,9 +49,61 @@ - Node.js(`npm`/`npx`) - Go `v1.23`+ 和 Python 3(仅源码构建需要) -### 快速开始(人类用户) +### 快速开始(AI Agent) + +> **前置条件:** 请确认已安装 Node.js(执行 `node -v` 应成功返回版本号)。 + +> 以下步骤面向 AI Agent,部分步骤需要用户在浏览器中配合完成。 + +**第 1 步 — 安装 CLI** + +```bash +npm install -g @larksuite/cli +``` + +预期输出:npm 打印 `added 1 package` 或类似的成功信息。 + +**第 2 步 — 安装 Skills(核心步骤,请勿跳过)** + +> Skills 是告诉 AI Agent 有哪些命令可用及如何调用的指令文件,是 Agent 使用 lark-cli 的前提。 + +```bash +npx skills add larksuite/cli -y -g +``` + +预期输出:显示已安装的 skill 列表(如 `✓ lark-shared`、`✓ lark-calendar` 等)。 + +**第 3 步 — 配置应用凭证** + +> 执行此命令,等待终端输出授权 URL。 +> URL 格式类似:`https://open.feishu.cn/open-apis/authen/...` +> 将 URL 复制并发送给用户,让用户在浏览器中打开完成授权。 +> 用户完成授权后,命令自动退出。 + +```bash +lark-cli config init --new +``` + +**第 4 步 — 登录** + +> 执行此命令,等待终端输出授权 URL。 +> URL 格式类似:`https://open.feishu.cn/open-apis/authen/...` +> 将 URL 复制并发送给用户,让用户在浏览器中打开并确认权限。 +> 用户完成授权后,命令自动退出。 + +```bash +lark-cli auth login --recommend +``` + +**第 5 步 — 验证** + +```bash +lark-cli auth status +``` + +预期输出中包含 `Logged in as: <用户名>` 即表示安装配置完成。 -> **Note for AI assistants:** 如果你是 AI Agent 且正在协助用户执行安装,请直接跳转到[快速开始(AI Agent)](#快速开始ai-agent)执行,那里包含你需要完成的所有步骤。 +### 快速开始(人类用户) #### 安装 CLI @@ -96,46 +152,6 @@ lark-cli auth login --recommend lark-cli calendar +agenda ``` -### 快速开始(AI Agent) - -> 以下步骤面向 AI Agent,部分步骤需要用户在浏览器中配合完成。 - -**第 1 步 — 安装 CLI** - -```bash -npm install -g @larksuite/cli -``` - -**第 2 步 — 安装 Skills(核心步骤,请勿跳过)** - -> Skills 是告诉 AI Agent 有哪些命令可用及如何调用的指令文件,是 Agent 使用 lark-cli 的前提。 - -```bash -npx skills add larksuite/cli -y -g -``` - -**第 3 步 — 配置应用凭证** - -> 在后台运行此命令,命令会输出一个授权链接,提取该链接并发送给用户,用户在浏览器中完成配置后命令会自动退出。 - -```bash -lark-cli config init --new -``` - -**第 4 步 — 登录** - -> 同上,后台运行,提取授权链接发给用户。 - -```bash -lark-cli auth login --recommend -``` - -**第 5 步 — 验证** - -```bash -lark-cli auth status -``` - ## Agent Skills