licell 0.9.41 → 0.10.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.
Files changed (3) hide show
  1. package/README.md +144 -108
  2. package/dist/licell.js +214 -157
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -27,10 +27,7 @@
27
27
  ## 安装
28
28
 
29
29
  ```bash
30
- # 方式一:npm 全局安装(推荐)
31
- npm install -g licell
32
-
33
- # 方式二:脚本安装
30
+ # 脚本一键安装
34
31
  curl -fsSL https://github.com/agents-infrastructure/licell/releases/latest/download/install.sh | bash
35
32
  ```
36
33
 
@@ -130,11 +127,17 @@ licell deploy check --runtime nodejs22 --entry src/index.ts
130
127
  - `examples`(最小可通过示例、常见失败示例、修复提示)
131
128
  - `validationRules`(对应预检规则 ID)
132
129
 
133
- `licell mcp` 已提供对应 MCP tools:
130
+ <!-- BEGIN GENERATED:README_MCP_FC_API_WORKFLOW -->
131
+ `licell mcp` 已提供这组 FC API 部署工作流工具(由共享 MCP 注册表自动生成):
132
+
133
+ | Tool | 对应 CLI | 用途 |
134
+ |------|----------|------|
135
+ | `licell_fc_deploy_spec` | `licell deploy spec` | 读取 FC API runtime 的 entry / handler / 资源约束,帮助 Agent 先理解限制与签名模板。 |
136
+ | `licell_fc_deploy_check` | `licell deploy check` | 只读预检当前项目,提前发现 handler、入口文件或 Docker 环境问题,并给出可执行修复建议。 |
137
+ | `licell_deploy` | `licell deploy` | 在前两步通过后执行正式部署,将当前项目发布到阿里云。 |
134
138
 
135
- - `licell_fc_deploy_spec`
136
- - `licell_fc_deploy_check`
137
- - `licell_deploy`(建议在前两步通过后再调用)
139
+ - 建议顺序:`licell_fc_deploy_spec` → `licell_fc_deploy_check` → `licell_deploy`
140
+ <!-- END GENERATED:README_MCP_FC_API_WORKFLOW -->
138
141
 
139
142
  ### Agent 可读输出(`--output json`)
140
143
 
@@ -223,7 +226,7 @@ licell skills init codex
223
226
  curl -fsSL https://github.com/agents-infrastructure/licell/releases/latest/download/install.sh | bash
224
227
  ```
225
228
 
226
- 如果 shell 还没包含 `~/.local/bin`:
229
+ 安装脚本会尝试把 `~/.local/bin` 写入当前 shell 的启动文件;当前这个终端会话仍需重新打开,或手动执行:
227
230
 
228
231
  ```bash
229
232
  export PATH="$HOME/.local/bin:$PATH"
@@ -235,14 +238,21 @@ licell --version
235
238
  ```bash
236
239
  licell upgrade
237
240
  # 或指定版本
238
- licell upgrade --version vX.Y.Z
241
+ licell upgrade --target-version vX.Y.Z
242
+ # 或显式指定升级渠道
243
+ licell upgrade --channel release
239
244
  ```
240
245
 
241
246
  安装逻辑说明:
242
247
 
243
- - 安装脚本和二进制都来自同一个 `releases/latest`
244
- - 优先下载预构建单文件可执行(无需本机 Node/npm/pnpm)
245
- - 若当前平台暂无预构建资产,自动回退源码安装
248
+ <!-- BEGIN GENERATED:README_UPGRADE_GUIDANCE -->
249
+ - `licell upgrade` 会优先按“当前正在执行的安装来源”升级
250
+ - 如果当前是 `npm` / `pnpm` / `yarn` / `bun` 全局安装,会调用对应包管理器执行全局升级
251
+ - 如果当前是项目内依赖、`node_modules/.bin/licell` 或开发链接,默认不会自动做全局升级
252
+ - 安装脚本和二进制都来自同一个 `releases/latest`,优先下载预构建单文件可执行;若当前平台暂无预构建资产,自动回退源码安装
253
+ - 如显式传入 `--repo` 或 `--script-url`,则强制走 GitHub release 升级渠道
254
+ - 可通过 `--channel auto|release|npm|pnpm|yarn|bun` 显式覆盖升级渠道;推荐先用 `licell upgrade --dry-run` 预览计划
255
+ <!-- END GENERATED:README_UPGRADE_GUIDANCE -->
246
256
 
247
257
  开发调试可用(不建议生产):
248
258
 
@@ -484,41 +494,113 @@ CDN,并回源到 OSS 地址,同时默认启用 HTTPS 证书签发与 CDN 证
484
494
 
485
495
  ## 6. 日常命令速查
486
496
 
