-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TiDB Cloud CLI New #17056
Merged
Merged
TiDB Cloud CLI New #17056
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
72b80dc
new cli
shiyuhang0 d628425
remobe br
shiyuhang0 51709cc
Apply suggestions from code review
qiancai 3b2b3f8
refine descriptions
qiancai 3ea5f47
update wording and format
qiancai 0a409b2
fix typo
qiancai e24ad6e
fix accoridng to the review
shiyuhang0 1eafa2c
refine the new changes
qiancai 0cfac7d
add import
shiyuhang0 3f25438
use force in export download
shiyuhang0 80e3104
update get started
shiyuhang0 fd514e3
polish
shiyuhang0 72d72b3
Apply suggestions from code review
qiancai 5609a97
Update get-started-with-cli.md
qiancai 939ae3f
polish according to the review
shiyuhang0 c1bfe25
add alias for serverless
shiyuhang0 64c5af7
fix dead link
shiyuhang0 55a492c
Apply suggestions from code review
qiancai 26a1ee9
Indicate CLI is in beta
qiancai dfc49ae
fix building errors
qiancai d04925d
regions -> region
qiancai 8e8f4dd
Update tidb-cloud/ticloud-serverless-export-download.md
qiancai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,7 +3,11 @@ title: TiDB Cloud CLI Reference | |||||
summary: Provides an overview of TiDB Cloud CLI. | ||||||
--- | ||||||
|
||||||
# TiDB Cloud CLI Reference | ||||||
# TiDB Cloud CLI Reference <span style="color: #fff; background-color: #00bfff; border-radius: 4px; font-size: 0.5em; vertical-align: middle; margin-left: 16px; padding: 0 2px;">Beta</span> | ||||||
|
||||||
> **Note:** | ||||||
> | ||||||
> TiDB Cloud CLI is in beta. | ||||||
|
||||||
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. | ||||||
|
||||||
|
@@ -17,17 +21,19 @@ 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](https://docs.pingcap.com/tidb/stable/tiup-overview), use `tiup cloud [command] [subcommand]` instead. | ||||||
|
||||||
| Command | Subcommand | Description | | ||||||
|------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------| | ||||||
| cluster | create, delete, describe, list, connect-info | Manage clusters | | ||||||
| branch | create, delete, describe, list, connect-info | Manage branches | | ||||||
| completion | bash, fish, powershell, zsh | Generate completion script for specified shell | | ||||||
| config | create, delete, describe, edit, list, set, use | Configure user profiles | | ||||||
| connect | - | Connect to a TiDB cluster | | ||||||
| help | cluster, completion, config, help, import, project, update | View help for any command | | ||||||
| import | cancel, describe, list, start | Manage [import](/tidb-cloud/tidb-cloud-migration-overview.md#import-data-from-files-to-tidb-cloud) tasks | | ||||||
| project | list | Manage projects | | ||||||
| update | - | Update the CLI to the latest version | | ||||||
| Command | Subcommand | Description | | ||||||
|-------------------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| | ||||||
| auth | login, logout | Login and logout | | ||||||
| serverless (alias: s) | create, delete, describe, list, update, spending-limit, regions, shell | Manage TiDB Serverless clusters | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
qiancai marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| serverless branch | create, delete, describe, list, shell | Manage TiDB Serverless branches | | ||||||
| serverless import | cancel, describe, list, start | Manage TiDB Serverless import tasks | | ||||||
| serverless export | create, describe, list, cancel, download | Manage TiDB Serverless export tasks | | ||||||
| ai | - | Chat with TiDB Bot | | ||||||
| completion | bash, fish, powershell, zsh | Generate completion script for specified shell | | ||||||
| config | create, delete, describe, edit, list, set, use | Configure user profiles | | ||||||
| project | list | Manage projects | | ||||||
| update | - | Update the CLI to the latest version | | ||||||
| help | cluster, completion, config, help, import, project, update | View help for any command | | ||||||
|
||||||
## Command modes | ||||||
|
||||||
|
@@ -43,12 +49,16 @@ The TiDB Cloud CLI provides two modes for some commands for easy use: | |||||
|
||||||
## 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. | ||||||
For the TiDB Cloud CLI, a user profile is a collection of properties associated with a user, including the profile name, public key, private key, and OAuth token. To use TiDB Cloud CLI, you must have a user profile. | ||||||
|
||||||
### Create a user profile | ||||||
### Create a user profile with TiDB Cloud API key | ||||||
|
||||||
Use [`ticloud config create`](/tidb-cloud/ticloud-config-create.md) to create a user profile. | ||||||
|
||||||
### Create a user profile with OAuth token | ||||||
|
||||||
Use [`ticloud auth login`](/tidb-cloud/ticloud-auth-login.md) to assign OAuth token to the current profile. If no profiles exist, a profile named `default` will be created automatically. | ||||||
|
||||||
### List all user profiles | ||||||
|
||||||
Use [`ticloud config list`](/tidb-cloud/ticloud-config-list.md) to list all user profiles. | ||||||
|
@@ -103,10 +113,11 @@ Use [`ticloud config delete`](/tidb-cloud/ticloud-config-delete.md) to delete a | |||||
|
||||||
The following table lists the global flags for the TiDB Cloud CLI. | ||||||
|
||||||
| Flag | Description | Required | Note | | ||||||
|----------------------|-----------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------| | ||||||
| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | | ||||||
| -P, --profile string | Specifies the active user profile used in this command. | No | Works in both non-interactive and interactive modes. | | ||||||
| Flag | Description | Required | Note | | ||||||
|----------------------|---------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| | ||||||
| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | | ||||||
shiyuhang0 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| -P, --profile string | Specifies the active user profile used in this command. | No | Works in both non-interactive and interactive modes. | | ||||||
| -D, --debug | Enable debug mode | No | Works in both non-interactive and interactive modes. | | ||||||
|
||||||
## Feedback | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: ticloud ai | ||
summary: The reference of `ticloud ai`. | ||
--- | ||
|
||
# ticloud ai | ||
|
||
Chat with TiDB Bot: | ||
|
||
```shell | ||
ticloud ai [flags] | ||
``` | ||
|
||
## Examples | ||
|
||
Chat with TiDB Bot in interactive mode: | ||
|
||
```shell | ||
ticloud serverless delete | ||
``` | ||
|
||
Chat with TiDB Bot in non-interactive mode: | ||
|
||
```shell | ||
ticloud ai -q "How to create a cluster?" | ||
``` | ||
|
||
## Flags | ||
|
||
In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. | ||
|
||
| Flag | Description | Required | Note | | ||
|--------------------|-----------------------------------|----------|------------------------------------------------------| | ||
| -q, --query string | Specifies your query to TiDB Bot. | Yes | Only works in non-interactive mode. | | ||
| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | | ||
|
||
## Inherited flags | ||
|
||
| Flag | Description | Required | Note | | ||
|----------------------|--------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| | ||
| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | | ||
| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | | ||
| -D, --debug | Enables debug mode. | No | Works 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](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preview: https://pingcap-docsite-preview-git-pr-qiancais-projects.vercel.app/tidbcloud/cli-reference