SKY CLI 整合了我们开发过程中用到的所有命令,你可以通过它完成 cms文案同步
, 机器翻译
, 项目构建部署
等常用功能。
npx @eaglelz/sky-cli@latest
npm install -g @eaglelz/sky-cli
Usage: sky [command]
Options:
-v, --version Output the current version
-h, --help Display help for command
Commands:
publish [options] [projectName] 公有云应用部署
cms [options] [action] 多语言文件管理
构建部署公有云应用
Usage: sky publish [options] [projectName]
公有云应用部署
Arguments:
projectName 应用唯一标识, 默认取package.json name 字段,也可以手动指定 e.g., micro-idaas
Options:
-env --environment [string] 指定部署环境, 默认为dev, e.g., dev, pre, prod, aquila, hybrid
--releaseVersion [string] 指定部署版本号, 默认从分支名 `release-1.0.0` 上截取, e.g, 1.0.0, hybrid: 0.0.0-20240712
--sourceDir [string] 指定需文件上传目录, 相对项目跟路径,默认是 `dist`
-h, --help Display help for command
Output:
SKY CLI v0.0.0
🚀 应用标识: micro-idaas, 部署环境: dev
🚀 ~ 开始构建 ~
🚀 ~ 上传 OSS ~
🚀 ~ 开始部署 ~
╭─────────────────────── SKY CLI ────────────────────────╮
│ │
│ projectName: micro-idaas │
│ releaseVersion: 1.1.1 │
│ cdn: https://cdn.eagleyun.com/micro-idaas/dev-1.1.1 │
│ │
╰────────────────────────────────────────────────────────╯
私有化构建打包
Usage: sky private [options]
私有化应用打包
Options:
-env --environment [string] 指定部署环境, 默认为dev, e.g., ctct
--sourceDir [string] 指定需文件上传目录, 相对项目跟路径,默认是 `dist`
--targetDir [string] 指定需文件打包文件目录, 相对项目跟路径,默认是 pkg.name
--privateVersion [string] 指定部署版本号, 默认 git tag `private-v1.0.0` 上截取, e.g, v1.0.0
-h, --help Display help for command
Output:
SKY CLI v0.0.6
🚀 应用标识: portal, 打包环境: , 打包版本: v0.0.0
SKY CLI: 资源路径: filePath: xxx/xxx/static_v0.0.0.tar.gz
SKY CLI: 当前版本不存在 xxx/xxx/static_v0.0.0.tar.gz
SKY CLI: 当前版本不存在,进行全量更新 portal
SKY CLI: Successfully copied /xx/h5_pc/dist to /xx/h5_pc/_tmp/project/static/portal
✔ compressToTarGz successful: 压缩成功
✔ 私有化上传成功 upload successful: /xx/h5_pc/_tmp/compress/static.tar.gz
SKY CLI: 资源路径: filePath: xxx/xxx/static_v0.0.0.tar.gz
清理临时文件
清理临时文件完成
╭─────────────────────── oss object info ────────────────────────╮
│ │
│ name: xxx/xxx/static_v0.0.0.tar.gz │
│ url: https://xxxxx.com/xx/xxx/static_v0.0.0.tar.gz │
│ etag: "xxxxxx" │
│ type: "xxx" │
│ lastModified:2024-06-29T10:55:41.000Z │
│ storageClass: Standard │
│ │
╰────────────────────────────────────────────────────────────────╯
多语言文件管理
Usage: sky cms [action]
多语言文件管理
Arguments:
action:
push 上传本地多语言文件到远程
diff 对比本地多语言文件,筛选出没有英文文案的中文,存储在临时文件 .eg 的 diff.json 文件内
translate 筛查远程多语言文案,自动将未翻译的文案添加 Google 翻译英文文案
Options:
-h, --help Display help for command