487
- 认证与环境:
488
-
489
- ```bash
490
- licell login
491
- licell whoami
492
- licell switch --region cn-shanghai
493
- licell logout
494
- ```
495
-
496
- 固定 E2E 套件(发布前建议):
497
-
498
- ```bash
499
- # 执行 smoke 套件(默认)
500
- licell e2e run
501
-
502
- # 执行 full 套件(包含 static + oss upload)
503
- licell e2e run --suite full
504
-
505
- # e2e 默认使用公网模式(便于完全清理);需要验证 VPC 时显式开启
506
- licell e2e run --enable-vpc
507
-
508
- # 指定 runtime + 域名后缀 + CDN,执行后自动清理
509
- licell e2e run --runtime nodejs22 --domain-suffix your-domain.xyz --enable-cdn --cleanup
510
-
511
- # full 套件复用已有数据资源做 connect/info 校验(不新建 DB/Cache)
512
- licell e2e run --suite full --db-instance rm-xxx --cache-instance r-xxx
513
-
514
- # 查看历史 run
515
- licell e2e list
516
-
517
- # runId 清理
518
- licell e2e cleanup <runId>
519
- ```
520
-
521
- Shell 补全(bash / zsh):
497
+ <!-- BEGIN GENERATED:README_QUICK_REFERENCE -->
498
+ > 本节由 licell CLI 注册表自动生成;命令变更会同步到 README / docs/reference/agent-surfaces.md / Skills / MCP / Shell Completion。
499
+
500
+ ### 命令总览
501
+
502
+ #### Setup & Identity
503
+
504
+ 认证、项目初始化与默认配置相关命令。
505
+
506
+ | 命令 | 说明 | 关键选项 |
507
+ |------|------|----------|
508
+ | `licell login` | 配置阿里云凭证 | `--account-id`, `--ak`, `--sk` |
509
+ | `licell auth repair` | 修复凭证权限(推荐:用超级 AK/SK 自动补齐 licell 最小权限并继续使用) | `--account-id`, `--ak`, `--sk` |
510
+ | `licell logout` | 清除本地凭证 | — |
511
+ | `licell whoami` | 查看当前登录身份 | — |
512
+ | `licell switch` | 切换默认 region | `--region` |
513
+ | `licell init` | 初始化 FC 项目(空目录生成脚手架,已有项目写入 licell 配置) | `--runtime`, `--app`, `--force` |
514
+ | `licell config domain [suffix]` | 查看或设置全局默认域名后缀 | `--unset` |
515
+
516
+ #### Delivery Workflow
517
+
518
+ 围绕应用部署、发布、函数管理、环境变量、域名、DNS、日志和对象存储的交付链路。
519
+
520
+ - Agent 在 FC API 部署前,优先执行 `licell deploy spec` 与 `licell deploy check`。
521
+ - 涉及删除或清理的命令通常需要显式传入 `--yes`。
522
+
523
+ | 命令 | 说明 | 关键选项 |
524
+ |------|------|----------|
525
+ | `licell deploy` | 一键极速打包部署 | `--type`, `--entry`, `--dist` |
526
+ | `licell deploy check` | 本地预检 FC API 入口与 runtime 约束(建议 deploy 前执行) | `--runtime`, `--entry`, `--docker-daemon` |
527
+ | `licell deploy spec [runtime]` | 查看 FC API 部署规格(给 Agent/开发者在 deploy 前对照) | `--all` |
528
+ | `licell release list` | 查看函数版本列表 | `--limit` |
529
+ | `licell release promote [versionId]` | 发布并切流到目标别名 | `--target` |
530
+ | `licell release prune` | 清理历史函数版本(默认仅预览) | `--keep`, `--apply`, `--yes` |
531
+ | `licell release rollback <versionId>` | 回滚到指定函数版本 | `--target` |
532
+ | `licell logs` | 查看云端日志(默认实时流式) | `--once`, `--window`, `--lines` |
533
+ | `licell fn info [name]` | 查看函数详情 | `--target` |
534
+ | `licell fn invoke [name]` | 调用函数(同步) | `--target`, `--payload`, `--file` |
535
+ | `licell fn list` | 查看函数列表 | `--limit`, `--prefix` |
536
+ | `licell fn rm [name]` | 删除函数 | `--force`, `--yes` |
537
+ | `licell env list` | 查看云端环境变量 | `--target`, `--show-values` |
538
+ | `licell env pull` | 拉取云端环境变量 | `--target` |
539
+ | `licell env rm <key>` | 删除云端环境变量(并同步本地 .licell/project.json) | `--yes` |
540
+ | `licell env set <key> <value>` | 设置云端环境变量(并同步本地 .licell/project.json) | — |
541
+ | `licell domain add <domain>` | 绑定自定义域名 | `--ssl`, `--ssl-force-renew`, `--target` |
542
+ | `licell domain rm <domain>` | 解绑自定义域名并清理 DNS CNAME | `--yes` |
543
+ | `licell dns records add <domain>` | 添加域名解析记录 | `--rr`, `--type`, `--value` |
544
+ | `licell dns records list [domain]` | 查看域名解析记录 | `--limit` |
545
+ | `licell dns records rm <recordId>` | 删除域名解析记录 | `--yes` |
546
+ | `licell oss bucket [bucket]` | 上传本地目录到 OSS Bucket 指定目录(兼容命令,等同 oss upload) | `--bucket`, `--source-dir`, `--target-dir` |
547
+ | `licell oss info <bucket>` | 查看 OSS Bucket 详情 | — |
548
+ | `licell oss list` | 查看 OSS Bucket 列表 | `--limit` |
549
+ | `licell oss ls <bucket> [prefix]` | 列出 Bucket 对象 | `--limit` |
550
+ | `licell oss upload [bucket]` | 上传本地目录到 OSS Bucket 指定目录 | `--bucket`, `--source-dir`, `--target-dir` |
551
+
552
+ #### Data Services
553
+
554
+ 数据库、缓存与 Supabase 实例的创建、连接、白名单和生命周期管理。
555
+
556
+ | 命令 | 说明 | 关键选项 |
557
+ |------|------|----------|
558
+ | `licell db add` | 分配数据库实例 | `--type`, `--engine-version`, `--category` |
559
+ | `licell db connect [instanceId]` | 输出数据库连接信息 | — |
560
+ | `licell db info <instanceId>` | 查看数据库实例详情 | — |
561
+ | `licell db list` | 查看数据库实例列表 | `--limit` |
562
+ | `licell db public-access [instanceId]` | 开通数据库公网访问并添加当前 IP 到白名单 | `--ip` |
563
+ | `licell db rm <instanceId>` | 删除数据库实例 | `--yes` |
564
+ | `licell cache add` | 分配 Redis 缓存 | `--type`, `--instance`, `--password` |
565
+ | `licell cache connect [instanceId]` | 输出缓存连接信息 | — |
566
+ | `licell cache info <instanceId>` | 查看缓存实例详情 | — |
567
+ | `licell cache list` | 查看缓存实例列表 | `--limit` |
568
+ | `licell cache public-access [instanceId]` | 开通 Redis 公网访问并添加当前 IP 到白名单 | `--ip` |
569
+ | `licell cache rm <instanceId>` | 删除缓存实例 | `--yes` |
570
+ | `licell cache rotate-password` | 轮换 Redis 密码 | `--instance` |
571
+ | `licell supa add` | 创建 RDS Supabase 实例 | `--name`, `--vsw`, `--class` |
572
+ | `licell supa config <instanceName>` | 查看 Supabase 实例配置(auth/storage/rag) | `--set-auth`, `--set-storage`, `--rag` |
573
+ | `licell supa connect <instanceName>` | 查看 Supabase 连接信息和 API Keys | — |
574
+ | `licell supa info <instanceName>` | 查看 Supabase 实例详情 | — |
575
+ | `licell supa list` | 查看 Supabase 实例列表 | `--limit` |
576
+ | `licell supa reset-password <instanceName>` | 重置 Supabase Dashboard 或数据库密码 | `--dashboard-password`, `--db-password` |
577
+ | `licell supa restart <instanceName>` | 重启 Supabase 实例 | — |
578
+ | `licell supa rm <instanceName>` | 删除 Supabase 实例 | `--yes` |
579
+ | `licell supa start <instanceName>` | 启动 Supabase 实例 | — |
580
+ | `licell supa stop <instanceName>` | 暂停 Supabase 实例 | — |
581
+ | `licell supa whitelist <instanceName>` | 查看/修改 Supabase IP 白名单 | `--set`, `--add`, `--remove` |
582
+
583
+ #### Automation & Tooling
584
+
585
+ 面向 Agent、开发体验与 CLI 生命周期的自动化命令。
586
+
587
+ - `licell skills init` 与 `licell mcp` 都基于同一套 CLI 命令目录生成外部表面。
588
+ - `licell completion` 的候选命令同样来自共享命令目录。
589
+
590
+ | 命令 | 说明 | 关键选项 |
591
+ |------|------|----------|
592
+ | `licell mcp [action]` | MCP:让 Agent 通过 licell 执行部署/发布/运维(初始化 .mcp.json 或启动 stdio server) | `--project-root`, `--server-name` |
593
+ | `licell skills init [agent]` | 为 AI Agent 生成 licell skills(claude / codex) | `--project-root`, `--force` |
594
+ | `licell setup` | 安装后引导:配置 AI Agent Skills 和 MCP | `--agent`, `--global`, `--project-root` |
595
+ | `licell completion [shell]` | 输出 shell 补全脚本(bash/zsh) | `--engine` |
596
+ | `licell upgrade` | 按当前安装来源升级 licell | `--channel`, `--target-version`, `--repo` |
597
+ | `licell e2e cleanup [runId]` | 清理指定 E2E run 产生的资源 | `--manifest`, `--keep-workspace`, `--yes` |
598
+ | `licell e2e list` | 查看本项目 e2e 运行记录 | — |
599
+ | `licell e2e run` | 执行固定 E2E 套件(默认 smoke) | `--suite`, `--run-id`, `--runtime` |
600
+
601
+ ### 常用工作流片段
602
+
603
+ **Shell 补全(bash / zsh)**
522
604
 
