Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 58 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,72 @@ 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:

- Node.js (`npm`/`npx`)
- Go `v1.23`+ and Python 3 (only required for building from source)

### Quick Start (Human Users)
### 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**

```bash
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.

```bash
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 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
```

**Step 4 — Login**

> 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
```

**Step 5 — Verify**

```bash
lark-cli auth status
```

Expected: output includes `Logged in as: <username>` — this confirms the full setup is complete.

> **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.
### Quick Start (Human Users)

#### Install CLI

Expand Down Expand Up @@ -96,46 +152,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 |
Expand Down
100 changes: 58 additions & 42 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,72 @@

## 安装与快速开始

> **AI 助手提示:** 如果您正在帮助用户安装 lark-cli,请直接跳转至
> [AI Agent 快速开始](#快速开始ai-agent) — 其中包含您需要执行的所有步骤。
> 请跳过下方面向人类用户的安装说明。

### 环境要求

开始之前,请确保具备以下条件:

- 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

Expand Down Expand Up @@ -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

Expand Down