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-1或aws-ap-southeast-1。--tidb-cloud-private-key <string>:TiDB Cloud API 私钥。--tidb-cloud-public-key <string>:TiDB Cloud API 公钥。--version:显示版本信息。
有关所有命令共享的选项,请参见全局选项。
配置值来源
以下命令选项和环境变量提供相同的配置值:
对于每个值,显式提供的命令选项优先于其对应的环境变量。使用 --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