Skip to main content

TDengine Command Line (CLI)

The TDengine command-line interface (hereafter referred to as TDengine CLI) is the most simplest way for users to manipulate and interact with TDengine instances.


To run TDengine CLI to access TDengine cloud, please download and install recent TDengine client installation package first.


Run this command in your Linux terminal to save cloud DSN as variable:


To obtain the value of cloud DSN, please log in TDengine Cloud and click "Tools" and then select "TDengine CLI".


To access the TDengine Cloud instance, you can execute taos if you already set the environment variable.


If you did not set environment variable for a TDengine Cloud instance, or you want to access other TDengine Cloud instances rather than the instance you already set the environment variable, you can use taos -E <DSN> as below.


Using TDengine CLI

TDengine CLI will display a welcome message and version information if it successfully connected to the TDengine service. If it fails, TDengine CLI will print an error message. The TDengine CLI prompts as follows:

Welcome to the TDengine shell from Linux, Client Version:
Copyright (c) 2022 by TAOS Data, Inc. All rights reserved.

Successfully connect to in restful mode


After entering the TDengine CLI, you can execute various SQL commands, including inserts, queries, or administrative commands. Please see the official document for more details.