📦 打包
复制一个包含安装步骤和本插件的完整Markdown指南的设置提示。
📦 为在 Capgo 云中部署应用程序包管理,包括上传、兼容性检查和加密。
⬆️ 上传
标题: ⬆️ 上传别名: u
npx @capgo/cli@latest bundle upload⬆️ 将应用程序包上传到 Capgo 云以进行分发。 版本必须大于 0.0.0 并且唯一。已删除的版本不能重用以保证安全。 外部选项:仅存储一个 URL 链接(对于大于 200MB 的应用程序或隐私要求有用)。 Capgo 从未检查外部内容。添加加密以实现无信任安全。
示例:
npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production,beta当您不传递时,自动将下一个免费的semver从通道(或最新远程应用版本)更新到下一个版本 (或 latest remote app version)。 --bundle在CI中有用时 package.json 已经匹配了版本 Capgo:
npx @capgo/cli@latest bundle upload --channel=production --auto-bumpnpx @capgo/cli@latest bundle upload --auto-bump majornpx @capgo/cli@latest bundle upload --auto-bump minor # default when the flag has no valuenpx @capgo/cli@latest bundle upload --auto-bump patch # alias: fixnpx @capgo/cli@latest bundle upload --auto-bump metadatanpx @capgo/cli@latest bundle upload --channel=production --auto-bump ai使用 __CAPGO_KEEP_0__ __CAPGO_KEEP_1__ Workers AI 将本地捆绑文件与之前的 __CAPGO_KEEP_2__/channel delta manifest 进行比较,推断 --auto-bump ai, Capgo Cloudflare Workers AI compares local bundle files to the previous Capgo/channel delta manifest, infers major | minor | patch | metadata, and prints a short reason in the CLI log. If no previous Capgo version exists, AI is skipped and the bump defaults to 选项:.
Options:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API |
| -p | string | 上传文件夹的路径,如果不提供,会使用capacitor.config中的webDir |
| -c | string | 要链接的频道,使用逗号分隔多个频道,例如production,beta |
| --rollout | string | 将上传的包作为此频道的发布目标,百分比范围为0到100 |
| --stable | boolean | 在一个 rollout-configured 通道上,替换稳定fallback而不是设置 rollout 目标 |
| —rollout-percentage-bps | string | 设置从 0 到 10000 的已上传包装的 rollout 百分比(基点) |
| —rollout-cache-ttl-seconds | string | Cloudflare rollout 决策缓存 TTL(秒) |
| -e | string | 将包装链接到外部 URL 而不是上传到 Capgo 云 |
| —iv-session-key | string | 设置包装 URL 外部的 IV 和会话密钥 |
| —s3-region | string | 您的 S3 存储桶所在的区域 |
| —s3-apikey | string | API 键为您的 S3 端点 |
| —s3-apisecret | string | API 秘密键为您的 S3 端点 |
| —s3-endpoint | string | S3 端点的 URL |
| —s3-bucket-name | string | 您的 AWS S3 桶的名称 |
| —s3-port | string | 您的 S3 端点的端口 |
| —no-s3-ssl | boolean | 禁用 S3 上传的 SSL |
| —key-v2 | string | 自定义私钥路径 (v2 系统) |
| —key-data-v2 | string | 私钥 (v2 系统) |
| —bundle-url | boolean | 将包 URL 打印到标准输出 |
| —no-key | boolean | 忽略签名密钥并发送清晰的更新 |
| —no-code-check | boolean | 忽略检查源 code 中的 notifyAppReady() 是否被调用,并且根目录中是否存在索引 |
| —display-iv-session | boolean | 在控制台中显示用于加密更新的 IV 和会话密钥 |
| -b | string | 上传的包的版本号 |
| —auto-bump | string | 从频道关联的包中自动递增,否则使用最新的远程应用程序版本。级别:主版本、次版本(默认)、修订版本(修复版本)、元数据或ai(Worker AI根据本地与之前的delta清单推断级别;如果没有之前的Capgo版本,则回退到修订版本)。直到找到一个空闲的名称(删除的名称将占用)。不能与—bundle(-b)一起使用 |
| —link | string | 链接到外部资源(例如GitHub发布) |
| —comment | string | 关于此版本的注释,可能是发布说明、提交哈希、提交消息等 |
| —min-update-version | string | 此版本所需的最小版本号。仅当频道中禁用自动更新设置为元数据时才使用 |
| —auto-min-update-version | boolean | 根据本地包设置最小更新版本 |
| —ignore-metadata-check | boolean | 忽略上传时的元数据(node_modules)检查 |
| —fail-on-incompatible | boolean | 当包与渠道当前本地包不兼容时,上传失败(退出非零状态)而不是上传。交互式终端中仍可选择本地构建;拒绝上传失败。不能与 —ignore-metadata-check 一起使用。 |
| —ignore-checksum-check | boolean | 忽略上传时的校验和检查 |
| —force-crc32-checksum | boolean | 强制CRC32校验和上传(覆盖自动检测) |
| —timeout | string | 上传过程超时时间(以秒为单位) |
| —multipart | boolean | [已弃用] 使用 —tus 代替。使用多部分协议进行 S3 上传 |
| —zip | boolean | 使用 zip 上传包到 Capgo 云 (legacy) |
| —tus | boolean | 使用 TUS 上传包到 Capgo 云 |
| —tus-chunk-size | string | TUS 分段上传时的字节块大小(默认:自动) |
| —partial | boolean | [已弃用] 使用 —delta 代替。上传增量更新 |
| —partial-only | boolean | [已弃用] 使用 —delta-only 代替。仅上传增量更新,跳过完整包 |
| —delta | boolean | 上传差异更新(仅更改的文件)以实现实时、超快更新而不是大型 zip 下载 |
| —delta-only | boolean | 以最大速度上传仅 delta 更新而非完整包(适用于大型应用) |
| —no-delta | boolean | 禁用 delta 更新,即使启用了即时更新 |
| —encrypted-checksum | string | 加密校验和(签名)。仅在上传外部包时使用 |
| —auto-set-bundle | boolean | 设置包在 capacitor.config.json 中 |
| —dry-upload | boolean | 干燥上传包过程:在数据库中添加行而非上传文件或更新频道(Capgo 内部测试使用) |
| —package-json | string | 多包项目的 package.json 文件路径(用逗号分隔) |
| —node-modules | string | 多仓库项目的node_modules目录路径(逗号分隔) |
| —encrypt-partial | boolean | —加密差分更新文件(自动启用于更新器 > 6.14.4) |
| —delete-linked-bundle-on-upload | boolean | 在您尝试上传的频道中定位当前链接的捆绑包并删除它 |
| —no-brotli-patterns | string | 要排除的Brotli压缩文件(逗号分隔模式,例如“.jpg,.png”) |
| —disable-brotli | boolean | 即使更新器版本支持它,也完全禁用Brotli压缩 |
| —version-exists-ok | boolean | 如果包版本已经存在,退出成功,适用于CI/CD工作流程中的多包仓库 |
| __CAPGO_KEEP_0__ | boolean | 允许设备自动加入此频道(更新频道设置) |
| 打印终端二维码__CAPGO_KEEP_0__用于此包预览 | boolean | Print a terminal QR code for this bundle preview after upload |
| 自定义Supabase主机URL(用于自主托管或__CAPGO_KEEP_0__开发) | boolean | 自定义Supabase匿名密钥(用于自主托管) |
| 详细模式 | string | Capgo |
| __CAPGO_KEEP_0__ | string | __CAPGO_KEEP_0__ |
| __CAPGO_KEEP_0__ | boolean | 启用详细日志的verbose输出 |
🧪 兼容性
兼容性npx @capgo/cli@latest bundle compatibility🧪 在Capgo Cloud中检查一个特定频道的包与Capgo Cloud的兼容性,以确保更新是安全的。
示例:
npx @capgo/cli@latest bundle compatibility com.example.app --channel production选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API key to link to your account |
| -c | string | 频道 |
| —text | boolean | 输出文本而不是表情符号 |
| —package-json | string | 多包项目的package.json文件路径(用逗号分隔) |
| —node-modules | string | 多包项目的node_modules目录路径(用逗号分隔) |
| —supa-host | string | 自定义 Supabase 主机 URL(用于自主托管或 Capgo 开发) |
| —supa-anon | string | 自定义 Supabase 匿名密钥(用于自主托管) |
🔹 发布类型
发布类型npx @capgo/cli@latest bundle releaseType🧭 根据与频道最新元数据的兼容性打印“native”或“OTA”。
示例:
npx @capgo/cli@latest bundle releaseType com.example.app --channel production选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API 与您的帐户关联的密钥 |
| -c | string | 与之比较的频道 |
| --package-json | string | 多包项目的package.json文件路径(以逗号分隔) |
| --node-modules | string | 多包项目的node_modules目录路径(以逗号分隔) |
| --supa-host | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| —supa-anon | string | 自定义 Supabase 匿名密钥(用于自主托管) |
🗑️ 删除
标题:删除别名: d
npx @capgo/cli@latest bundle delete🗑️ 从 Capgo 云中删除特定包, optionally 目标单个版本。
示例:
npx @capgo/cli@latest bundle delete BUNDLE_ID com.example.app选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API 与您的帐户关联的密钥 |
| –supa-host | string | 自定义 Supabase 主机 URL(用于自主托管或 Capgo 开发) |
| –supa-anon | string | 自定义 Supabase 匿名密钥(用于自主托管) |
📋 列表
名为“ 📋 列表”的部分别名: l
npx @capgo/cli@latest bundle list📋 为应用程序列出所有已上传的包:Capgo Cloud
示例:
npx @capgo/cli@latest bundle list com.example.app选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API key to link to your account |
| — | string | 自定义 Supabase 主机 URL(用于自主托管或 Capgo 开发) |
| — | string | 自定义 Supabase 匿名密钥(用于自主托管) |
🧹 清理
标题:清理别名: c
npx @capgo/cli@latest bundle cleanup🧹 在 Capgo 云中删除旧的捆绑包,保留指定数量的最近版本。 与频道相关的捆绑包除非使用 —ignore-channel,否则将被保留。
示例:
npx @capgo/cli@latest bundle cleanup com.example.app --bundle=1.0 --keep=3选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -b | string | 要删除的应用程序的包版本号 |
| -a | string | API 与您的帐户关联的密钥 |
| -k | string | 保留的版本数量 |
| -f | boolean | 强制删除 |
| —ignore-channel | boolean | 即使与频道相关,仍删除包装(警告:也会删除频道) |
| —supa-host | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| —supa-anon | string | 自定义 Supabase 匿名密钥(用于自主托管) |
🔒 加密
标题:加密npx @capgo/cli@latest bundle encrypt🔒 为安全外部存储加密一个 zip 包。 返回 ivSessionKey 用于上传/解密。使用 ‘bundle zip —json’ 获取校验和。
示例:
npx @capgo/cli@latest bundle encrypt ./myapp.zip CHECKSUM选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| —key | string | 自定义私钥路径 |
| —key-data | string | 私钥 |
| -j | boolean | 输出为 JSON |
| —package-json | string | 多包项目中的 package.json 文件路径(以逗号分隔) |
🔓 解密
标题为 “ 🔓 解密” 的部分npx @capgo/cli@latest bundle decrypt🔓 解密一个加密的包(主要用于测试)。 验证时打印 base64 会话密钥。
示例:
npx @capgo/cli@latest bundle decrypt ./myapp_encrypted.zip CHECKSUM选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| —key | string | 私有签名密钥的自定义路径 |
| —key-data | string | 私有签名密钥 |
| —checksum | string | 校验包的完整性,计算包的校验和 |
| —package-json | string | 多包项目的package.json文件路径(以逗号分隔) |
🔹 压缩包
标题:压缩包npx @capgo/cli@latest bundle zip🗜️ 生成应用程序捆绑包的压缩文件。 返回用于加密的校验和。使用 —json 获取机器可读输出。
示例:
npx @capgo/cli@latest bundle zip com.example.app --path ./dist选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -p | string | 上传文件夹的路径,如果未提供则使用capacitor.config中的webDir |
| -b | string | zip文件的版本号 |
| -n | string | zip文件的名称 |
| -j | boolean | 以JSON输出 |
| --no-code-check | boolean | 忽略源code和根目录中的index文件中是否调用了notifyAppReady()函数 |
| --key-v2 | boolean | 使用加密v2 |
| —package-json | string | 多包仓库中的package.json文件路径(逗号分隔) |