Skip to content

refine ti-cli quick start - #23935

Open
guangleibao wants to merge 1 commit into
release-8.5from
cloud/fs-doc-updates-20260922
Open

guangleibao wants to merge 1 commit into
release-8.5from
cloud/fs-doc-updates-20260922

Conversation

@guangleibao

@guangleibao guangleibao commented Sep 22, 2026

Copy link
Copy Markdown

First-time contributors' checklist

What is changed, added, or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

  • Related code change PR links (if applicable):
  • This PR is translated from:
  • Other reference link(s):

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • Documentation
    • Updated the TiDB Cloud CLI quick-start guide with a new default region example and revised verification command.
    • Updated the Filesystem workflow to create, mount, use, and unmount a file system with an access token.
    • Updated the Starter workflow to generate a database connection string instead of deleting the instance.
    • Refreshed example command output to match the updated workflows.

@guangleibao
guangleibao requested a review from qiancai September 22, 2026 16:00
@ti-chi-bot ti-chi-bot Bot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Sep 22, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign oreoxmt for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

The quick-start guide updates CLI descriptions and setup examples. It replaces the Filesystem workflow with mounting commands and changes the Starter workflow to generate a read-write connection string.

Changes

TiDB Cloud CLI quick-start workflows

Layer / File(s) Summary
CLI introduction and setup examples
ai/ti/ti-quick-start.md
The guide updates its introduction, default region, verification command, example output, and workflow links.
Filesystem workflow
ai/ti/ti-quick-start.md
Option A creates a filesystem token, mounts the filesystem, writes and lists a file, and unmounts the filesystem.
Starter workflow
ai/ti/ti-quick-start.md
Option B now formats a read-write database connection string instead of deleting the Starter instance.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: 🟡 Moderate · up to 706cf

The revised quick start contains commands that will fail for users and can expose database credentials. Correct these workflows before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only the repository template. It does not explain the changes, select affected TiDB versions, or provide related links and applicability details. Add a summary of the documentation changes and their purpose. Select the applicable TiDB version checkbox, at minimum master or the intended release branch. Complete the related links and other applicable checklist items, or state that they…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately identifies the main change: refining the TiDB CLI quick-start guide. It is concise and sufficiently specific.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

Add a summary of the documentation changes and their purpose. Select the applicable TiDB version checkbox, at minimum master or the intended release branch. Complete the related links and other applicable checklist items, or state that they do not apply.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: pingcap/docs/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 278fc322-278b-4662-9d51-c26d116dcf22

📥 Commits

Reviewing files that changed from the base of the PR and between ff43a4e and 706cfeb.

📒 Files selected for processing (1)
  • ai/ti/ti-quick-start.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread ai/ti/ti-quick-start.md
