TiDBTiDB Docs Dash 2024

Jan 9 - Jan 12 (UTC)
Join us to improve docs and win a prize!
Sign InTry Free

TiDB Cloud CLI Reference

TiDB Cloud CLI is a command line interface, which allows you to operate TiDB Cloud from your terminal with a few lines of commands. In the TiDB Cloud CLI, you can easily manage your TiDB Cloud clusters, import data to your clusters, and perform more operations.

Before you begin

Make sure to first set up your TiDB Cloud CLI environment. Once you have installed the ticloud CLI, you can use it to manage your TiDB Cloud clusters from the command lines.

Commands available

The following table lists the commands available for the TiDB Cloud CLI.

To use the ticloud CLI in your terminal, run ticloud [command] [subcommand]. If you are using TiUP, use tiup cloud [command] [subcommand] instead.

CommandSubcommandDescription
clustercreate, delete, describe, list, connect-infoManage clusters
branchcreate, delete, describe, list, connect-infoManage branches
completionbash, fish, powershell, zshGenerate completion script for specified shell
configcreate, delete, describe, edit, list, set, useConfigure user profiles
connect-Connect to a TiDB cluster
helpcluster, completion, config, help, import, project, updateView help for any command
importcancel, describe, list, startManage import tasks
projectlistManage projects
update-Update the CLI to the latest version

Command modes

The TiDB Cloud CLI provides two modes for some commands for easy use:

  • Interactive mode

    You can run a command without flags (such as ticloud config create), and the CLI prompts you for input.

  • Non-interactive mode

    You must provide all arguments and flags that are required when running a command, such as ticloud config create --profile-name <profile-name> --public-key <public-key> --private-key <private-key>.

User profile

For the TiDB Cloud CLI, a user profile is a collection of properties associated with a user, including the profile name, public key, and private key. To use TiDB Cloud CLI, you must create a user profile first.

Create a user profile

Use ticloud config create to create a user profile.

List all user profiles

Use ticloud config list to list all user profiles.

An example output is as follows:

Profile Name default (active) dev staging

In this example output, the user profile default is currently active.

Describe a user profile

Use ticloud config describe to get the properties of a user profile.

An example output is as follows:

{ "private-key": "xxxxxxx-xxx-xxxxx-xxx-xxxxx", "public-key": "Uxxxxxxx" }

Set properties in a user profile

Use ticloud config set to set properties in a user profile.

Switch to another user profile

Use ticloud config use to switch to another user profile.

An example output is as follows:

Current profile has been changed to default

Edit the config file

Use ticloud config edit to open the configuration file for editing.

Delete a user profile

Use ticloud config delete to delete a user profile.

Global flags

The following table lists the global flags for the TiDB Cloud CLI.

FlagDescriptionRequiredNote
--no-colorDisables color in output.NoOnly works in non-interactive mode. In interactive mode, disabling color might not work with some UI components.
-P, --profile stringSpecifies the active user profile used in this command.NoWorks in both non-interactive and interactive modes.

Feedback

If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an issue. Also, we welcome any contributions.

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.