打包
复制一个包含安装步骤和本插件的完整Markdown指南的设置提示。
📦 Manage app bundles for deployment in Capgo Cloud, including upload, compatibility checks, and encryption.
⬆️ 终端窗口
复制到剪贴板⬆️ 将新应用程序包装上传到 __CAPGO_KEEP_0__ 云以进行分发。
版本必须大于 0.0.0 并且唯一。已删除的版本不能重用以保证安全。
外部选项:仅存储 URL 链接(对于大于 200MB 的应用程序或隐私要求有用)。
__CAPGO_KEEP_1__ 从未检查外部内容。添加加密以实现无信任安全。 u
npx @capgo/cli@latest bundle upload⬆️ Upload a new app bundle to Capgo Cloud for distribution. Version must be > 0.0.0 and unique. Deleted versions cannot be reused for security. External option: Store only a URL link (useful for apps >200MB or privacy requirements). Capgo never inspects external content. Add encryption for trustless security.
准备好粘贴
npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production,beta当您不传递时,自动将下一个免费的semver从通道(或最新远程应用版本)更新到 (或 latest remote app version) --bundle在CI中有用 package.json already matches a version Capgo has:
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使用 --auto-bump ai, Capgo Cloudflare Workers AI 将本地捆绑文件与之前的 Capgo/channel delta manifest 进行比较,推断 major | minor | patch | metadata,并在 CLI 日志中打印一个短的原因。如果不存在之前的 Capgo 版本,AI将被跳过,升级将默认为 修补.
选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API key to link to your account |
| -p | string | capacitor 中的 webDir 配置项所指向的文件夹路径,如果未提供则使用此路径 |
| -c | string | 要链接的频道,多个频道使用逗号分隔,例如 production,beta |
| —rollout | string | 将上传的包设置为此频道的发布目标,百分比范围为 0 到 100 |
| —rollout-percentage-bps | string | 将上传的包发布百分比设置为基点范围为 0 到 10000 |
| —rollout-cache-ttl-秒 | string | Cloudflare rollout decision cache TTL 秒 |
| -e | string | 将链接转为外部 URL 而不是上传到 Capgo 云 |
| —iv-session-key | string | 设置 bundle 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 | 将 bundle URL 打印到标准输出 |
| —no-key | boolean | 忽略签名密钥并发送清晰的更新 |
| —no-code-check | boolean | 忽略检查源 code 和索引是否在根目录中存在 |
| —display-iv-session | boolean | 在控制台中显示用于加密更新的 IV 和会话密钥 |
| -b | string | 要上传的 bundle 的版本号 |
| —auto-bump | string | 从频道链接的 bundle 自动递增,否则使用最新的远程应用版本。级别:主(major)、次(minor)、补丁(patch,等同于修复(fix))、元数据(metadata)或 AI(Workers AI 根据本地 vs 之前 delta manifest 自动推断级别;如果没有之前的 Capgo 版本,则回退到补丁(patch)。直到找到一个空闲的名称(删除的名称仍占用) |
| ——外部链接 | string | 到外部资源的链接(例如 GitHub 发布) |
| ——评论 | string | 关于此版本的评论,可能是发布说明、提交哈希、提交消息等 |
| ——最小更新版本 | string | 最小版本要求才能更新到此版本。仅当禁用自动更新设置为渠道的元数据时才使用 |
| ——自动最小更新版本 | boolean | 设置基于本机包的最小更新版本 |
| ——忽略元数据检查 | boolean | 忽略元数据(node_modules)检查时上传 |
| ——在不兼容时失败 | boolean | 在上传时失败(退出非零)而不是上传,bundle 与渠道当前的本机包不兼容。在交互式终端中,您仍然可以选择本机构建;拒绝失败。不能与 —ignore-metadata-check 一起使用 |
| —ignore-checksum-check | boolean | 忽略上传时的校验和检查 |
| —force-crc32-checksum | boolean | 强制CRC32校验和上传(覆盖自动检测) |
| —timeout | string | 上传过程超时时间(以秒为单位) |
| —multipart | boolean | [已弃用] 使用 —tus 代替。使用多部分协议进行 S3 上传 |
| —zip | boolean | 使用 zip 将包上传到 Capgo 云(遗留) |
| —tus | boolean | 使用 TUS 将包上传到 Capgo 云 |
| ——tus-chunk-size | string | TUS可恢复上传的字节块大小(默认:自动) |
| ——partial | boolean | [已弃用] 使用 —delta 代替。上传增量更新 |
| ——partial-only | boolean | [已弃用] 使用 —delta-only 代替。仅上传增量更新,跳过完整包 |
| ——delta | boolean | 上传差异更新(仅更改的文件)以实现实时、超快更新,而不是大型zip下载 |
| ——delta-only | boolean | 仅上传差异更新,无需完整包以实现最大速度(适用于大型应用) |
| ——no-delta | boolean | 即使启用了实时更新,也禁用差异更新 |
| —加密校验和 | string | 用于上传外部包时的加密校验和(签名) |
| —自动设置包 | boolean | 设置包在 capacitor.config.json 中 |
| —干燥上传 | boolean | 干燥上传包过程:在数据库中添加行而不上传文件或更新频道(由 Capgo 内部测试使用) |
| —package.json | string | 多包项目的package.json文件路径(用逗号分隔) |
| —node_modules | string | 多包项目的node_modules目录路径(用逗号分隔) |
| —部分加密 | boolean | 加密delta更新文件(自6.14.4版本的更新器自动启用) |
| —删除上传时关联的包 | boolean | 在您尝试上传的频道中定位当前关联的包,并删除它 |
| —不压缩模式 | string | 要排除的文件(逗号分隔的模式,例如“.jpg,.png”) |
| —禁用压缩 | boolean | 即使更新器版本支持它,也完全禁用 brotli 压缩 |
| —版本存在时退出 | boolean | 如果包版本已经存在,退出成功,适用于 CI/CD 工作流程中的多包项目 |
| —自我分配 | boolean | 允许设备自动加入此频道(更新频道设置) |
| —二维码预览 | boolean | 上传此包预览后打印终端二维码 code |
| —发送更新通知 | boolean | 更新关联频道包后向设备发送本机更新检查通知 |
| —自定义 Supabase 主机 URL(用于自主托管或 __CAPGO_KEEP_0__ 开发) | string | Custom Supabase host URL (for self-hosting or Capgo development) |
| —详细日志 | string | 详细输出 |
| 兼容性 | boolean | 兼容性 |
🧪 🧪 兼容性
兼容性npx @capgo/cli@latest bundle compatibility🧪 在 Capgo 云中检查一个包与特定频道的兼容性,以确保更新是安全的。
示例:
npx @capgo/cli@latest bundle compatibility com.example.app --channel production选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -a | string | API 账户链接密钥 |
| -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 key to link to your account |
| -c | string | 与之比较的频道 |
| —package-json | string | 多包仓库的package.json文件路径(逗号分隔) |
| —node-modules | string | 多包仓库的node_modules目录路径(逗号分隔) |
| —supa-host | string | 自主托管或Capgo开发的自定义Supabase主机URL |
| —supa-anon | string | 自主托管的自定义Supabase匿名密钥 |
🗑️ 删除
标题: “ 🗑️ 删除”别名: d
npx @capgo/cli@latest bundle delete🗑️ 从 Capgo 云中删除特定包,选项性地指定单个版本。
示例:
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 密钥以链接到您的帐户 |
| —supa-host | string | 自定义 Supabase 主机 URL(用于自主托管或 Capgo 开发) |
| —supa-anon | string | 自定义 Supabase 匿名密钥(适用于自主托管) |
🧹 Cleanup
标题: “ 🧹 Cleanup”Alias: 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。使用 ‘捆绑包 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🗜️ 将您的应用程序包打包成 zip 文件。 返回用于加密的校验和。使用 —json 可以获得机器可读的输出。
示例:
npx @capgo/cli@latest bundle zip com.example.app --path ./dist选项:
| 参数 | 类型 | 描述 |
|---|---|---|
| -p | string | 上传文件夹的路径,如果未提供则使用 capacitor.config 中的 webDir |
| -b | string | 将 bundle 版本号命名为 zip 文件 |
| -n | string | zip 文件名称 |
| -j | boolean | 以 JSON 格式输出 |
| —no-code-check | boolean | 忽略检查源 code 和根目录中的 index 是否调用 notifyAppReady() |
| —key-v2 | boolean | 使用加密 v2 |
| —package-json | string | 多包项目的 package.json 文件路径(以逗号分隔) |