📣
TiDB Cloud Premium 开放公测中。为企业级工作负载提供无限扩展、即时弹性伸缩和高级安全保障。此页面由 AI 自动翻译,英文原文请见此处。

ti configure



配置本地 TiDB Cloud CLI 配置(Profile)。在不带任何参数时,这是 TiDB Cloud CLI 中唯一的交互式命令。

语法

ti configure [--help] [--non-interactive] [--region-code <string>] [--tidb-cloud-private-key <string>] [--tidb-cloud-public-key <string>] [--version]

选项

  • --help:显示帮助信息。
  • --non-interactive:避免交互提示。通过对应的命令选项或环境变量提供 region code、公钥和私钥。这在脚本或自动化环境中运行 ti 时非常有用。
  • --region-code <string>:默认 region code,例如 aws-us-east-1aws-ap-southeast-1
  • --tidb-cloud-private-key <string>:TiDB Cloud API 私钥。
  • --tidb-cloud-public-key <string>:TiDB Cloud API 公钥。
  • --version:显示版本信息。

有关所有命令共享的选项,请参见全局选项

配置值来源

以下命令选项和环境变量提供相同的配置值:

配置值命令选项环境变量
默认 region code--region-codeTI_REGION_CODE
TiDB Cloud API 公钥--tidb-cloud-public-keyTIDB_CLOUD_PUBLIC_KEY
TiDB Cloud API 私钥--tidb-cloud-private-keyTIDB_CLOUD_PRIVATE_KEY

对于每个值,显式提供的命令选项优先于其对应的环境变量。使用 --non-interactive 时,这三个值都必须能从这些来源中解析得到。

示例

  • 以交互方式配置 ti

    # Enter the default region code and TiDB Cloud API keys when prompted. ti configure
  • 为自动化场景配置 ti

    # Supply all required values without interactive prompts. TI_REGION_CODE="aws-us-east-1" \ TIDB_CLOUD_PUBLIC_KEY="<public-key>" \ TIDB_CLOUD_PRIVATE_KEY="<private-key>" \ ti configure --profile ci --non-interactive

文档内容是否有帮助?