hot-updater
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHot Updater CLI
Hot Updater CLI
Use this skill when a task involves Hot Updater's CLI, ,
React Native OTA deployment, patch artifacts, bundle operations, rollback,
release-channel management, code signing keys, database migration, fingerprints,
or diagnostics.
hot-updater.config.ts当任务涉及Hot Updater的CLI、、React Native OTA部署、补丁制品、包操作、回滚、发布渠道管理、代码签名密钥、数据库迁移、指纹或诊断时,可使用此技能。
hot-updater.config.tsOperating Rules
操作规则
- Start from the project root unless the user specifies another app directory.
- Read local before assuming provider behavior.
hot-updater.config.ts - Use for CLI examples and user-facing instructions.
npx hot-updater ... - Do not run on behalf of the user. It is interactive and asks for provider, build, and project-specific choices. Guide the user to run it directly and follow the setup documentation.
npx hot-updater init - Before running for a server/infrastructure check, make sure the server base URL is available. If the user did not provide it and it is not obvious from local config, ask for the update server URL first.
npx hot-updater doctor - For doctor repair loops, run first. Fix issues marked
npx hot-updater doctor --jsonby editing local project files, run the listedfixability: "auto"for issues markedcommands, and rerun doctor after each focused change. Stop when doctor passes or the remaining issues are markedfixability: "command".fixability: "blocked" - Treat as outside the autonomous local loop. Server infrastructure remediation commonly needs provider credentials, environment variables, and redeploy access; summarize the blocker instead of running migrations or mutating provider setup.
fixability: "blocked" - Treat ,
deploy,patch,bundle enable,bundle disable,bundle update,bundle delete,bundle promote,rollback,channel set,keys export-public, andkeys removeas state-changing operations.db migrate - Treat and
keys generateas local file/artifact writing operations.db generate - Use only with commands documented here as supporting it. For mutating commands,
--jsononly changes the output format after the requested mutation has already been authorized. If a target project uses an older CLI without that option, fall back to the human-readable output.--json - For non-interactive shells, use only when the user already requested the exact mutation and the target is unambiguous.
-y - After mutating bundle state, verify with or the relevant provider state.
bundle list - If fails, stop the deploy workflow. Do not keep retrying fixes, edit setup, change credentials, install dependencies, or run migrations unless the user explicitly asks for that follow-up. Analyze only the failed command, relevant output, likely cause, and suggested next checks.
deploy - Do not edit provider credentials unless the user explicitly asks. Credentials
are commonly stored in , but projects may use a different environment-loading setup.
.env.hotupdater
- 除非用户指定其他应用目录,否则从项目根目录开始操作。
- 在假设供应商行为之前,先读取本地的配置文件。
hot-updater.config.ts - CLI示例和面向用户的说明使用格式。
npx hot-updater ... - 不要代用户运行命令。该命令为交互式,会询问供应商、构建和项目相关的选项。引导用户直接运行该命令并遵循设置文档操作。
npx hot-updater init - 在运行进行服务器/基础设施检查之前,确保服务器基础URL可用。如果用户未提供该URL,且无法从本地配置中明确获取,先询问更新服务器URL。
npx hot-updater doctor - 对于doctor修复循环,先运行。通过编辑本地项目文件修复标记为
npx hot-updater doctor --json的问题,运行标记为fixability: "auto"的问题对应的fixability: "command"命令,每次针对性修改后重新运行doctor命令。当doctor检查通过或剩余问题标记为commands时停止操作。fixability: "blocked" - 将视为本地自主操作范围外的问题。服务器基础设施修复通常需要供应商凭证、环境变量和重新部署权限;此时应总结阻塞问题,而非运行迁移或修改供应商设置。
fixability: "blocked" - 将、
deploy、patch、bundle enable、bundle disable、bundle update、bundle delete、bundle promote、rollback、channel set、keys export-public和keys remove视为状态变更操作。db migrate - 将和
keys generate视为本地文件/制品写入操作。db generate - 仅在本文档说明支持参数的命令中使用该参数。对于变更类命令,
--json仅会在已授权请求的变更操作完成后修改输出格式。如果目标项目使用的旧版CLI不支持该选项,则回退为人类可读格式输出。--json - 对于非交互式shell,仅当用户已明确请求确切的变更操作且目标明确时,才使用参数。
-y - 修改包状态后,使用或相关供应商状态进行验证。
bundle list - 如果命令失败,停止部署工作流。除非用户明确要求后续操作,否则不要继续尝试修复、修改设置、更改凭证、安装依赖或运行迁移。仅分析失败的命令、相关输出、可能的原因以及建议的下一步检查。
deploy - 除非用户明确要求,否则不要编辑供应商凭证。凭证通常存储在中,但项目可能使用不同的环境加载设置。
.env.hotupdater
Natural Language Requests
自然语言请求
Users may invoke this skill with prompts such as:
txt
$hot-updater deploy using the current app version
$hot-updater deploy the current iOS app version to production
$hot-updater roll back the most recently deployed bundle
$hot-updater list iOS bundles on the production channel
$hot-updater update rollout cohort count for bundle <bundle-id> to 500
$hot-updater promote bundle <bundle-id> to staging
$hot-updater create a patch from bundle <old-id> to <new-id>
$hot-updater export the code signing public key
$hot-updater run doctor with server URL https://updates.example.com/api/check-update
$hot-updater fix local doctor issues that do not require server credentialsTranslate the request into the safest CLI flow. If a state-changing request is
missing a required channel, platform, bundle target, patch base, destination
channel, or server URL that cannot be inferred from local context, ask one
concise question before mutating anything. For deploy and patch channel, use the
CLI default unless the user names another channel or local context
clearly indicates one.
production用户可能通过以下提示调用此技能:
txt
$hot-updater deploy using the current app version
$hot-updater deploy the current iOS app version to production
$hot-updater roll back the most recently deployed bundle
$hot-updater list iOS bundles on the production channel
$hot-updater update rollout cohort count for bundle <bundle-id> to 500
$hot-updater promote bundle <bundle-id> to staging
$hot-updater create a patch from bundle <old-id> to <new-id>
$hot-updater export the code signing public key
$hot-updater run doctor with server URL https://updates.example.com/api/check-update
$hot-updater fix local doctor issues that do not require server credentials将请求转换为最安全的CLI流程。如果状态变更请求缺少必要的渠道、平台、包目标、补丁基础包、目标渠道或无法从本地上下文推断的服务器URL,在进行任何变更前先提出一个简洁的问题。对于部署和补丁渠道,除非用户指定其他渠道或本地上下文明确指示,否则使用CLI默认的渠道。
productionCurrent App Version Deploy
当前应用版本部署
When the user asks to deploy for the current app version:
- Run when supported; otherwise run
npx hot-updater app-version --json.npx hot-updater app-version - Extract and/or
iosfrom JSON when available, or from the human-readable output as a fallback.android - If the platform is missing, ask whether to deploy iOS, Android, or both.
- Deploy with :
-t <version>
sh
npx hot-updater deploy -p ios -t <ios-app-version>
npx hot-updater deploy -p android -t <android-app-version>If deploying both platforms, run one platform at a time and verify each result
with when
supported, or without as a fallback.
npx hot-updater bundle list -p <platform> --limit 5 --json--jsonIf a deploy command fails, do not continue to the next platform or attempt an
automatic repair. Report the failure analysis and wait for a new user request.
当用户要求部署当前应用版本时:
- 如果支持,运行;否则运行
npx hot-updater app-version --json。npx hot-updater app-version - 如果有JSON输出,从中提取和/或
ios版本;否则从人类可读输出中提取作为备选。android - 如果平台信息缺失,询问用户是部署iOS、Android还是两者都部署。
- 使用参数进行部署:
-t <version>
sh
npx hot-updater deploy -p ios -t <ios-app-version>
npx hot-updater deploy -p android -t <android-app-version>如果同时部署两个平台,一次运行一个平台的部署命令,并在支持时使用验证每个结果;否则不使用参数进行验证。
npx hot-updater bundle list -p <platform> --limit 5 --json--json如果某个部署命令失败,不要继续部署下一个平台或尝试自动修复。报告失败分析并等待用户的新请求。
Recent Bundle Rollback
最近包回滚
When the user asks to roll back the most recent deployment without naming a
bundle:
- Run .
npx hot-updater bundle list --json --limit 10 - Choose the most recent enabled bundle from the JSON result.
- Use that bundle's ,
channel, andplatformfor a scoped rollback:id
sh
npx hot-updater rollback <channel> -p <platform> --target <bundle-id> -yIf the most recent bundle is already disabled, tell the user and ask whether to
roll back the next enabled bundle. After rollback, verify with:
sh
npx hot-updater bundle list -c <channel> -p <platform> --limit 5 --jsonIf is unavailable, rerun the same command without .
--json--json当用户要求回滚最近部署的包但未指定包ID时:
- 运行。
npx hot-updater bundle list --json --limit 10 - 从JSON结果中选择最近启用的包。
- 使用该包的、
channel和platform进行范围回滚:id
sh
npx hot-updater rollback <channel> -p <platform> --target <bundle-id> -y如果最近的包已被禁用,告知用户并询问是否回滚下一个启用的包。回滚后,使用以下命令验证:
sh
npx hot-updater bundle list -c <channel> -p <platform> --limit 5 --json如果不支持参数,则不带该参数重新运行相同命令。
--jsonCore Commands
核心命令
Setup and Diagnostics
设置与诊断
sh
npx hot-updater init
npx hot-updater doctor --server-base-url <update-server-url>
npx hot-updater doctor --json
npx hot-updater doctor --server-base-url <update-server-url> --json
npx hot-updater fingerprint
npx hot-updater fingerprint create
npx hot-updater app-version
npx hot-updater app-version --json
npx hot-updater console- creates or updates project configuration. Because it is interactive, tell the user to run it directly instead of choosing answers for them.
init - checks local setup and server health. Provide
doctor; the command appends--server-base-urlfor the server check. If the user has not provided one, ask for it before running the command./version - is the preferred agent surface. It returns stable issue codes, related paths,
doctor --json, and command hints for local iterative repair. Do not parse the human-readable doctor output when JSON is available.fixability - and
fingerprintgenerate the app fingerprint.fingerprint create - reads native iOS and Android app versions.
app-versionreturns--jsonon CLIs that support it.{ "android": string | null, "ios": string | null } - opens the local management console.
console
sh
npx hot-updater init
npx hot-updater doctor --server-base-url <update-server-url>
npx hot-updater doctor --json
npx hot-updater doctor --server-base-url <update-server-url> --json
npx hot-updater fingerprint
npx hot-updater fingerprint create
npx hot-updater app-version
npx hot-updater app-version --json
npx hot-updater console- 用于创建或更新项目配置。由于该命令是交互式的,告知用户直接运行该命令,而非代其选择答案。
init - 检查本地设置和服务器健康状况。需提供
doctor参数;该命令会在该URL后追加--server-base-url以进行服务器检查。如果用户未提供该URL,在运行命令前先询问。/version - 是首选的代理交互方式。它返回稳定的问题代码、相关路径、
doctor --json属性以及本地迭代修复的命令提示。当JSON可用时,不要解析人类可读的doctor输出。fixability - 和
fingerprint用于生成应用指纹。fingerprint create - 读取原生iOS和Android应用版本。支持该参数的CLI中,
app-version会返回--json格式的结果。{ "android": string | null, "ios": string | null } - 打开本地管理控制台。
console
Deploy
部署
sh
npx hot-updater deploy -p <ios|android>
npx hot-updater deploy -p ios -c production -r 25
npx hot-updater deploy -p android -f
npx hot-updater deploy -p ios -d
npx hot-updater deploy -p ios -o ./hot-updater-outputImportant options:
| Option | Meaning |
|---|---|
| Target |
| Release channel, default |
| App version range such as |
| Initial rollout percentage from |
| Apply immediately on client update. |
| Upload disabled for later enablement. |
| Directory where bundle archives are generated. |
| Custom deployment message. |
| Guided deployment flow. |
sh
npx hot-updater deploy -p <ios|android>
npx hot-updater deploy -p ios -c production -r 25
npx hot-updater deploy -p android -f
npx hot-updater deploy -p ios -d
npx hot-updater deploy -p ios -o ./hot-updater-output重要选项说明:
| 选项 | 含义 |
|---|---|
| 目标平台: |
| 发布渠道,默认值为 |
| 应用版本范围,例如 |
| 初始发布百分比,范围为 |
| 在客户端更新时立即应用。 |
| 上传后处于禁用状态,可后续启用。 |
| 生成包归档文件的目录。 |
| 自定义部署消息。 |
| 引导式部署流程。 |
Patch Artifacts
补丁制品
sh
npx hot-updater patch -b <bundle-id> --base-bundle-id <base-bundle-id> -p ios
npx hot-updater patch -b <bundle-id> --base-bundle-id <base-bundle-id> -p android -c production
npx hot-updater patch -iImportant options:
| Option | Meaning |
|---|---|
| Target bundle id that should receive the patch artifact. |
| Older bundle id to use as the patch base. |
| Target |
| Channel used to load config, default |
| Guided patch flow. |
sh
npx hot-updater patch -b <bundle-id> --base-bundle-id <base-bundle-id> -p ios
npx hot-updater patch -b <bundle-id> --base-bundle-id <base-bundle-id> -p android -c production
npx hot-updater patch -i重要选项说明:
| 选项 | 含义 |
|---|---|
| 应接收补丁制品的目标包ID。 |
| 用作补丁基础的旧包ID。 |
| 目标平台: |
| 用于加载配置的渠道,默认值为 |
| 引导式补丁流程。 |
Bundle Inventory and State
包清单与状态
sh
npx hot-updater bundle list
npx hot-updater bundle list -c production -p ios --limit 10
npx hot-updater bundle list -c production -p ios --limit 10 --json
npx hot-updater bundle list --json
npx hot-updater bundle show <bundle-id>
npx hot-updater bundle show <bundle-id> --json
npx hot-updater bundle disable <bundle-id>
npx hot-updater bundle enable <bundle-id>
npx hot-updater bundle update <bundle-id> --rollout-cohort-count 500
npx hot-updater bundle update <bundle-id> --force-update true --json
npx hot-updater bundle update <bundle-id> --target-cohorts 1,2,3
npx hot-updater bundle update <bundle-id> --clear-target-cohorts
npx hot-updater bundle delete <bundle-id>
npx hot-updater bundle promote <bundle-id> -t staging
npx hot-updater bundle promote <bundle-id> -t staging -a move- shows the most recent bundles first.
bundle list - defaults to
bundle list --limit <n>.20 - is available for
--json,bundle list, andbundle showon CLIs that support it.bundle update - and
bundle disableread the bundle, mutate enabled state, commit the change, then re-read to verify.bundle enable - can set rollout cohort count from
bundle updateto0, force update metadata, and target cohorts.1000 - removes the bundle record by id.
bundle delete - copies to a target channel by default. Use
bundle promoteonly when the user explicitly wants to keep the same bundle id and move channels.-a move - In CI or other non-interactive shells, pass to
-yorenable. Also passdisableto-y,update, ordeleteonly when the requested mutation target is unambiguous.promote
sh
npx hot-updater bundle list
npx hot-updater bundle list -c production -p ios --limit 10
npx hot-updater bundle list -c production -p ios --limit 10 --json
npx hot-updater bundle list --json
npx hot-updater bundle show <bundle-id>
npx hot-updater bundle show <bundle-id> --json
npx hot-updater bundle disable <bundle-id>
npx hot-updater bundle enable <bundle-id>
npx hot-updater bundle update <bundle-id> --rollout-cohort-count 500
npx hot-updater bundle update <bundle-id> --force-update true --json
npx hot-updater bundle update <bundle-id> --target-cohorts 1,2,3
npx hot-updater bundle update <bundle-id> --clear-target-cohorts
npx hot-updater bundle delete <bundle-id>
npx hot-updater bundle promote <bundle-id> -t staging
npx hot-updater bundle promote <bundle-id> -t staging -a move- 按时间倒序显示最近的包。
bundle list - 默认值为
bundle list --limit <n>。20 - 支持该参数的CLI中,可用于
--json、bundle list和bundle show命令。bundle update - 和
bundle disable命令会读取包信息、修改启用状态、提交变更,然后重新读取以验证。bundle enable - 可设置发布群组数量(范围
bundle update到0)、强制更新元数据以及指定目标群组。1000 - 按ID删除包记录。
bundle delete - 默认将包复制到目标渠道。仅当用户明确希望保留相同包ID并切换渠道时,才使用
bundle promote参数。-a move - 在CI或其他非交互式shell中,对或
enable命令使用disable参数。仅当请求的变更目标明确时,才对-y、update或delete命令使用promote参数。-y
Rollback
回滚
sh
npx hot-updater rollback <channel>
npx hot-updater rollback production -p ios
npx hot-updater rollback production -p ios --target <bundle-id> -y- Rollback disables the latest enabled bundle on the channel.
- Without , rollback applies to both iOS and Android.
-p - The next most recent enabled bundle on the same channel and platform becomes the fallback.
- If no previous enabled bundle exists, the app falls back to the JavaScript bundle shipped in the native binary.
- Use to retry a partial rollback for exactly one bundle.
--target <bundle-id>
sh
npx hot-updater rollback <channel>
npx hot-updater rollback production -p ios
npx hot-updater rollback production -p ios --target <bundle-id> -y- 回滚操作会禁用渠道上最新启用的包。
- 如果不指定参数,回滚会同时应用于iOS和Android平台。
-p - 同一渠道和平台上最近的下一个启用包会成为回退版本。
- 如果没有之前启用的包,应用会回退到原生二进制文件中附带的JavaScript包。
- 使用参数可针对特定包重试部分回滚操作。
--target <bundle-id>
Channels
渠道
sh
npx hot-updater channel set <channel>This writes the default channel into native iOS and Android project files.
Changing this embedded channel requires a native rebuild.
sh
npx hot-updater channel set <channel>该命令会将默认渠道写入原生iOS和Android项目文件。修改此嵌入渠道需要重新构建原生应用。
Code Signing Keys
代码签名密钥
sh
npx hot-updater keys generate
npx hot-updater keys generate -o ./keys -k 4096
npx hot-updater keys export-public
npx hot-updater keys export-public -i ./keys/private.pem --print-only
npx hot-updater keys remove- writes an RSA key pair. The default output directory is
keys generate, and supported key sizes are./keysand2048with default4096.4096 - reads the private key from
keys export-publicor from-iinsigning.privateKeyPath, then writes native public key configuration unlesshot-updater.config.tsis used.--print-only - removes public keys from native configuration files.
keys remove - Use for native file writes only when the user explicitly requested the exact operation.
-y
sh
npx hot-updater keys generate
npx hot-updater keys generate -o ./keys -k 4096
npx hot-updater keys export-public
npx hot-updater keys export-public -i ./keys/private.pem --print-only
npx hot-updater keys remove- 生成RSA密钥对。默认输出目录为
keys generate,支持的密钥长度为./keys和2048,默认值为4096。4096 - 从
keys export-public参数指定的路径或-i中的hot-updater.config.ts读取私钥,然后写入原生公钥配置,除非使用signing.privateKeyPath参数。--print-only - 从原生配置文件中移除公钥。
keys remove - 仅当用户明确请求确切操作时,才对原生文件写入操作使用参数。
-y
Database
数据库
sh
npx hot-updater db generate [configPath] [outputDir]
npx hot-updater db generate --sql
npx hot-updater db generate --sql postgresql
npx hot-updater db migrate [configPath]- creates migration output without applying it. The default output directory is
db generate.hot-updater_migrations - creates a standalone SQL file without reading config. Supported providers are
db generate --sql [provider],postgresql, andmysql; omitting the provider starts interactive selection.sqlite - applies the latest migration through the configured database plugin.
db migrate - Pass only when the user explicitly requested the write or migration.
-y
sh
npx hot-updater db generate [configPath] [outputDir]
npx hot-updater db generate --sql
npx hot-updater db generate --sql postgresql
npx hot-updater db migrate [configPath]- 生成迁移输出但不应用。默认输出目录为
db generate。hot-updater_migrations - 生成独立的SQL文件,无需读取配置。支持的供应商为
db generate --sql [provider]、postgresql和mysql;如果省略供应商参数,会启动交互式选择。sqlite - 通过配置的数据库插件应用最新的迁移。
db migrate - 仅当用户明确请求写入或迁移操作时,才使用参数。
-y