523
605
  ```bash
524
606
  mkdir -p ~/.local/share/licell/completions
@@ -532,70 +614,23 @@ licell completion zsh > ~/.local/share/licell/completions/_licell
532
614
  echo '[[ -f "$HOME/.local/share/licell/completions/_licell" ]] && source "$HOME/.local/share/licell/completions/_licell"' >> ~/.zshrc
533
615
  ```
534
616
 
535
- 函数与调试:
617
+ **固定 E2E 套件(发布前建议)**
536
618
 
537
619
  ```bash
538
- # 先看 runtime 规格,再做入口预检(推荐 Agent 固定执行)
539
- licell deploy spec nodejs22
540
- licell deploy check --runtime nodejs22 --entry src/index.ts
541
-
542
- licell fn list
543
- licell fn info [name] --target preview
544
- licell fn invoke [name] --target preview --payload '{"ping":"pong"}'
545
- licell fn rm [name]
546
- licell fn rm [name] --force
547
- # 非交互/CI 场景删除需显式确认
548
- licell fn rm [name] --yes
549
- licell fn rm [name] --force --yes
550
- ```
551
-
552
- 环境变量:
553
-
554
- ```bash
555
- licell env list --target preview
556
- licell env set KEY VALUE
557
- licell env rm KEY
558
- licell env pull --target preview
559
- ```
560
-
561
- 域名与 DNS:
562
-
563
- ```bash
564
- licell domain add api.your-domain.xyz --target preview --ssl
565
- licell domain rm api.your-domain.xyz
566
- licell domain rm api.your-domain.xyz --yes
567
- licell dns records list your-domain.xyz
568
- licell dns records add your-domain.xyz --rr preview --type CNAME --value target.example.com
569
- licell dns records rm <recordId>
570
- licell dns records rm <recordId> --yes
571
- ```
572
-
573
- 发布:
574
-
575
- ```bash
576
- licell release list --limit 20
577
- licell release promote --target prod
578
- licell release rollback <versionId> --target prod
579
- licell release prune --keep 10
580
- licell release prune --keep 10 --apply
581
- licell release prune --keep 10 --apply --yes
620
+ licell e2e run
621
+ licell e2e run --suite full
622
+ licell e2e run --enable-vpc
623
+ licell e2e run --runtime nodejs22 --domain-suffix your-domain.xyz --enable-cdn --cleanup
624
+ licell e2e list
625
+ licell e2e cleanup <runId>
582
626
  ```
