ti update
检查或安装 TiDB Cloud CLI 的版本更新。此命令不会读取或修改 ~/.ti/ 下的设置、配置(Profile)、凭证、操作日志或其他状态数据。
语法
ti update
[--check]
[--dry-run]
[--fail-if-update-available]
[--help]
[--target-version <string>]
[--version]
选项
--check:检查是否有较新的ti版本可用,但不执行更新。--dry-run:显示更新计划,但不修改本地二进制文件。--fail-if-update-available:与--check一起使用时,如果有可用更新,则以退出码 1 退出。--help:显示帮助信息。--target-version <string>:目标ti版本,例如latest或vX.Y.Z。[default: latest]--version:显示版本信息。
有关所有命令共享的选项,请参见全局选项。
示例
检查是否有可用更新:
# Compare the installed version with the latest GitHub release without changing files. ti update --check当有可用更新时使 CI 作业失败:
# Exit with code 1 when a newer release is available, without changing files. ti update --check --fail-if-update-available预览更新:
# Show the files and versions that an update would change. ti update --dry-run安装指定版本:
# Replace an eligible installation with the requested release version. ti update --target-version <version>