licell 0.10.12 → 0.12.0
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/README.en.md +39 -1
- package/README.md +223 -141
- package/dist/licell.js +583 -240
- package/package.json +2 -1
package/README.en.md
CHANGED
|
@@ -168,7 +168,7 @@ Licell has three main state layers:
|
|
|
168
168
|
| Type | Default location | Purpose |
|
|
169
169
|
|------|------------------|---------|
|
|
170
170
|
| Global auth | `~/.licell-cli/auth.json` | Alibaba Cloud credentials and default region |
|
|
171
|
-
| Project state | `<project>/.licell/project.json` | app name, envs, network, deploy state |
|
|
171
|
+
| Project state | `<project>/.licell/project.json` | app name, envs, network, deploy state; can also be a workspace file for multiple components in one repo |
|
|
172
172
|
| MCP project config | `<project>/.mcp.json` | MCP discovery for Claude / Codex / Cursor |
|
|
173
173
|
|
|
174
174
|
Compatibility notes:
|
|
@@ -176,6 +176,38 @@ Compatibility notes:
|
|
|
176
176
|
- Licell still supports some legacy `~/.ali-cli/*` paths
|
|
177
177
|
- current canonical global path is `~/.licell-cli/*`
|
|
178
178
|
|
|
179
|
+
### Workspace / Monorepo
|
|
180
|
+
|
|
181
|
+
If one repository contains multiple deployable directories (for example `apps/web` for a static site
|
|
182
|
+
plus `apps/api` for an FC API), prefer a workspace-style root `.licell/project.json`:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"defaultComponent": "api",
|
|
187
|
+
"components": {
|
|
188
|
+
"web": {
|
|
189
|
+
"path": "apps/web",
|
|
190
|
+
"appName": "demo-web",
|
|
191
|
+
"deployType": "static",
|
|
192
|
+
"dist": "dist",
|
|
193
|
+
"domain": "www.example.com"
|
|
194
|
+
},
|
|
195
|
+
"api": {
|
|
196
|
+
"path": "apps/api",
|
|
197
|
+
"appName": "demo-api",
|
|
198
|
+
"deployType": "api",
|
|
199
|
+
"runtime": "nodejs22",
|
|
200
|
+
"entry": "src/index.ts",
|
|
201
|
+
"target": "prod"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- Running `licell deploy` inside `apps/web` resolves the `web` component automatically.
|
|
208
|
+
- Running `licell deploy` inside `apps/api` resolves the `api` component automatically.
|
|
209
|
+
- After a successful deploy, Licell now persists stable deploy intent back into the matched component (for example `domain`, `domainSuffix`, `entry`, `dist`, `target`, `enableCdn`, `enableSSL`, `useVpc`) instead of only writing a very small subset of fields.
|
|
210
|
+
|
|
179
211
|
## Team Auth Distribution
|
|
180
212
|
|
|
181
213
|
When only a small set of people in a team directly hold high-privilege AK/SK credentials, it is often cleaner to separate “authorization” from “daily usage”:
|
|
@@ -258,6 +290,7 @@ If you want Claude Code, Codex, Cursor, or other agents to call Licell directly
|
|
|
258
290
|
|
|
259
291
|
```bash
|
|
260
292
|
licell setup
|
|
293
|
+
licell setup --agent codex
|
|
261
294
|
licell setup --agent codex --global
|
|
262
295
|
licell setup --agent claude --global
|
|
263
296
|
```
|
|
@@ -296,8 +329,13 @@ If you want the agent to have a richer task-oriented instruction surface inside
|
|
|
296
329
|
```bash
|
|
297
330
|
licell skills init codex
|
|
298
331
|
licell skills init claude
|
|
332
|
+
licell skills init codex --global
|
|
299
333
|
```
|
|
300
334
|
|
|
335
|
+
By default, `skills init` writes into the current project. Use `--global` only when you explicitly want user-level global skills.
|
|
336
|
+
|
|
337
|
+
`licell setup` is the interactive wrapper, but it reuses the same underlying skills write flow.
|
|
338
|
+
|
|
301
339
|
Skills, MCP, help, and docs are meant to stay aligned through the shared command model.
|
|
302
340
|
|
|
303
341
|
---
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Licell 是一个面向阿里云的部署与运维 CLI,同时兼顾人类用户
|
|
|
9
9
|
- 一个主入口:`deploy`
|
|
10
10
|
- 一份项目状态:`.licell/project.json`
|
|
11
11
|
- 一套可组合的资源原子命令:`fn` / `oss` / `dns` / `domain`
|
|
12
|
-
- 一套面向 Agent
|
|
12
|
+
- 一套面向 Agent 的统一表面:`catalog` / `--help` / `--output json` / `skills`
|
|
13
13
|
|
|
14
14
|
默认地域为 `cn-hangzhou`。用于 Agent 自动化时,建议使用独立测试账号或独立地域,不要直接共用生产环境。团队协作下,推荐采用后文的“团队授权分发”模式。
|
|
15
15
|
|
|
@@ -20,17 +20,18 @@ Licell 是一个面向阿里云的部署与运维 CLI,同时兼顾人类用户
|
|
|
20
20
|
如果你把 Vercel CLI 的“单主线体验”搬到阿里云,大致就是 Licell 想做的事情:
|
|
21
21
|
|
|
22
22
|
- **人类友好**:`init -> deploy -> release -> rollback`
|
|
23
|
-
- **Agent 友好**:命令自描述、结构化帮助、结构化输出、
|
|
23
|
+
- **Agent 友好**:命令自描述、结构化帮助、结构化输出、catalog、skills
|
|
24
24
|
- **架构清晰**:workflow 命令负责“得到结果”,原子命令负责“精确控制资源”
|
|
25
25
|
|
|
26
26
|
Licell 当前覆盖的核心能力包括:
|
|
27
27
|
|
|
28
28
|
- FC API 部署与发布
|
|
29
|
+
- FC Task 部署、异步触发与任务追踪
|
|
29
30
|
- OSS 静态站部署
|
|
30
31
|
- 自定义域名、HTTPS、CDN、DNS
|
|
31
32
|
- ACR / Docker 镜像部署
|
|
32
33
|
- Serverless 数据库与缓存辅助能力
|
|
33
|
-
- 面向 Agent 的
|
|
34
|
+
- 面向 Agent 的 Skills / catalog / JSON 输出 / 文档共源生成
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
@@ -71,15 +72,15 @@ Licell 最新架构里,命令不再只是“能执行”,还要“能自我
|
|
|
71
72
|
|
|
72
73
|
同一套命令注册表会驱动:
|
|
73
74
|
|
|
75
|
+
- CLI `catalog`
|
|
74
76
|
- CLI `--help`
|
|
75
77
|
- 结构化 help
|
|
76
|
-
- MCP tool catalog
|
|
77
78
|
- skills 脚手架
|
|
78
79
|
- README 生成区块
|
|
79
80
|
- Agent surface 文档
|
|
80
81
|
- shell completion
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
也就是说:**命令面变了,catalog、帮助、skills、文档会跟着一起收敛**。
|
|
83
84
|
|
|
84
85
|
---
|
|
85
86
|
|
|
@@ -149,6 +150,15 @@ licell init --runtime nodejs22
|
|
|
149
150
|
licell deploy --type api --target preview
|
|
150
151
|
```
|
|
151
152
|
|
|
153
|
+
### 给 Task 项目
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
licell login --region cn-hangzhou
|
|
157
|
+
licell init --runtime nodejs22 --kind task
|
|
158
|
+
licell deploy --type task --target preview
|
|
159
|
+
licell task invoke <appName> --target preview --payload '{"job":"demo"}'
|
|
160
|
+
```
|
|
161
|
+
|
|
152
162
|
### 给 Agent / 自动化调用方
|
|
153
163
|
|
|
154
164
|
推荐固定顺序:
|
|
@@ -170,14 +180,45 @@ Licell 有三类核心状态:
|
|
|
170
180
|
| 类型 | 默认位置 | 说明 |
|
|
171
181
|
|------|----------|------|
|
|
172
182
|
| 全局认证 | `~/.licell-cli/auth.json` | 阿里云凭证与默认 region |
|
|
173
|
-
| 项目状态 | `<project>/.licell/project.json` | appName
|
|
174
|
-
| MCP 项目配置 | `<project>/.mcp.json` | 供 Claude / Codex / Cursor 发现 licell MCP server |
|
|
183
|
+
| 项目状态 | `<project>/.licell/project.json` | appName、环境变量、网络、部署状态;也可在 repo 根切换为 workspace 形式管理多个 component |
|
|
175
184
|
|
|
176
185
|
兼容性说明:
|
|
177
186
|
|
|
178
187
|
- Licell 仍兼容历史上的 `~/.ali-cli/auth.json` 等旧路径
|
|
179
188
|
- 当前主路径以 `~/.licell-cli/*` 为准
|
|
180
189
|
|
|
190
|
+
### Workspace / Monorepo
|
|
191
|
+
|
|
192
|
+
当同一个 repo 里有多个可部署目录(例如 `apps/web` 静态站 + `apps/api` FC API)时,
|
|
193
|
+
推荐在 repo 根维护一份 workspace 形态的 `.licell/project.json`:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"defaultComponent": "api",
|
|
198
|
+
"components": {
|
|
199
|
+
"web": {
|
|
200
|
+
"path": "apps/web",
|
|
201
|
+
"appName": "demo-web",
|
|
202
|
+
"deployType": "static",
|
|
203
|
+
"dist": "dist",
|
|
204
|
+
"domain": "www.example.com"
|
|
205
|
+
},
|
|
206
|
+
"api": {
|
|
207
|
+
"path": "apps/api",
|
|
208
|
+
"appName": "demo-api",
|
|
209
|
+
"deployType": "api",
|
|
210
|
+
"runtime": "nodejs22",
|
|
211
|
+
"entry": "src/index.ts",
|
|
212
|
+
"target": "prod"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
- 在 `apps/web` 目录执行 `licell deploy` 时,会自动解析到 `web` component。
|
|
219
|
+
- 在 `apps/api` 目录执行 `licell deploy` 时,会自动解析到 `api` component。
|
|
220
|
+
- deploy 成功后,Licell 会把稳定重跑所需的 deploy intent(如 `domain` / `domainSuffix` / `entry` / `dist` / `target` / `enableCdn` / `enableSSL` / `useVpc`)回写到对应 component,而不是只写少量字段。
|
|
221
|
+
|
|
181
222
|
## 团队授权分发(推荐)
|
|
182
223
|
|
|
183
224
|
当团队中只有少数人直接持有高权限 AK/SK 时,可以把“授权”和“使用”分开:
|
|
@@ -235,7 +276,7 @@ licell domain app bind --help --output json
|
|
|
235
276
|
|
|
236
277
|
## 2) 结构化输出 `--output json`
|
|
237
278
|
|
|
238
|
-
|
|
279
|
+
几乎所有命令都支持结构化 JSON 结果:
|
|
239
280
|
|
|
240
281
|
```bash
|
|
241
282
|
licell deploy --type api --output json
|
|
@@ -252,44 +293,21 @@ licell oss info my-bucket --output json
|
|
|
252
293
|
- `retryable`
|
|
253
294
|
- `provider.requestId`
|
|
254
295
|
|
|
255
|
-
## 3)
|
|
256
|
-
|
|
257
|
-
如果你希望 Claude Code、Codex、Cursor 等 Agent 直接把 `licell` 当作工具调用,用 MCP 是最自然的方式。
|
|
296
|
+
## 3) 命令目录 `catalog`
|
|
258
297
|
|
|
259
|
-
|
|
298
|
+
如果你希望 Claude Code、Codex、Cursor 等 Agent 直接驱动 `licell`,推荐走这条固定链路:
|
|
260
299
|
|
|
261
300
|
```bash
|
|
262
|
-
licell
|
|
263
|
-
licell
|
|
264
|
-
licell
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### 项目内初始化 MCP
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
licell mcp init
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
默认会生成:
|
|
274
|
-
|
|
275
|
-
```json
|
|
276
|
-
{
|
|
277
|
-
"mcpServers": {
|
|
278
|
-
"licell": {
|
|
279
|
-
"command": "licell",
|
|
280
|
-
"args": ["mcp", "serve"]
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
301
|
+
licell catalog --output json
|
|
302
|
+
licell deploy --help --output json
|
|
303
|
+
licell deploy --type api --output json
|
|
284
304
|
```
|
|
285
305
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
licell mcp serve
|
|
290
|
-
```
|
|
306
|
+
含义分别是:
|
|
291
307
|
|
|
292
|
-
|
|
308
|
+
- `catalog`:发现稳定 command key、选项、schema 与 CLI record contract
|
|
309
|
+
- `--help --output json`:读取单命令的参数、结果、推荐流程与下一步
|
|
310
|
+
- `--output json`:真正执行命令,并消费 `event / result / error` records
|
|
293
311
|
|
|
294
312
|
## 4) Skills
|
|
295
313
|
|
|
@@ -298,9 +316,14 @@ licell mcp serve
|
|
|
298
316
|
```bash
|
|
299
317
|
licell skills init codex
|
|
300
318
|
licell skills init claude
|
|
319
|
+
licell skills init codex --global
|
|
301
320
|
```
|
|
302
321
|
|
|
303
|
-
|
|
322
|
+
默认会把 skills 写入当前项目;只有显式传 `--global` 时,才会写到用户级全局技能目录。
|
|
323
|
+
|
|
324
|
+
`licell setup` 是交互式包装命令,底层仍然复用同一套 skills 写入逻辑。
|
|
325
|
+
|
|
326
|
+
Skills 与 catalog、help、README 共享同一套命令描述体系,所以更容易保持一致。
|
|
304
327
|
|
|
305
328
|
---
|
|
306
329
|
|
|
@@ -350,20 +373,6 @@ licell deploy --type api --runtime nodejs22 --entry src/index.ts --domain api.yo
|
|
|
350
373
|
- 默认不再把大体积 fallback runtime 打进代码包,避免放大 FC 上传体积
|
|
351
374
|
- 如需额外打包 fallback runtime,可显式设置 `LICELL_FC_INCLUDE_RUNTIME_FALLBACK=1`
|
|
352
375
|
|
|
353
|
-
<!-- BEGIN GENERATED:README_MCP_FC_API_WORKFLOW -->
|
|
354
|
-
`licell mcp` 已提供这组 FC API 部署工作流工具(由共享 MCP 注册表自动生成):
|
|
355
|
-
|
|
356
|
-
| Tool | 对应 CLI | 用途 |
|
|
357
|
-
|------|----------|------|
|
|
358
|
-
| `licell_fc_deploy_spec` | `licell deploy spec` | 读取 FC API runtime 的 entry / handler / 资源约束,帮助 Agent 先理解限制与签名模板。 |
|
|
359
|
-
| `licell_fc_deploy_check` | `licell deploy check` | 只读预检当前项目,提前发现 handler、入口文件或 Docker 环境问题,并给出可执行修复建议。 |
|
|
360
|
-
| `licell_deploy` | `licell deploy` | 在前两步通过后执行正式部署,将当前项目发布到阿里云。 |
|
|
361
|
-
|
|
362
|
-
- Workflow:标准 FC API 部署链路:先读取部署规格,再做本地预检,最后执行正式部署。
|
|
363
|
-
|
|
364
|
-
- 建议顺序:`licell_fc_deploy_spec` → `licell_fc_deploy_check` → `licell_deploy`
|
|
365
|
-
<!-- END GENERATED:README_MCP_FC_API_WORKFLOW -->
|
|
366
|
-
|
|
367
376
|
## 静态站部署(OSS)
|
|
368
377
|
|
|
369
378
|
```bash
|
|
@@ -430,58 +439,6 @@ licell rollback
|
|
|
430
439
|
- **想要结果**:先用 `domain app/static` 或 `deploy`
|
|
431
440
|
- **要精细控制**:再落到 `fn domain` / `oss domain` / `dns records`
|
|
432
441
|
|
|
433
|
-
<!-- BEGIN GENERATED:README_MCP_DOMAIN_WORKFLOWS -->
|
|
434
|
-
`licell mcp` 也提供共享的域名编排 workflow 工具:
|
|
435
|
-
|
|
436
|
-
#### 应用域名绑定
|
|
437
|
-
|
|
438
|
-
通过一个入口同时编排 DNS、FC custom domain 与可选 HTTPS。
|
|
439
|
-
|
|
440
|
-
| Tool | 对应 CLI | 用途 |
|
|
441
|
-
|------|----------|------|
|
|
442
|
-
| `licell_domain_app_bind` | `licell domain app bind` | 为当前应用绑定自定义域名,编排 DNS、FC custom domain 与可选 HTTPS。 |
|
|
443
|
-
|
|
444
|
-
- Workflow:应用域名接入链路:绑定 FC custom domain、对齐 DNS,并可选自动签发 HTTPS。
|
|
445
|
-
|
|
446
|
-
- 建议顺序:`licell_domain_app_bind`
|
|
447
|
-
|
|
448
|
-
#### 静态站点域名绑定
|
|
449
|
-
|
|
450
|
-
通过一个入口同时编排 CDN、DNS 与可选 HTTPS。
|
|
451
|
-
|
|
452
|
-
| Tool | 对应 CLI | 用途 |
|
|
453
|
-
|------|----------|------|
|
|
454
|
-
| `licell_domain_static_bind` | `licell domain static bind` | 为静态站点绑定自定义域名,编排 CDN、DNS 与可选 HTTPS。 |
|
|
455
|
-
|
|
456
|
-
- Workflow:静态站点域名接入链路:把域名接到 CDN、对齐 DNS,并可选自动启用 HTTPS。
|
|
457
|
-
|
|
458
|
-
- 建议顺序:`licell_domain_static_bind`
|
|
459
|
-
|
|
460
|
-
#### 应用域名解绑
|
|
461
|
-
|
|
462
|
-
通过一个入口下线应用域名,并清理 FC custom domain / DNS。
|
|
463
|
-
|
|
464
|
-
| Tool | 对应 CLI | 用途 |
|
|
465
|
-
|------|----------|------|
|
|
466
|
-
| `licell_domain_app_unbind` | `licell domain app unbind` | 解绑当前应用域名,并清理 FC custom domain / DNS CNAME。 |
|
|
467
|
-
|
|
468
|
-
- Workflow:应用域名下线链路:解绑 FC custom domain,并清理对应 DNS CNAME。
|
|
469
|
-
|
|
470
|
-
- 建议顺序:`licell_domain_app_unbind`
|
|
471
|
-
|
|
472
|
-
#### 静态站点域名解绑
|
|
473
|
-
|
|
474
|
-
通过一个入口下线静态站点域名,并清理 CDN / DNS。
|
|
475
|
-
|
|
476
|
-
| Tool | 对应 CLI | 用途 |
|
|
477
|
-
|------|----------|------|
|
|
478
|
-
| `licell_domain_static_unbind` | `licell domain static unbind` | 解绑静态站点域名,并清理 CDN domain / DNS CNAME。 |
|
|
479
|
-
|
|
480
|
-
- Workflow:静态站点域名下线链路:移除 CDN domain,并清理对应 DNS CNAME。
|
|
481
|
-
|
|
482
|
-
- 建议顺序:`licell_domain_static_unbind`
|
|
483
|
-
<!-- END GENERATED:README_MCP_DOMAIN_WORKFLOWS -->
|
|
484
|
-
|
|
485
442
|
---
|
|
486
443
|
|
|
487
444
|
## 示例与教程
|
|
@@ -499,6 +456,8 @@ licell rollback
|
|
|
499
456
|
- `examples/node22-express-api`
|
|
500
457
|
- `examples/python313-flask-api`
|
|
501
458
|
- `examples/docker-bun-hono-api`
|
|
459
|
+
- `examples/node22-task-worker`
|
|
460
|
+
- `examples/python313-task-worker`
|
|
502
461
|
- `examples/static-oss-site`
|
|
503
462
|
|
|
504
463
|
---
|
|
@@ -546,14 +505,103 @@ licell e2e cleanup <runId>
|
|
|
546
505
|
## 命令速查
|
|
547
506
|
|
|
548
507
|
<!-- BEGIN GENERATED:README_QUICK_REFERENCE -->
|
|
549
|
-
> 本节由 licell CLI 注册表自动生成;命令变更会同步到 README / docs/reference/agent-surfaces.md / Skills /
|
|
508
|
+
> 本节由 licell CLI 注册表自动生成;命令变更会同步到 README / docs/reference/agent-surfaces.md / Skills / Shell Completion。
|
|
550
509
|
|
|
551
510
|
### Agent Contract
|
|
552
511
|
|
|
553
|
-
-
|
|
554
|
-
-
|
|
555
|
-
-
|
|
556
|
-
-
|
|
512
|
+
- 发现命令目录:`licell catalog --output json`。
|
|
513
|
+
- 读取单命令契约:`licell <command> --help --output json`。
|
|
514
|
+
- 真正执行命令:`licell <command> --output json`,并过滤 `@@LICELL_JSON@@` 前缀逐行解析。
|
|
515
|
+
- 对 `type=event` 的 record,优先读取稳定字段 `stage` / `action` / `status` / `source` / `terminal`。
|
|
516
|
+
- 对 `type=error` 的 record,优先读取 `nextActions[]` 获取首选补救步骤。
|
|
517
|
+
|
|
518
|
+
#### Schema Contracts
|
|
519
|
+
|
|
520
|
+
- 原始 CLI JSON 流会使用前缀 `@@LICELL_JSON@@` 输出逐行 JSON record;每条 record 当前都满足 `licell-cli-record@1.0`,再通过 `type=event|result|error` 区分记录类型。
|
|
521
|
+
- `licell <command> --help --output json`:读取 `help.kind` / `help.schemaVersion`;当前为 `licell-help@1.0`。
|
|
522
|
+
- `licell catalog --output json`:读取 `kind` / `schemaVersion`;当前为 `licell-agent-command-catalog@1.0`。
|
|
523
|
+
- `licell catalog --output json` 还会显式声明 help schema 与 CLI record schema:`licell-help@1.0` / `licell-cli-record@1.0`。
|
|
524
|
+
- Agent 优先读取 `nextActions[]` 作为稳定下一步入口;`recommendedFlow` / `decisionGuide` / `remediation[]` 作为补充语义层。
|
|
525
|
+
- 命令自己的业务结果字段继续读取对应命令 help / catalog 里的 `result`;下面三组 contract 只描述公共 CLI record 包络。
|
|
526
|
+
|
|
527
|
+
### CLI Event Record · licell-cli-record@1.0
|
|
528
|
+
|
|
529
|
+
- CLI 流式事件 record;适合驱动 Agent 的进度感知、日志桥接和阶段判断。
|
|
530
|
+
- `kind`:固定为 `licell-cli-record`。
|
|
531
|
+
- `schemaVersion`:CLI record schema 版本;当前为 `1.0`。
|
|
532
|
+
- `type`:固定为 `event`。
|
|
533
|
+
- `ts`:事件发出时间(ISO 8601)。
|
|
534
|
+
- `command`:当前命令 key,例如 `deploy`、`oss upload`。
|
|
535
|
+
- `stage`:稳定阶段标识,例如 `deploy`、`deploy.api`、`auth.restore`。
|
|
536
|
+
- `action`:稳定动作标识,例如 `run`、`execute`、`stdout`。
|
|
537
|
+
- `status`:`start` / `ok` / `failed` / `skipped` / `info`。
|
|
538
|
+
- `source`:`command` / `console` / `stream`。
|
|
539
|
+
- `terminal`:该事件是否代表当前动作进入终态。
|
|
540
|
+
- `ok`(可选):仅在终态成功/失败事件中出现;`true` 表示成功,`false` 表示失败。
|
|
541
|
+
- `message`(可选):面向人类的补充消息。
|
|
542
|
+
- `data`(可选):附加结构化上下文对象。
|
|
543
|
+
- `stream`(可选):当 `action=stdout|stderr` 时给出流类型。
|
|
544
|
+
|
|
545
|
+
### CLI Result Record Envelope
|
|
546
|
+
|
|
547
|
+
- CLI 成功结果 record;公共包络固定,命令自定义 payload 字段请继续读取对应命令 help/catalog 中的 `result`。
|
|
548
|
+
- `kind`:固定为 `licell-cli-record`。
|
|
549
|
+
- `schemaVersion`:CLI record schema 版本;当前为 `1.0`。
|
|
550
|
+
- `type`:固定为 `result`。
|
|
551
|
+
- `ts`:结果发出时间(ISO 8601)。
|
|
552
|
+
- `command`:当前命令 key。
|
|
553
|
+
- `stage`:命令阶段标识;通常与命令 key 或子阶段一致。
|
|
554
|
+
- `ok`:固定为 `true`。
|
|
555
|
+
|
|
556
|
+
### CLI Error Record
|
|
557
|
+
|
|
558
|
+
- CLI 错误结果 record;同时提供兼容层 remediation/nextCommands 和首选的 nextActions。
|
|
559
|
+
- `kind`:固定为 `licell-cli-record`。
|
|
560
|
+
- `schemaVersion`:CLI record schema 版本;当前为 `1.0`。
|
|
561
|
+
- `type`:固定为 `error`。
|
|
562
|
+
- `ts`:错误发出时间(ISO 8601)。
|
|
563
|
+
- `command`:当前命令 key。
|
|
564
|
+
- `stage`:错误阶段,例如 `parse`、`runtime`、`deploy`。
|
|
565
|
+
- `ok`:固定为 `false`。
|
|
566
|
+
- `error`:稳定错误对象。
|
|
567
|
+
- `code`:稳定错误码,例如 `CLI_INVALID_INPUT`、`AUTH_MISSING_CREDENTIAL`。
|
|
568
|
+
- `category`:`auth` / `permission` / `input` / `network` / `quota` / `conflict` / `not_found` / `internal`。
|
|
569
|
+
- `message`:错误主消息。
|
|
570
|
+
- `retryable`:该错误是否适合直接重试。
|
|
571
|
+
- `provider`(可选):阿里云 provider 侧上下文。
|
|
572
|
+
- `service`(可选):云产品名,例如 `fc`、`oss`、`alidns`。
|
|
573
|
+
- `action`(可选):云 API 动作名。
|
|
574
|
+
- `code`(可选):云侧原始错误码。
|
|
575
|
+
- `requestId`(可选):云侧 requestId。
|
|
576
|
+
- `httpStatus`(可选):云侧 HTTP 状态码。
|
|
577
|
+
- `endpoint`(可选):命中的云 API endpoint。
|
|
578
|
+
- `details`(可选):额外结构化错误上下文。
|
|
579
|
+
- `remediation[]`:兼容层修复建议数组。
|
|
580
|
+
- `type`:建议类型,例如 `note` / `command`。
|
|
581
|
+
- `title`:修复建议标题。
|
|
582
|
+
- `reason`:为什么建议这样做。
|
|
583
|
+
- `commandTemplate`:建议命令模板。
|
|
584
|
+
- `commandKey`(可选):若可匹配 CLI 注册表,则给出稳定 command key。
|
|
585
|
+
- `commandDescription`(可选):匹配到的命令说明。
|
|
586
|
+
- `phase`:修复阶段,例如 `inspect` / `mutate` / `verify`。
|
|
587
|
+
- `priority`:`primary` / `secondary`。
|
|
588
|
+
- `order`:稳定排序值。
|
|
589
|
+
- `nextCommands[]`:兼容层命令建议数组。
|
|
590
|
+
- `commandTemplate`:建议命令模板。
|
|
591
|
+
- `commandKey`(可选):若可匹配 CLI 注册表,则给出稳定 command key。
|
|
592
|
+
- `description`(可选):命令建议说明。
|
|
593
|
+
- `intent`:命令意图,例如 `inspect` / `repair` / `bind`。
|
|
594
|
+
- `priority`:`primary` / `secondary`。
|
|
595
|
+
- `nextActions[]`:推荐优先消费的统一下一步数组。
|
|
596
|
+
- `title`:下一步动作标题。
|
|
597
|
+
- `description`:为什么建议执行这一步。
|
|
598
|
+
- `commandTemplate`:建议命令模板。
|
|
599
|
+
- `commandKey`(可选):若可匹配 CLI 注册表,则给出稳定 command key。
|
|
600
|
+
- `phase`:动作阶段,例如 `inspect` / `verify` / `mutate`。
|
|
601
|
+
- `priority`:`primary` / `secondary`。
|
|
602
|
+
- `source`:动作来源,例如 `error-remediation`。
|
|
603
|
+
|
|
604
|
+
- Agent 侧做强约束解析时,先匹配 `kind`,再检查 `schemaVersion`;未知更高版本应走兼容分支或降级为文本解析。
|
|
557
605
|
|
|
558
606
|
### 命令总览
|
|
559
607
|
|
|
@@ -564,13 +612,20 @@ licell e2e cleanup <runId>
|
|
|
564
612
|
| 命令 | 说明 | 关键选项 |
|
|
565
613
|
|------|------|----------|
|
|
566
614
|
| `licell login` | 配置阿里云凭证 | `--account-id`, `--ak`, `--sk` |
|
|
567
|
-
| `licell auth export [passkey]` | 加密打包当前 licell 全局凭证状态到私有 OSS,并生成 restore token | `--bucket`, `--expires-hours` |
|
|
615
|
+
| `licell auth export [passkey]` | 加密打包当前 licell 全局凭证状态到私有 OSS,并生成 restore token | `--bucket`, `--expires`, `--expires-hours` |
|
|
616
|
+
| `licell auth inspect <token>` | 解析并查看 restore token 的内容与有效期 | — |
|
|
568
617
|
| `licell auth repair` | 修复凭证权限(推荐:用超级 AK/SK 自动补齐 licell 最小权限并继续使用) | `--account-id`, `--ak`, `--sk` |
|
|
569
618
|
| `licell auth restore <token> [passkey]` | 使用 restore token + passkey 一键恢复 licell 全局凭证状态 | `--yes` |
|
|
570
619
|
| `licell logout` | 清除本地凭证 | — |
|
|
571
620
|
| `licell whoami` | 查看当前登录身份 | — |
|
|
572
621
|
| `licell switch` | 切换默认 region | `--region` |
|
|
573
|
-
| `licell init` | 初始化 FC 项目(空目录生成脚手架,已有项目写入 licell 配置) | `--runtime`, `--
|
|
622
|
+
| `licell init` | 初始化 FC 项目(空目录生成脚手架,已有项目写入 licell 配置) | `--runtime`, `--kind`, `--app` |
|
|
623
|
+
| `licell bootstrap` | 把已确认的部署方案初始化到 `.licell/project.json` / `.licell/state.json` | `--component`, `--path`, `--type` |
|
|
624
|
+
| `licell workspace discover` | 扫描 repo,给出候选 components 与部署提案 | — |
|
|
625
|
+
| `licell workspace doctor` | 在 workspace / monorepo 根目录诊断全部或指定 component | `--component`, `--runtime`, `--entry` |
|
|
626
|
+
| `licell workspace init` | 在 repo 根目录创建或更新 licell workspace component | `--component`, `--path`, `--type` |
|
|
627
|
+
| `licell workspace list` | 列出当前 repo / workspace 中可部署的 components | `--component` |
|
|
628
|
+
| `licell workspace migrate` | 把旧单项目 `.licell/project.json` 升级成兼容旧版的 workspace/component 格式 | `--component`, `--path`, `--default` |
|
|
574
629
|
| `licell config domain [suffix]` | 查看或设置全局默认域名后缀 | `--unset` |
|
|
575
630
|
|
|
576
631
|
#### Delivery Workflow
|
|
@@ -579,32 +634,43 @@ licell e2e cleanup <runId>
|
|
|
579
634
|
|
|
580
635
|
- Agent 在 FC API 部署前,优先执行 `licell deploy spec` 与 `licell deploy check`。
|
|
581
636
|
- 涉及删除或清理的命令通常需要显式传入 `--yes`。
|
|
637
|
+
- 任务函数通过 `licell deploy --type task` 交付;部署成功后不返回固定 URL,而是继续用 `licell task invoke / info / list / stop` 完成调用与排查。
|
|
582
638
|
|
|
583
639
|
| 命令 | 说明 | 关键选项 |
|
|
584
640
|
|------|------|----------|
|
|
585
|
-
| `licell deploy` | 一键极速打包部署 | `--
|
|
641
|
+
| `licell deploy` | 一键极速打包部署 | `--component`, `--type`, `--entry` |
|
|
586
642
|
| `licell deploy check` | 本地预检 FC API 入口与 runtime 约束(建议 deploy 前执行) | `--runtime`, `--entry`, `--docker-daemon` |
|
|
643
|
+
| `licell deploy plan` | 基于 `.licell/project.json` 生成部署计划(不执行云端变更) | `--component`, `--include`, `--exclude` |
|
|
587
644
|
| `licell deploy spec [runtime]` | 查看 FC API 部署规格(给 Agent/开发者在 deploy 前对照) | `--all` |
|
|
588
|
-
| `licell
|
|
589
|
-
| `licell
|
|
590
|
-
| `licell
|
|
591
|
-
| `licell
|
|
592
|
-
| `licell
|
|
593
|
-
| `licell
|
|
594
|
-
| `licell
|
|
645
|
+
| `licell task config [name]` | 查看任务函数的异步调用配置 | `--component`, `--target` |
|
|
646
|
+
| `licell task info <taskId> [name]` | 查看单个异步任务详情 | `--component`, `--target` |
|
|
647
|
+
| `licell task invoke [name]` | 异步调用任务函数 | `--component`, `--target`, `--payload` |
|
|
648
|
+
| `licell task list [name]` | 查看任务函数的异步任务列表 | `--component`, `--target`, `--status` |
|
|
649
|
+
| `licell task stop <taskId> [name]` | 停止正在运行的异步任务 | `--component`, `--target` |
|
|
650
|
+
| `licell task config rm [name]` | 删除任务函数的异步调用配置 | `--component`, `--target`, `--yes` |
|
|
651
|
+
| `licell task config set [name]` | 写入任务函数的异步调用配置 | `--component`, `--target`, `--enable` |
|
|
652
|
+
| `licell release list` | 查看函数版本列表 | `--component`, `--limit` |
|
|
653
|
+
| `licell release promote [versionId]` | 发布并切流到目标别名 | `--component`, `--target` |
|
|
654
|
+
| `licell release prune` | 清理历史函数版本(默认仅预览) | `--component`, `--keep`, `--apply` |
|
|
655
|
+
| `licell release rollback <versionId>` | 回滚到指定函数版本 | `--component`, `--target` |
|
|
656
|
+
| `licell logs query [query]` | 按 SLS project/logstore/query 一次性检索日志 | `--project`, `--store`, `--region` |
|
|
657
|
+
| `licell logs tail [query]` | 按 SLS project/logstore/query 持续跟随日志流 | `--project`, `--store`, `--region` |
|
|
658
|
+
| `licell fn info [name]` | 查看函数详情 | `--component`, `--target` |
|
|
659
|
+
| `licell fn invoke [name]` | 调用函数(同步) | `--component`, `--target`, `--payload` |
|
|
595
660
|
| `licell fn list` | 查看函数列表 | `--limit`, `--prefix` |
|
|
596
|
-
| `licell fn
|
|
597
|
-
| `licell fn
|
|
661
|
+
| `licell fn logs [name]` | 查看函数日志(默认实时流式) | `--component`, `--once`, `--window` |
|
|
662
|
+
| `licell fn rm [name]` | 删除函数 | `--component`, `--force`, `--yes` |
|
|
663
|
+
| `licell fn domain bind <domain>` | 绑定或更新 FC 自定义域名(资源级,不默认改 DNS) | `--function`, `--component`, `--target` |
|
|
598
664
|
| `licell fn domain info <domain>` | 查看 FC 自定义域名详情 | — |
|
|
599
665
|
| `licell fn domain list` | 查看 FC 自定义域名列表 | `--limit`, `--prefix` |
|
|
600
666
|
| `licell fn domain unbind <domain>` | 解绑 FC 自定义域名 | `--cleanup-dns`, `--yes` |
|
|
601
|
-
| `licell env list` | 查看云端环境变量 | `--target`, `--show-values` |
|
|
602
|
-
| `licell env pull` | 拉取云端环境变量 | `--target` |
|
|
603
|
-
| `licell env rm <key>` | 删除云端环境变量(并同步本地 .licell/project.json) | `--yes` |
|
|
604
|
-
| `licell env set <key> <value>` | 设置云端环境变量(并同步本地 .licell/project.json) |
|
|
605
|
-
| `licell domain app bind <domain>` | 为当前应用编排 DNS、函数域名与可选 SSL | `--ssl`, `--ssl-force-renew
|
|
667
|
+
| `licell env list` | 查看云端环境变量 | `--component`, `--target`, `--show-values` |
|
|
668
|
+
| `licell env pull` | 拉取云端环境变量 | `--component`, `--target` |
|
|
669
|
+
| `licell env rm <key>` | 删除云端环境变量(并同步本地 .licell/project.json) | `--component`, `--yes` |
|
|
670
|
+
| `licell env set <key> <value>` | 设置云端环境变量(并同步本地 .licell/project.json) | `--component` |
|
|
671
|
+
| `licell domain app bind <domain>` | 为当前应用编排 DNS、函数域名与可选 SSL | `--component`, `--ssl`, `--ssl-force-renew` |
|
|
606
672
|
| `licell domain app unbind <domain>` | 解绑当前应用域名,并清理 FC custom domain / DNS CNAME | `--yes` |
|
|
607
|
-
| `licell domain static bind <domain>` | 为静态站点编排 CDN、DNS 与可选 HTTPS | `--
|
|
673
|
+
| `licell domain static bind <domain>` | 为静态站点编排 CDN、DNS 与可选 HTTPS | `--component`, `--bucket`, `--ssl` |
|
|
608
674
|
| `licell domain static unbind <domain>` | 解绑静态站点域名,并清理 CDN / DNS | `--yes` |
|
|
609
675
|
| `licell dns records add <domain>` | 添加域名解析记录 | `--rr`, `--type`, `--value` |
|
|
610
676
|
| `licell dns records list [domain]` | 查看域名解析记录 | `--limit` |
|
|
@@ -634,12 +700,14 @@ licell e2e cleanup <runId>
|
|
|
634
700
|
| 命令 | 说明 | 关键选项 |
|
|
635
701
|
|------|------|----------|
|
|
636
702
|
| `licell db add` | 分配数据库实例 | `--type`, `--engine-version`, `--category` |
|
|
703
|
+
| `licell db class [type]` | 查询数据库可用规格(给 Agent/开发者在 db add 前对照) | `--engine-version`, `--category`, `--storage-type` |
|
|
637
704
|
| `licell db connect [instanceId]` | 输出数据库连接信息 | — |
|
|
638
705
|
| `licell db info <instanceId>` | 查看数据库实例详情 | — |
|
|
639
706
|
| `licell db list` | 查看数据库实例列表 | `--limit` |
|
|
640
707
|
| `licell db public-access [instanceId]` | 开通数据库公网访问并添加当前 IP 到白名单 | `--ip` |
|
|
641
708
|
| `licell db rm <instanceId>` | 删除数据库实例 | `--yes` |
|
|
642
|
-
| `licell cache add` | 分配 Redis 缓存 | `--type`, `--
|
|
709
|
+
| `licell cache add` | 分配 Redis 缓存 | `--type`, `--mode`, `--instance` |
|
|
710
|
+
| `licell cache class [mode]` | 查询缓存可用规格(给 Agent/开发者在 cache add 前对照) | `--zone`, `--limit` |
|
|
643
711
|
| `licell cache connect [instanceId]` | 输出缓存连接信息 | — |
|
|
644
712
|
| `licell cache info <instanceId>` | 查看缓存实例详情 | — |
|
|
645
713
|
| `licell cache list` | 查看缓存实例列表 | `--limit` |
|
|
@@ -662,16 +730,18 @@ licell e2e cleanup <runId>
|
|
|
662
730
|
|
|
663
731
|
面向 Agent、开发体验与 CLI 生命周期的自动化命令。
|
|
664
732
|
|
|
665
|
-
- `licell skills init
|
|
733
|
+
- `licell skills init`、`licell catalog`、`licell completion` 都基于同一套 CLI 命令目录生成外部表面。
|
|
666
734
|
- `licell completion` 的候选命令同样来自共享命令目录。
|
|
667
735
|
|
|
668
736
|
| 命令 | 说明 | 关键选项 |
|
|
669
737
|
|------|------|----------|
|
|
670
|
-
| `licell
|
|
671
|
-
| `licell
|
|
672
|
-
| `licell
|
|
673
|
-
| `licell
|
|
674
|
-
| `licell
|
|
738
|
+
| `licell doctor` | 诊断本机 licell 登录态、云端权限/目标资源/域名入口、项目配置与部署前置条件 | `--component`, `--all-components`, `--runtime` |
|
|
739
|
+
| `licell catalog` | 输出共享 CLI 命令目录,供 Agent / 自动化发现命令、选项和结构化契约 | `--root-command`, `--command-key` |
|
|
740
|
+
| `licell ci init github` | 生成 GitHub Actions 的 deploy-only workflow(只调用 licell,不负责编译) | `--apply`, `--force`, `--workflow` |
|
|
741
|
+
| `licell ci init gitlab` | 生成 GitLab CI 的 deploy-only pipeline(只调用 licell,不负责编译) | `--apply`, `--force`, `--pipeline` |
|
|
742
|
+
| `licell skills init [agent]` | 为 AI Agent 生成 licell skills(claude / codex) | `--global`, `--project-root`, `--force` |
|
|
743
|
+
| `licell setup` | 安装后引导:交互式配置 AI Agent skills | `--agent`, `--global`, `--project-root` |
|
|
744
|
+
| `licell state show` | 查看当前 repo 的 `.licell/state.json` | `--component` |
|
|
675
745
|
| `licell completion [shell]` | 输出 shell 补全脚本(bash/zsh) | `--engine` |
|
|
676
746
|
| `licell upgrade` | 按当前安装来源升级 licell | `--channel`, `--target-version`, `--repo` |
|
|
677
747
|
| `licell e2e cleanup [runId]` | 清理指定 E2E run 产生的资源 | `--manifest`, `--keep-workspace`, `--yes` |
|
|
@@ -680,6 +750,18 @@ licell e2e cleanup <runId>
|
|
|
680
750
|
|
|
681
751
|
### 常用工作流片段
|
|
682
752
|
|
|
753
|
+
**Task 函数工作流**
|
|
754
|
+
|
|
755
|
+
```bash
|
|
756
|
+
licell deploy --type task --runtime nodejs22 --entry src/task.ts --target preview --output json
|
|
757
|
+
licell task config <appName> --target preview --output json
|
|
758
|
+
licell task invoke <appName> --target preview --payload '{"job":"demo"}' --output json
|
|
759
|
+
licell task info <taskId> <appName> --target preview --output json
|
|
760
|
+
licell task list <appName> --target preview --status Running --output json
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
说明:`deploy --type task` 成功后不会返回固定 URL;请读取结果里的 `invokeCommand`,或继续执行 `licell task invoke` / `task info` / `task list` 完成任务闭环。
|
|
764
|
+
|
|
683
765
|
**Shell 补全(bash / zsh)**
|
|
684
766
|
|
|
685
767
|
```bash
|
|
@@ -705,7 +787,7 @@ licell e2e list
|
|
|
705
787
|
licell e2e cleanup <runId>
|
|
706
788
|
```
|
|
707
789
|
|
|
708
|
-
|
|
790
|
+
说明:默认 smoke 套件会覆盖 API deploy/invoke 与 task deploy/config/invoke/list/info/stop;`licell e2e run --suite full` 会在此基础上额外覆盖 DNS add/rm、OSS bucket/object CRUD、OSS 原生域名 token/bind/unbind、`domain app bind/unbind`、`deploy --type static --domain ...` 与 `domain static bind/unbind`。如需连同云上资源一起收口,建议配合 `--cleanup`。
|
|
709
791
|
|
|
710
792
|
**删除 / 清理说明**
|
|
711
793
|
|
|
@@ -729,8 +811,8 @@ licell deploy --type api --target preview
|
|
|
729
811
|
### 我希望 Agent 自动、安全地部署
|
|
730
812
|
|
|
731
813
|
```bash
|
|
732
|
-
licell setup --agent codex
|
|
733
|
-
licell
|
|
814
|
+
licell setup --agent codex
|
|
815
|
+
licell catalog --output json
|
|
734
816
|
licell deploy spec nodejs22 --output json
|
|
735
817
|
licell deploy check --runtime nodejs22 --entry src/index.ts --output json
|
|
736
818
|
licell deploy --type api --runtime nodejs22 --entry src/index.ts --target preview --output json
|
|
@@ -763,4 +845,4 @@ licell e2e run --suite full --cleanup
|
|
|
763
845
|
- workflow 优先
|
|
764
846
|
- 原子命令兜底
|
|
765
847
|
- 命令自描述
|
|
766
|
-
-
|
|
848
|
+
- catalog / skills / docs 共源收敛
|