Quick guide for Agent Data Gateway access
This topic describes how to configure Agent Data Gateway access by running the installation command. The command-line interface (CLI) automatically requests an access token and writes it to the local secure credential store. You do not need to manually create a token or copy and paste keys.
Applicable scope
You have activated Agent Data Gateway.
You have Register a data source in Agent Data Gateway.
Procedure
Step 1: Obtain the installation command
Log on to the AI-Native Database Service console.
Click the
icon in the upper-left corner of the console. In the window that appears, click Agent Data Gateway.In the left-side navigation pane of the Agent Data Gateway console, choose Identity & Permissions > My Agent Identity.
On the Quick Start tab, select CLI Installation.
NoteThis topic uses the CLI installation method as an example. If you need to connect an agent over the MCP protocol, click MCP Installation to obtain the command for natural language or MCP access.
Click the macOS / Linux or Windows tab based on your operating system to view the corresponding installation command.
Click the One-line Command or Natural Language tab based on the method that you want to use.
One-line Command: Paste the installation command into a terminal and run the command to complete the installation manually.
Natural Language: Paste the prompt to the agent in your AI IDE. The agent then completes the installation automatically.
Click the Copy button on the right side of the command area to copy the installation command to your clipboard.
The installation command contains your exclusive install-token and region information. Do not share this command with others, because a leak may cause security risks.
The install-token has a validity period, and the page displays the remaining validity period. If the install-token has expired, refresh the page to obtain a new installation command.
Step 2: Install the Agent Data Gateway CLI
Install on macOS or Linux
Open a terminal, paste the installation command that you copied from the console, and then run the command. The command format is as follows:
curl -fsSL https://d.tb.cn/i.sh | \
bash -s -- \
--install-token <your_install_token> \
--region <region>The following list describes the command parameters:
--install-token: Your exclusive installation token. The console automatically generates and embeds this token in the command.--region: The region of the Agent Data Gateway, such ascn-shanghai.
Install on Windows
Open PowerShell, paste the installation command that you copied from the console, and then run the command. The command format is as follows:
irm https://d.tb.cn/i.ps1 -OutFile $env:TEMP\install-dgate.ps1
& $env:TEMP\install-dgate.ps1 --install-token <your_install_token> --region <region>The following list describes the command parameters:
--install-token: Your exclusive installation token. The console automatically generates and embeds this token in the command.--region: The region of the Agent Data Gateway, such ascn-shanghai.
Install by using natural language in an AI IDE
If you use an AI IDE such as Qoder, Cursor, or Claude Code, paste the prompt on the Natural Language tab to the agent. The agent reads the installation instructions and completes the installation automatically. The prompt format is as follows:
Read https://d.tb.cn/install_cli.md and use install token <your_install_token> to install the Agent Data Gateway CLI. Region: <region>.The prompt contains your exclusive install-token. Do not share the prompt with others or commit it to a code repository.
Step 3: Verify the access result
After the installation command runs successfully, the CLI automatically performs the following operations. After these operations are completed, agents can securely access enterprise data through the gateway.
Uses the install-token to obtain an access token, registers the agent identity, and writes the token to the local secure credential store.
Runs the quick setup command
dgate quickstartto complete the initial configuration of the agent and the data directory.
Verify the access result in either of the following ways:
In the left-side navigation pane of the console, choose Identity & Permissions > My Agent Identity, and then click the My Agent Identity tab. If the created access tokens appear in the list, the Agent Data Gateway access is configured.
Run
dgate versionin a terminal to view the version of the installed CLI.
The CLI command name is dgate. Run dgate help to view the available commands. To switch the agent or the data directory, run dgate quickstart again at any time.