Comment on lines +111 to +112
- [Option A: TiDB Cloud Filesystem](/ai/ti/ti-quick-start.md#option-a-create-and-use-a-filesystem)
- [Option B: TiDB Cloud Starter](/ai/ti/ti-quick-start.md#option-b-create-a-tidb-cloud-starter-instance-and-query-the-database)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the workflow anchors after renaming the headings.

Both links still use the old heading slugs. After the heading changes at Line 114 and Line 140, both links target missing anchors.

Committable replacement
-- [Option A: TiDB Cloud Filesystem](/ai/ti/ti-quick-start.md#option-a-create-and-use-a-filesystem)
-- [Option B: TiDB Cloud Starter](/ai/ti/ti-quick-start.md#option-b-create-a-tidb-cloud-starter-instance-and-query-the-database)
+- [Option A: TiDB Cloud Filesystem](/ai/ti/ti-quick-start.md#option-a-tidb-cloud-filesystem)
+- [Option B: TiDB Cloud Starter](/ai/ti/ti-quick-start.md#option-b-tidb-cloud-starter)

As per path instructions, preserve valid Markdown links when headings change.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [Option A: TiDB Cloud Filesystem](/ai/ti/ti-quick-start.md#option-a-create-and-use-a-filesystem)
- [Option B: TiDB Cloud Starter](/ai/ti/ti-quick-start.md#option-b-create-a-tidb-cloud-starter-instance-and-query-the-database)
- [Option A: TiDB Cloud Filesystem](/ai/ti/ti-quick-start.md#option-a-tidb-cloud-filesystem)
- [Option B: TiDB Cloud Starter](/ai/ti/ti-quick-start.md#option-b-tidb-cloud-starter)

Source: Path instructions

Comment thread ai/ti/ti-quick-start.md
A TiDB Cloud Filesystem is a persistent, shareable cloud file system that you can use across local machines, CI jobs, sandboxes, and other ephemeral environments.

1. Create a Filesystem, wait until it is ready, and save its server-assigned ID:
1. Create a file system and obtain the access token (typically performed outside the sandbox):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the documented term owner token.

The CLI returns a one-time owner token, not a generic access token. Use the established term because the token has owner-level semantics and is not returned again. (docs.pingcap.com)

Committable replacement
-1. Create a file system and obtain the access token (typically performed outside the sandbox):
+1. Create a file system and obtain the owner token (typically performed outside the sandbox):

As per path instructions: “Do not introduce new terminology when an established term exists.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Create a file system and obtain the access token (typically performed outside the sandbox):
1. Create a file system and obtain the owner token (typically performed outside the sandbox):

Sources: Path instructions, MCP tools

Comment thread ai/ti/ti-quick-start.md
--wait \
--query file_system_id \
--output text)"
export TI_FS_TOKEN="$(ti fs create-file-system --file-system-name agent-workspace --wait --query fs_token --output text --region aws-us-west-2)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Replace the unsupported --file-system-name options.

create-file-system supports --display-name, not --file-system-name. mount-file-system supports --file-system-id and --fs-token, not --file-system-name. These commands will fail with the current options. (docs.pingcap.com)

Use --display-name agent-workspace for creation and --fs-token "$TI_FS_TOKEN" or an explicit filesystem ID for mounting.

Also applies to: 129-129

Source: MCP tools


🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor the configured default region.

Step 2 lets the user select a default region, but all three Filesystem commands hard-code aws-us-west-2. An explicit --region overrides the profile region, so selecting another region has no effect in this workflow. (docs.pingcap.com)

Remove the explicit flags so the configured region is used, or define one region variable and use it consistently.

Also applies to: 129-129, 137-137

Source: MCP tools

Comment thread ai/ti/ti-quick-start.md
`ti` stores the Filesystem credential locally, so you do not need to provide it for subsequent file operations.

2. Write a file to the Filesystem, and then read the file:
2. Mount the filesystem to a local path and use it as a normal POSIX-compliant filesystem (typically performed within the sandbox):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restrict the mount workflow to supported platforms.

The installation section supports Windows, but Filesystem mounts are not supported on Windows. A Windows reader who selects Option A reaches a failing command. State that this workflow requires macOS or Linux, or provide a non-mount alternative for Windows. (docs.pingcap.com)

Committable replacement
-2. Mount the filesystem to a local path and use it as a normal POSIX-compliant filesystem (typically performed within the sandbox):
+2. On macOS or Linux, mount the Filesystem to a local path and use it as a normal POSIX-compliant filesystem (typically performed within the sandbox):
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
2. Mount the filesystem to a local path and use it as a normal POSIX-compliant filesystem (typically performed within the sandbox):
2. On macOS or Linux, mount the Filesystem to a local path and use it as a normal POSIX-compliant filesystem (typically performed within the sandbox):

Source: MCP tools

Comment thread ai/ti/ti-quick-start.md

```text
hello from ti
export TI_FS_TOKEN=$TI_FS_TOKEN

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- ai/ti/ti-quick-start.md:100-145 ---'
sed -n '100,145p' ai/ti/ti-quick-start.md
printf '%s\n' '--- TI_FS_TOKEN references ---'
rg -n -C 3 'TI_FS_TOKEN|fs_token|sandbox|sandboxed' ai/ti/ti-quick-start.md

Repository: pingcap/docs

Length of output: 3176


Make the token handoff explicit across the sandbox boundary.

Step 1 creates TI_FS_TOKEN outside the sandbox, while Step 2 runs inside it. export TI_FS_TOKEN=$TI_FS_TOKEN only exports a value already present in the current shell; it does not transfer the token into a separate sandbox. Document the sandbox’s secret or environment-variable injection mechanism, or keep creation and mounting in the same environment.

Source: MCP tools

Comment thread ai/ti/ti-quick-start.md
```

3. Delete the Filesystem:
3. Unmount the file system to release the workspace before passing it to another sandbox (typicall performed within the sandbox):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the typo in the unmount step.

Committable replacement
-3. Unmount the file system to release the workspace before passing it to another sandbox (typicall performed within the sandbox):
+3. Unmount the file system to release the workspace before passing it to another sandbox (typically performed within the sandbox):
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
3. Unmount the file system to release the workspace before passing it to another sandbox (typicall performed within the sandbox):
3. Unmount the file system to release the workspace before passing it to another sandbox (typically performed within the sandbox):

Comment thread ai/ti/ti-quick-start.md
unset TI_DB_CLUSTER_ID
--read-write --query connection_string \
--output text)
echo $DATABASE_URL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟠 Major | ⚡ Quick win

Sensitive Data Exposure

Reachability: Internal
Exploitability: Moderate
CWE: CWE-532 — Insertion of Sensitive Information into Log File

Do not print the read-write connection string.

--read-write returns stored SQL credentials. echo $DATABASE_URL writes the full credential-bearing URI to the terminal, where CI or agent logs can retain it. Connection strings contain credentials; the documented secure workflow writes protected environment output instead of displaying it. (docs.pingcap.com)

Remove the echo and use a masked secret handoff or a protected file.

Comment thread ai/ti/ti-quick-start.md
# Get Started with TiDB Cloud CLI

[TiDB Cloud CLI (`ti`)](https://github.com/tidbcloud/ti-cli) is a command-line tool for managing [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier/?plan=starter#starter) instances and [TiDB Cloud Filesystems](/ai/ti/ti-overview.md#tidb-cloud-filesystem). It supports both interactive use and automation, with JSON as the default output format for commands.
[TiDB Cloud CLI (`ti`)](https://github.com/tidbcloud/ti-cli) is a command-line tool for managing [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier/?plan=starter#starter) instances and [TiDB Cloud Filesystem](/ai/ti/ti-overview.md#tidb-cloud-filesystem) file systems. TiDB Cloud CLI supports both interactive and automated use. By default, command output is in JSON format, making it agent friendly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[TiDB Cloud CLI (`ti`)](https://github.com/tidbcloud/ti-cli) is a command-line tool for managing [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier/?plan=starter#starter) instances and [TiDB Cloud Filesystem](/ai/ti/ti-overview.md#tidb-cloud-filesystem) file systems. TiDB Cloud CLI supports both interactive and automated use. By default, command output is in JSON format, making it agent friendly.
[TiDB Cloud CLI (`ti`)](https://github.com/tidbcloud/ti-cli) is a command-line tool for managing [TiDB Cloud Starter](https://docs.pingcap.com/tidbcloud/select-cluster-tier/?plan=starter#starter) instances and [file systems in TiDB Cloud Filesystem](/ai/ti/ti-overview.md#tidb-cloud-filesystem). TiDB Cloud CLI supports both interactive and automated use. By default, command output is in JSON format, making it agent friendly.

Comment thread ai/ti/ti-quick-start.md
## Step 3. Choose a workflow

Complete either of the following workflows.
Please proceed with either of the following workflows based on your needs. Would you like to use TiDB Cloud Filesystem or Starter?

@qiancai qiancai Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please proceed with either of the following workflows based on your needs. Would you like to use TiDB Cloud Filesystem or Starter?
Proceed with either of the following workflows based on your needs:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants