@lark-project/meegle 0.0.2 → 0.0.4
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/bin/meegle-darwin-arm64 +0 -0
- package/bin/meegle-darwin-x64 +0 -0
- package/bin/meegle-linux-arm64 +0 -0
- package/bin/meegle-linux-x64 +0 -0
- package/bin/meegle.js +23 -0
- package/package.json +22 -28
- package/LICENSE +0 -11
- package/README.md +0 -382
- package/dist/bin/meegle.js +0 -1872
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/meegle.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync } = require("child_process");
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const platform = os.platform();
|
|
7
|
+
const arch = os.arch();
|
|
8
|
+
const binName = `meegle-${platform}-${arch}`;
|
|
9
|
+
const binPath = path.join(__dirname, binName);
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
require("fs").accessSync(binPath, require("fs").constants.X_OK);
|
|
13
|
+
} catch {
|
|
14
|
+
console.error(
|
|
15
|
+
`Unsupported platform: ${platform}-${arch}\n` +
|
|
16
|
+
`Expected binary at: ${binPath}\n` +
|
|
17
|
+
`Supported: darwin-arm64, darwin-x64, linux-arm64, linux-x64`
|
|
18
|
+
);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
23
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-project/meegle",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Agent-First CLI for Meegle (Lark Project)",
|
|
5
|
-
"
|
|
5
|
+
"license": "ISC",
|
|
6
6
|
"bin": {
|
|
7
|
-
"meegle": "
|
|
7
|
+
"meegle": "bin/meegle.js"
|
|
8
8
|
},
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=16"
|
|
11
11
|
},
|
|
12
|
+
"os": [
|
|
13
|
+
"darwin",
|
|
14
|
+
"linux"
|
|
15
|
+
],
|
|
16
|
+
"cpu": [
|
|
17
|
+
"arm64",
|
|
18
|
+
"x64"
|
|
19
|
+
],
|
|
12
20
|
"files": [
|
|
13
|
-
"
|
|
21
|
+
"bin/meegle.js",
|
|
22
|
+
"bin/meegle-*",
|
|
23
|
+
"README.md"
|
|
14
24
|
],
|
|
15
25
|
"publishConfig": {
|
|
16
|
-
"tag": "
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "tsup",
|
|
20
|
-
"dev": "tsup --watch",
|
|
21
|
-
"test": "vitest run",
|
|
22
|
-
"test:watch": "vitest",
|
|
23
|
-
"lint": "tsc --noEmit",
|
|
24
|
-
"prepare": "npm run build"
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@inquirer/prompts": "^7.10.1",
|
|
28
|
-
"chalk": "^5.4.1",
|
|
29
|
-
"cli-table3": "^0.6.5",
|
|
30
|
-
"commander": "^13.1.0",
|
|
31
|
-
"open": "^10.2.0",
|
|
32
|
-
"qrcode-terminal": "^0.12.0",
|
|
33
|
-
"zod": "^3.24.2"
|
|
26
|
+
"tag": "beta"
|
|
34
27
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
28
|
+
"keywords": [
|
|
29
|
+
"meegle",
|
|
30
|
+
"lark-project",
|
|
31
|
+
"cli",
|
|
32
|
+
"mcp"
|
|
33
|
+
]
|
|
40
34
|
}
|
package/LICENSE
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2023 Lark Technologies Pte. Ltd.
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
-
|
|
5
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
6
|
-
IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
|
|
7
|
-
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
|
|
8
|
-
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
|
9
|
-
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
10
|
-
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
11
|
-
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
# Meegle CLI
|
|
2
|
-
|
|
3
|
-
> **DEV** — 当前处于开发预览阶段,API 和命令可能发生变更。
|
|
4
|
-
|
|
5
|
-
飞书项目(Meegle)命令行工具。在终端中管理工作项、查看排期、搜索数据,无需打开浏览器。
|
|
6
|
-
|
|
7
|
-
## 安装
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install -g @lark-project/meegle
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
要求 Node.js >= 18。
|
|
14
|
-
|
|
15
|
-
## 快速开始
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# 1. 登录
|
|
19
|
-
meegle auth login
|
|
20
|
-
|
|
21
|
-
# 2. 查看本周待办
|
|
22
|
-
meegle workitem todo --action this_week --page-num 1
|
|
23
|
-
|
|
24
|
-
# 3. 查看帮助
|
|
25
|
-
meegle --help
|
|
26
|
-
meegle workitem --help
|
|
27
|
-
|
|
28
|
-
# 4. 查看命令参数详情
|
|
29
|
-
meegle inspect workitem.create
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 命令一览
|
|
33
|
-
|
|
34
|
-
### workitem — 工作项
|
|
35
|
-
|
|
36
|
-
| 命令 | 说明 |
|
|
37
|
-
|------|------|
|
|
38
|
-
| `workitem create` | 创建工作项 |
|
|
39
|
-
| `workitem brief` | 查看工作项概况 |
|
|
40
|
-
| `workitem update-field` | 修改工作项字段 |
|
|
41
|
-
| `workitem todo` | 查看我的待办/已办 |
|
|
42
|
-
| `workitem comments` | 查看评论列表 |
|
|
43
|
-
| `workitem add-comment` | 添加评论 |
|
|
44
|
-
| `workitem types` | 查看工作项类型列表 |
|
|
45
|
-
| `workitem field-config` | 查看字段配置 |
|
|
46
|
-
| `workitem role-config` | 查看角色配置 |
|
|
47
|
-
| `workitem field-meta` | 查看创建元信息 |
|
|
48
|
-
| `workitem man-hours` | 查看工时记录 |
|
|
49
|
-
| `workitem op-record` | 查看操作记录 |
|
|
50
|
-
| `workitem relations` | 查看关联关系 |
|
|
51
|
-
| `workitem related` | 查看关联的工作项 |
|
|
52
|
-
| `workitem search` | 使用 MQL 搜索工作项 |
|
|
53
|
-
|
|
54
|
-
### node — 节点 / 流程
|
|
55
|
-
|
|
56
|
-
| 命令 | 说明 |
|
|
57
|
-
|------|------|
|
|
58
|
-
| `node detail` | 查看节点详情 |
|
|
59
|
-
| `node transition` | 流转或回滚节点 |
|
|
60
|
-
| `node update` | 修改节点 |
|
|
61
|
-
| `node update-subtask` | 创建/修改/完成子任务 |
|
|
62
|
-
| `node field-config` | 查看节点字段配置 |
|
|
63
|
-
| `node transitable-states` | 查看可流转状态 |
|
|
64
|
-
| `node transition-required` | 查看流转必填信息 |
|
|
65
|
-
|
|
66
|
-
### view — 视图
|
|
67
|
-
|
|
68
|
-
| 命令 | 说明 |
|
|
69
|
-
|------|------|
|
|
70
|
-
| `view detail` | 查看视图详情 |
|
|
71
|
-
| `view create` | 创建固定视图 |
|
|
72
|
-
| `view update` | 更新固定视图 |
|
|
73
|
-
| `view search` | 按名称搜索视图 |
|
|
74
|
-
|
|
75
|
-
### chart — 图表
|
|
76
|
-
|
|
77
|
-
| 命令 | 说明 |
|
|
78
|
-
|------|------|
|
|
79
|
-
| `chart detail` | 查看图表详情 |
|
|
80
|
-
| `chart list` | 查看视图下的图表列表 |
|
|
81
|
-
|
|
82
|
-
### team — 团队
|
|
83
|
-
|
|
84
|
-
| 命令 | 说明 |
|
|
85
|
-
|------|------|
|
|
86
|
-
| `team list` | 查看空间下的团队列表 |
|
|
87
|
-
| `team members` | 查看团队成员 |
|
|
88
|
-
|
|
89
|
-
### 其他
|
|
90
|
-
|
|
91
|
-
| 命令 | 说明 |
|
|
92
|
-
|------|------|
|
|
93
|
-
| `schedule list` | 查看人员排期 |
|
|
94
|
-
| `project info` | 查看空间信息 |
|
|
95
|
-
| `user info` | 查看用户信息 |
|
|
96
|
-
| `inspect [command]` | 查看命令参数详情 |
|
|
97
|
-
| `+todo` | 查看本周个人待办(快捷命令) |
|
|
98
|
-
|
|
99
|
-
## 常用示例
|
|
100
|
-
|
|
101
|
-
### 查看待办
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
# 本周待办
|
|
105
|
-
meegle workitem todo --action this_week --page-num 1
|
|
106
|
-
|
|
107
|
-
# 已办事项
|
|
108
|
-
meegle workitem todo --action done --page-num 1
|
|
109
|
-
|
|
110
|
-
# 逾期事项
|
|
111
|
-
meegle workitem todo --action overdue --page-num 1
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### 查询工作项
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
# 查看工作项概况
|
|
118
|
-
meegle workitem brief --work-item-id 12345
|
|
119
|
-
|
|
120
|
-
# 查看工作项的节点详情
|
|
121
|
-
meegle node detail --work-item-id 12345 --need-sub-task
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 创建工作项
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
# 使用 --set 设置字段
|
|
128
|
-
meegle workitem create --project-key PROJ --work-item-type story \
|
|
129
|
-
--set name=优化登录流程 \
|
|
130
|
-
--set priority=P1
|
|
131
|
-
|
|
132
|
-
# 复杂字段传 JSON 值
|
|
133
|
-
meegle workitem create --project-key PROJ --work-item-type story \
|
|
134
|
-
--set name=排期任务 \
|
|
135
|
-
--set schedule='[1722182400000,1722355199999]'
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### 修改字段
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# 修改工作项名称
|
|
142
|
-
meegle workitem update-field --work-item-id 12345 \
|
|
143
|
-
--set name=新标题
|
|
144
|
-
|
|
145
|
-
# 同时修改多个字段
|
|
146
|
-
meegle workitem update-field --work-item-id 12345 \
|
|
147
|
-
--set name=新标题 \
|
|
148
|
-
--set priority=P0
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### MQL 搜索
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
# 查询空间下的 P0 需求
|
|
155
|
-
meegle workitem search --project-key PROJ \
|
|
156
|
-
--mql "SELECT \`name\`, \`priority\` FROM \`空间名\`.\`需求\` WHERE \`priority\` = 'P0'"
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### 查看排期
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# 查看团队成员排期
|
|
163
|
-
meegle schedule list --project-key PROJ \
|
|
164
|
-
--start-time 2026-03-01 --end-time 2026-03-31 \
|
|
165
|
-
--user-keys "张三,李四,王五"
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### 查看用户信息
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
meegle user info --user-keys "张三,李四" --project-key PROJ
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## 参数传递
|
|
175
|
-
|
|
176
|
-
### 基本 flag
|
|
177
|
-
|
|
178
|
-
每个命令的参数通过 `--flag-name` 传递:
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
meegle workitem brief --work-item-id 12345 --project-key PROJ
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### --set key=value(写入命令)
|
|
185
|
-
|
|
186
|
-
`workitem create`、`workitem update-field`、`node update`、`node update-subtask` 支持 `--set` 简便设置字段:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
--set name=标题 # 字符串
|
|
190
|
-
--set points=5 # 数字
|
|
191
|
-
--set is_urgent=true # 布尔
|
|
192
|
-
--set schedule='[1,2]' # JSON 数组
|
|
193
|
-
--set role='{"role":"RD"}' # JSON 对象
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
`--set` 可重复使用,一次设置多个字段。
|
|
197
|
-
|
|
198
|
-
### --params JSON(兜底)
|
|
199
|
-
|
|
200
|
-
所有命令都支持 `--params` 传入完整 JSON 参数:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
meegle workitem create --project-key PROJ --work-item-type story \
|
|
204
|
-
--params '{"fields":[{"field_key":"name","field_value":"标题"}]}'
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### 优先级
|
|
208
|
-
|
|
209
|
-
当 `--set`、`--params` 和普通 flag 同时使用时:
|
|
210
|
-
|
|
211
|
-
1. `--set` 覆盖 `--params` 中同名字段
|
|
212
|
-
2. 普通 flag(如 `--project-key`)覆盖 `--params` 中同名顶层 key
|
|
213
|
-
|
|
214
|
-
### 数组参数
|
|
215
|
-
|
|
216
|
-
多个值用逗号分隔:
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
--user-keys "张三,李四,王五"
|
|
220
|
-
--field-keys "name,status,priority"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### 布尔参数
|
|
224
|
-
|
|
225
|
-
直接加 flag 即为 true,不加即为 false:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
meegle node detail --work-item-id 12345 --need-sub-task
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
## 输出格式
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
# JSON(默认)
|
|
235
|
-
meegle workitem brief --work-item-id 12345
|
|
236
|
-
|
|
237
|
-
# 选取输出属性(支持 dot path)
|
|
238
|
-
meegle workitem brief --work-item-id 12345 --select "id,name,status"
|
|
239
|
-
meegle workitem todo --action done --page-num 1 --select "list.work_item_info.work_item_name"
|
|
240
|
-
|
|
241
|
-
# NDJSON(适合管道处理)
|
|
242
|
-
meegle workitem todo --action this_week --page-num 1 --format ndjson
|
|
243
|
-
|
|
244
|
-
# 表格
|
|
245
|
-
meegle workitem todo --action this_week --page-num 1 --format table
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
### --select dot path
|
|
249
|
-
|
|
250
|
-
`--select` 支持用 `.` 访问嵌套属性,遇到数组时自动穿透:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
# 从嵌套结构中提取字段
|
|
254
|
-
--select "list.work_item_info.work_item_name,list.state_info.end_state_key_name"
|
|
255
|
-
|
|
256
|
-
# 混合顶层和嵌套
|
|
257
|
-
--select "total,list.work_item_info.work_item_name"
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
## 命令内省
|
|
261
|
-
|
|
262
|
-
使用 `inspect` 查看命令的完整参数信息:
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
# 列出所有命令
|
|
266
|
-
meegle inspect
|
|
267
|
-
|
|
268
|
-
# 查看特定命令的参数详情
|
|
269
|
-
meegle inspect workitem.create
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
## 认证
|
|
273
|
-
|
|
274
|
-
### 浏览器登录(默认)
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
meegle auth login
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
自动打开浏览器完成 OAuth 授权。如果浏览器未打开,终端会显示授权地址,手动复制即可。
|
|
281
|
-
|
|
282
|
-
### Device Code 登录(无浏览器环境)
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
meegle auth login --device-code
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
终端显示二维码和授权码,使用手机扫码授权。适用于 SSH 远程服务器等无浏览器环境。
|
|
289
|
-
|
|
290
|
-
### 其他认证命令
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
# 查看登录状态
|
|
294
|
-
meegle auth status
|
|
295
|
-
|
|
296
|
-
# 登出
|
|
297
|
-
meegle auth logout
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
## 配置
|
|
301
|
-
|
|
302
|
-
### 配置文件
|
|
303
|
-
|
|
304
|
-
配置存储在 `~/.meegle/config.json`:
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
# 初始化配置
|
|
308
|
-
meegle config init
|
|
309
|
-
|
|
310
|
-
# 查看当前配置
|
|
311
|
-
meegle config show
|
|
312
|
-
|
|
313
|
-
# 修改单个配置项
|
|
314
|
-
meegle config set host project.feishu.cn
|
|
315
|
-
|
|
316
|
-
# 查看单个配置项
|
|
317
|
-
meegle config get host
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
配置项:
|
|
321
|
-
|
|
322
|
-
| 字段 | 说明 | 示例 |
|
|
323
|
-
|------|------|------|
|
|
324
|
-
| `host` | 站点域名 | `project.feishu.cn` 或 `meegle.com` |
|
|
325
|
-
|
|
326
|
-
### 多环境 Profile
|
|
327
|
-
|
|
328
|
-
支持管理多个环境配置(不同站点、不同账号),每个 profile 独立存储 host 和认证信息。
|
|
329
|
-
|
|
330
|
-
```bash
|
|
331
|
-
# 创建新环境(交互式引导 host 选择 + 登录)
|
|
332
|
-
meegle config profile create staging
|
|
333
|
-
|
|
334
|
-
# 查看所有环境
|
|
335
|
-
meegle config profile list
|
|
336
|
-
|
|
337
|
-
# 切换默认环境
|
|
338
|
-
meegle config profile use staging
|
|
339
|
-
|
|
340
|
-
# 查看当前环境
|
|
341
|
-
meegle config profile current
|
|
342
|
-
|
|
343
|
-
# 临时使用其他环境(不改变默认)
|
|
344
|
-
meegle workitem todo --action this_week --page-num 1 --profile staging
|
|
345
|
-
|
|
346
|
-
# 删除环境
|
|
347
|
-
meegle config profile delete staging
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
### 环境变量
|
|
351
|
-
|
|
352
|
-
环境变量优先级高于配置文件:
|
|
353
|
-
|
|
354
|
-
| 变量 | 说明 |
|
|
355
|
-
|------|------|
|
|
356
|
-
| `MEEGLE_HOST` | 站点域名 |
|
|
357
|
-
| `MEEGLE_USER_ACCESS_TOKEN` | 直接传入 token(CI 场景) |
|
|
358
|
-
|
|
359
|
-
## 常见问题
|
|
360
|
-
|
|
361
|
-
### 命令列表为空
|
|
362
|
-
|
|
363
|
-
CLI 启动时会从服务端获取可用命令列表。如果网络不通或未登录,动态命令不会注册。请先确保已登录:
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
meegle auth login
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
命令列表会自动缓存,过期后在后台静默刷新,不影响使用。
|
|
370
|
-
|
|
371
|
-
### CI/CD 环境使用
|
|
372
|
-
|
|
373
|
-
通过环境变量传入 token,跳过交互式登录:
|
|
374
|
-
|
|
375
|
-
```bash
|
|
376
|
-
export MEEGLE_USER_ACCESS_TOKEN="your-token"
|
|
377
|
-
meegle workitem todo --action this_week --page-num 1
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## License
|
|
381
|
-
|
|
382
|
-
[ISC](LICENSE) © Lark Technologies Pte. Ltd.
|