larkmate 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +26 -3
- package/README.md +27 -2
- package/bin/larkmate.js +1 -1
- package/package.json +1 -1
package/INSTALL.md
CHANGED
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
LarkMate 使用当前用户的飞书网页 Cookie,要求 Node.js 版本为 20 或更高。运行时无需安装 Lark CLI,也无需启动 Agent 服务。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 方式一:让 AI 安装
|
|
6
|
+
|
|
7
|
+
把下面的内容发给有本机终端访问能力的 AI 编程助手:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
请帮我在这台电脑上安装 LarkMate CLI 和当前 AI 助手适用的 LarkMate Skill。
|
|
11
|
+
项目地址:https://github.com/NWYLZW/larkmate
|
|
12
|
+
|
|
13
|
+
请检查 Node.js 版本(需要 20 或更新版本),并使用公共 npm 安装:
|
|
14
|
+
npm install -g larkmate --registry=https://registry.npmjs.org/
|
|
15
|
+
|
|
16
|
+
请为当前 AI 助手安装 Skill:
|
|
17
|
+
npx --registry=https://registry.npmjs.org/ skills add NWYLZW/larkmate --skill larkmate -g
|
|
18
|
+
非交互安装时,根据当前助手选择 --agent,并使用 -y。
|
|
19
|
+
|
|
20
|
+
请验证 CLI 和 Skill 均可用,保留已有的登录配置。如果尚未登录,请引导我在本机安全配置;
|
|
21
|
+
不要让我在对话中发送 Cookie、密码或验证码。完成后告诉我安装和登录状态。
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
AI 可以执行安装和检查;访问飞书需要有效 Cookie。如果尚未配置登录态,按 AI 的指引在本机完成,或参考下方的“配置登录态”。
|
|
25
|
+
|
|
26
|
+
## 方式二:手动安装
|
|
27
|
+
|
|
28
|
+
### 1. 安装命令
|
|
6
29
|
|
|
7
30
|
从公共 npm 安装后检查命令:
|
|
8
31
|
|
|
@@ -14,7 +37,7 @@ larkmate --help
|
|
|
14
37
|
|
|
15
38
|
也可以在源码目录执行 `npm ci`,通过 `node bin/larkmate.js --help` 使用 CLI;开发时执行 `npm link` 可将全局命令链接到该源码目录。
|
|
16
39
|
|
|
17
|
-
|
|
40
|
+
### 2. 配置登录态
|
|
18
41
|
|
|
19
42
|
登录飞书网页版后,在浏览器开发者工具中查找当前登录会话的飞书网页请求,并复制完整的 `Cookie` 请求头。Cookie 可以代表你的账号操作,请仅在本机保存,不要发给其他人、粘贴到聊天或写进终端命令。
|
|
20
43
|
|
|
@@ -39,7 +62,7 @@ larkmate status
|
|
|
39
62
|
|
|
40
63
|
如果已有可用的凭据文件,直接执行 `larkmate status`,不必覆盖它。Cookie 失效时更新文件后重试。也可以通过 `LARKMATE_HOME` 选择配置目录、`LARKMATE_COOKIE` 提供 Cookie,或使用全局选项 `--credentials-file` 指定同格式文件;读取优先级依次为:指定文件、环境变量、配置目录。
|
|
41
64
|
|
|
42
|
-
|
|
65
|
+
### 3. 安装 Agent Skill
|
|
43
66
|
|
|
44
67
|
使用 [skills](https://github.com/vercel-labs/skills) 从项目仓库安装 Skill,按提示选择 Agent:
|
|
45
68
|
|
package/README.md
CHANGED
|
@@ -4,14 +4,39 @@ LarkMate 是一个独立的飞书用户身份命令行工具,可以查询会
|
|
|
4
4
|
|
|
5
5
|
## 安装与登录
|
|
6
6
|
|
|
7
|
-
需要 Node.js 20
|
|
7
|
+
需要 Node.js 20 或更新版本。可以让 AI 帮你安装,也可以自己执行命令。
|
|
8
|
+
|
|
9
|
+
### 方式一:让 AI 安装
|
|
10
|
+
|
|
11
|
+
把下面的提示词发给有本机终端访问能力的 AI 编程助手,让它安装 CLI 和当前助手适用的 Skill:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
请帮我在这台电脑上安装 LarkMate CLI 和当前 AI 助手适用的 LarkMate Skill。
|
|
15
|
+
项目地址:https://github.com/NWYLZW/larkmate
|
|
16
|
+
|
|
17
|
+
请检查 Node.js 版本(需要 20 或更新版本),并使用公共 npm 安装:
|
|
18
|
+
npm install -g larkmate --registry=https://registry.npmjs.org/
|
|
19
|
+
|
|
20
|
+
请为当前 AI 助手安装 Skill:
|
|
21
|
+
npx --registry=https://registry.npmjs.org/ skills add NWYLZW/larkmate --skill larkmate -g
|
|
22
|
+
非交互安装时,根据当前助手选择 --agent,并使用 -y。
|
|
23
|
+
|
|
24
|
+
请验证 CLI 和 Skill 均可用,保留已有的登录配置。如果尚未登录,请引导我在本机安全配置;
|
|
25
|
+
不要让我在对话中发送 Cookie、密码或验证码。完成后告诉我安装和登录状态。
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
安装后访问飞书还需要用户的登录态;如果没有可用的 Cookie,AI 会引导你在本机配置。
|
|
29
|
+
|
|
30
|
+
### 方式二:手动安装
|
|
31
|
+
|
|
32
|
+
在终端运行:
|
|
8
33
|
|
|
9
34
|
```sh
|
|
10
35
|
npm install -g larkmate --registry=https://registry.npmjs.org/
|
|
11
36
|
npx --registry=https://registry.npmjs.org/ skills add NWYLZW/larkmate --skill larkmate -g
|
|
12
37
|
```
|
|
13
38
|
|
|
14
|
-
|
|
39
|
+
按提示选择需要安装 Skill 的 AI 助手。完整步骤、登录配置及源码安装方式见 [快速安装](INSTALL.md),Agent 使用指引见 [LarkMate Skill](skills/larkmate/SKILL.md)。
|
|
15
40
|
|
|
16
41
|
默认从 `~/.larkmate/credentials.json` 读取登录信息,格式为 `{ "cookie": "..." }`。将目录和文件分别设为仅当前用户可访问(权限 `700` 和 `600`)。也可以通过 `LARKMATE_HOME` 指定配置目录,或通过 `LARKMATE_COOKIE` 提供 Cookie;`--credentials-file` 可指定其他相同格式的文件。读取顺序为指定文件、环境变量、配置目录。不要把真实 Cookie 写进命令参数、聊天记录或代码仓库。Cookie 过期后需更新,再用 `larkmate status` 检查。
|
|
17
42
|
|
package/bin/larkmate.js
CHANGED
|
@@ -9,7 +9,7 @@ import { writeFile } from 'node:fs/promises';
|
|
|
9
9
|
import { FeishuError } from '../src/errors.js';
|
|
10
10
|
|
|
11
11
|
const program = new Command();
|
|
12
|
-
program.name('larkmate').description('Operate Feishu as the logged-in user.').version('0.1.
|
|
12
|
+
program.name('larkmate').description('Operate Feishu as the logged-in user.').version('0.1.2');
|
|
13
13
|
program.option('--credentials-file <path>', 'read LarkMate credentials.json');
|
|
14
14
|
program.exitOverride();
|
|
15
15
|
|