583
627
 
584
- 说明:涉及删除/清理的命令在非交互模式下需要 `--yes`(交互模式会二次确认)。
585
-
586
- 日志与对象存储:
587
-
588
- ```bash
589
- licell logs
590
- licell oss list
591
- licell oss info <bucket>
592
- licell oss ls <bucket> [prefix]
593
- licell oss upload <bucket> --source-dir dist --target-dir mysite
594
- licell oss bucket --bucket <bucket> --source-dir dist --target-dir mysite
595
- ```
628
+ **删除 / 清理说明**
596
629
 
597
- 说明:`oss upload` 与 `oss bucket` 等价;`--target-dir` 不传时上传到 Bucket
598
- 根目录。
630
+ - 涉及删除、解绑、清理的命令在非交互模式下通常需要显式传入 `--yes`。
631
+ - API 部署前建议固定执行 `licell deploy spec` 与 `licell deploy check`。
632
+ - `licell upgrade --dry-run` 可先查看当前安装来源与升级计划。
633
+ <!-- END GENERATED:README_QUICK_REFERENCE -->
599
634
 
600
635
  ## 7. 进阶:运行时细节
601
636
 
@@ -853,7 +888,8 @@ git push origin v1.0.0
853
888
  `zsh: command not found: licell`
854
889
 
855
890
  - 重新执行安装脚本
856
- - 确认 `~/.local/bin` `PATH`
891
+ - 安装脚本会尝试写入 shell 启动文件,但不会修改当前父 shell 的环境变量
892
+ - 重新打开终端,或执行 `export PATH="$HOME/.local/bin:$PATH"`
857
893
 
858
894
  `licell login` 在哪执行?
859
895