Skip to main content

CLI

The taosX CLI provides four public subcommands and a set of global options for running tasks, starting services, migrating privileges, and inspecting archives. Place global options before the subcommand. An accepted command or an exit code of 0 does not mean the task succeeded; verify error logs and target data together.

Where to operate: use PowerShell on the Windows host running taosX, or Bash on the Linux host. The default Windows executable is C:\TDengine\taosx.exe; on Linux, use taosx.

Options belong to the command parser; DSN query parameters belong to a particular source or target. Do not mix them. Replace all hosts, paths, accounts, and objects in commands with values for the actual environment.

The following command examples use Linux Bash syntax, with backslashes for multiline continuation. PowerShell does not support backslash continuation. Combine the command into one line or use backticks for continuation, and invoke taosx from its installation location.

1. View the Version and Online Help​

These commands only read version and help information. They do not start tasks or services.

taosx --version
taosx --help
taosx run --help
taosx serve --help
taosx privileges --help
taosx archive --help
taosx help run

--help displays more complete help than -h. Confirm the program version first; do not apply options added in other versions directly to the installed program. Check native program exit results with $? after the command in Bash or $LASTEXITCODE in PowerShell, and record error output. Even with an exit code of 0, verify business results as described in the task guide.

help is the help entry point. taosx help run displays help for run without starting an ingestion task. The same form works for other subcommands. <FILES> in command help and INPUT_FILE below both represent archive input paths to replace; filenames do not have to use these words.

For example, if a Parquet import omits the timestamp column required by the model, processing errors and downstream failure acknowledgments may occur while the command still returns 0. Automated verification must check both error logs and data in the target window, not just the exit code. For an example, see Parquet troubleshooting.

2. run​

run executes a data task in command-line mode, reading, processing, and writing data according to the source and target DSNs. The task ends when the command exits.

taosx [全局选项] run --from FROM_DSN --to TO_DSN [--parser PARSER] [--transform ACTION ...]
OptionType and requirementPurpose
-f, --fromDSN, requiredSource; query parameters are interpreted by source type
-t, --toDSN, requiredTarget; file targets are written on the execution host
-p, --parserParsing definition, optionalUse JSON or @文件 as described in Parsing (JSON, Regex, UDT); not all structured migration paths use it
-T, --transformTransformation action, repeatableFor renaming, adding tags, and other actions, see Object Selection and Renaming; arbitrary UI transformation JSON cannot be entered directly

The minimum parameter combination is -f/-t. For a runnable scoped migration example and time boundaries, see Migrate a Time Range with the CLI. For backup and restore, see Data Backup and Restoration in the operations guide. A taosx run task runs in the current process; starting the command does not automatically register it as a background task managed by Explorer.

Check parsing files, table lists, certificates, and output directories against the execution host and service identity. Use shell quotes for paths containing spaces. For &, ?, and special credentials in DSNs, see DSN and Connector Parameters.

Common examples:

  1. Migrate historical data from a specified supertable in a database:
taosx -v run \
-f 'taos://USER:PASSWORD@source-host:6030/source_db?stables=meters&mode=history&start=2026-01-01T00:00:00Z&end=2026-01-02T00:00:00Z' \
-t 'taos://USER:PASSWORD@target-host:6030/target_db'
  1. Import CSV into a target database with a parsing file:
taosx -v run \
-f 'csv:/data/meters.csv' \
--parser '@./meters.json' \
-t 'taos://USER:PASSWORD@target-host:6030/csv_db'
  1. Export query results to a Parquet file:
taosx run \
-f 'taos://USER:PASSWORD@source-host:6030/source_db?query=select tbname,* from meters' \
-t 'parquet:/data/export/meters.parquet'

Use an isolated test target for the first run. Confirm the write scope before using the command in production.

More typical scenarios:

  1. First create a separate backup directory on the execution host and grant the execution account write permission. Then back up only one day of historical data from child tables d0 and d1:
taosx -v run \
-f 'taos://USER:PASSWORD@source-host:6030/source_db?tables=d0,d1&start=2026-01-01T00:00:00Z&end=2026-01-02T00:00:00Z' \
-t 'local:/data/taosx-backup/table-set'

The historical window includes the lower bound and excludes the upper bound: midnight on January 1 is included, and midnight on January 2 is excluded. After the backup, inspect the directory contents and table inventory. A return code of 0 does not replace backup completeness verification.

  1. Place the verified complete backup directory at /data/taosx-restore/table-set and restore it to a separate target database:
taosx -v run \
-f 'local:/data/taosx-restore/table-set?watch=false' \
-t 'taos://USER:PASSWORD@target-host:6030/restore_db'

Once recognized as a table backup, this restore branch reads the complete directory in one pass. The example does not use from or to, and watch=false does not narrow the scope or control watching in this branch. Those two time parameters are for restoring task-level incremental chains; they do not filter business data in this branch. Do not remove metadata files from the directory or restore directly from a directory still being written. After restoration, check row counts, time boundaries, and failure lists for each table. For complete prerequisites, see Data Backup and Restoration in the operations guide.

  1. When migrating the meters supertable, append _2 to every target child table name to avoid conflicts with existing target child tables:
taosx -v run \
-f 'taos://USER:PASSWORD@source-host:6030/source_db?stables=meters&mode=history&start=2026-01-01T00:00:00Z&end=2026-01-02T00:00:00Z' \
-t 'taos://USER:PASSWORD@target-host:6030/renamed_db' \
-T 'rename-child-table:suffix:_2'

This changes only child table names; it does not append a suffix to supertable names. Check the transformed names for conflicts first, then verify the actual child tables and data in the target database. For other renaming methods, see Object Selection and Renaming.

2.1 Resume with --task-id (Unverified)​

Older material describes a resume method for standalone taosx run executions, based on reusing task state with the same --task-id. The current version retains this hidden parameter, but this path has not completed end-to-end verification and cannot be treated as a production resume guarantee. Test only against an isolated target:

taosx run \
-f 'taos://USER:PASSWORD@source-host:6030/source_db?stables=meters&mode=history&start=2026-01-01T00:00:00Z&end=2026-01-02T00:00:00Z' \
-t 'taos://USER:PASSWORD@target-host:6030/resume_demo' \
--task-id=1001
warning

1001 is an isolated test identifier; do not share it with other tasks. First record each table's row count in the source window. Stop the task during writing, then rerun it on the same execution host with the same data directory, source and target configuration, and task identifier. Finally, check row counts, time boundaries, duplicates, and missing records for each table. Acceptance of the parameter means only that the command can be parsed, not that the read position was saved and restored. If any item cannot be confirmed, use backfill with an explicit time window instead; do not use this directly in production.

3. serve​

serve starts the taosX process in service mode, reads the configuration file, and uses the options in this section to set runtime parameters such as listening addresses, TLS, and request timeouts.

taosx [全局选项] serve [服务选项]

Start production services through the existing service manager. Do not run this example while an existing service is running. For an isolated foreground check, use taosx -c /path/to/taosx.toml serve, but first confirm approval for startup, addresses, and directories to avoid conflicts with existing instances.

OptionValuePurpose and limits
-l, --listen地址:端口HTTP API listener, default 0.0.0.0:6050; restrict accessible sources
-g, --grpc地址:端口gRPC listener, default 0.0.0.0:6055; not an advertised URL
--ssl-cert, --ssl-key, --ssl-caFile pathsHTTP TLS certificate, private key, and CA; prepare them as a set
--grpc-ssl-cert, --grpc-ssl-key, --grpc-ssl-caFile pathsSeparate gRPC TLS configuration; the HTTP configuration can be reused if no separate certificates are specified
--request-timeoutInteger seconds, default 30Applies to interfaces that use this timeout setting, not data processing for all tasks
--do-not-resumetrue or falseAccepted, but does not control service task recovery; do not rely on it to prevent automatic recovery. Stop tasks and check their status according to the task guide before maintenance
-D, --database-urlStringCompatibility entry point; task metadata uses TSDB. Do not create task databases from old SQLite examples or use this option to migrate old tasks
--repeat-intervalUnsigned integer secondsAdvanced entry point related to service task triggering; not a general backup scheduling or connector collection interval setting. Use the task's own configuration for routine operations

For the differences between TLS, registered addresses, proxy endpoints, and the Explorer backend address, see Deployment and Security. RESTART XNODE does not mean this process will restart.

Common examples:

  1. Start in the foreground with a specified configuration file for an isolated check:
taosx -c /path/to/taosx.toml serve
  1. Listen only on the local loopback address and increase log verbosity:
taosx -v serve -l 127.0.0.1:6050 -g 127.0.0.1:6055
  1. Configure TLS for HTTP and let gRPC reuse the same materials:
taosx serve \
--ssl-cert /path/to/server.crt \
--ssl-key /path/to/server.key \
--ssl-ca /path/to/ca.crt

4. privileges​

privileges migrates users, privileges, and whitelists between source and target clusters. It can also export them to a file and import them from that file later.

Only the following three input/output combinations are accepted:

taosx privileges -f SOURCE_DSN -t TARGET_DSN [范围选项]
taosx privileges -f SOURCE_DSN -o EXPORT_FILE [范围选项]
taosx privileges -i EXPORT_FILE -t TARGET_DSN [范围选项]
OptionMeaning
-f, --fromSource cluster endpoint DSN; mutually exclusive with -i
-i, --inputPath to an existing identity export file, not a source DSN
-t, --toTarget cluster endpoint DSN; mutually exclusive with -o
-o, --outputExport file path, not a restore directory
-u, --usersUser identity materials, including corresponding password materials, but not unselected whitelists
-p, --privilegesPrivilege scope; unlike run -p, this does not mean parsing
-w, --whitelistUser whitelists; migrate with the user scope to include the corresponding user materials
warning

Without scope flags, users, privileges, and whitelists are included by default. If any scope flags are specified, only the selected scopes are processed. Output contains sensitive materials; save it only in approved controlled files. Import changes target identity privileges. First check source and target cluster versions and conflicts as described in Identity, Privileges, and Least Privilege.

Common examples:

  1. Migrate directly from the source cluster to the target cluster:
taosx privileges \
-f 'taos://USER:PASSWORD@source-host:6030' \
-t 'taos+ws://USER:PASSWORD@target-host:6041'
  1. Export only users and privileges to a JSON file:
taosx privileges \
-f 'taos://USER:PASSWORD@source-host:6030' \
-o './identity-export.json' --users --privileges
  1. Import from a JSON file to the target cluster:
taosx privileges \
-i './identity-export.json' \
-t 'taos://USER:PASSWORD@target-host:6030' \
--users --privileges

These examples show parameter combinations only. Replace the DSNs with actual values and obtain approval before export. The export file does not contain business table data and does not mean that every RBAC role model has been fully migrated.

5. archive​

archive reads error archives or pending-write cache files, prints summaries and samples, or extracts readable frames as standard Parquet.

taosx archive INPUT_FILE [INPUT_FILE ...] [--limit N] [-o OUTPUT_DIR]
ParameterType and defaultMeaning
INPUT_FILEOne or more existing files, requiredControlled copies of error archives or pending-write caches; not database backups
--limitNonnegative integer, default 20Maximum sample rows displayed per input file; 0 displays only the summary but still reads the file
-o, --outputOptional directoryExtracts all readable fragments as standard Parquet, regardless of the sample display row limit

Common examples:

  1. View a summary and the first 20 sample rows from an archive file:
taosx archive '/data/taosx-inspect/tasks-123-archive'
  1. Print summaries only and inspect multiple files:
taosx archive --limit 0 \
'/data/taosx-inspect/tasks-123-archive' \
'/data/taosx-inspect/tasks-123-cache'
  1. Extract readable frames as standard Parquet for analysis with external tools:
taosx archive \
-o '/data/taosx-inspect/frames' \
'/data/taosx-inspect/tasks-123-archive'

Replace the example paths with controlled copies on the execution host. When multiple inputs are used with -o, each input is extracted to its own subdirectory. Do not pass two output directories to -o. Use a newly created empty output directory to avoid mixing in previous results. Check extracted files, warnings, and the exit result. This command does not restore data to a database, and readable fragments from damaged files do not guarantee completeness. For complete Windows/Linux procedures, see Inspect Error Archives.

6. Global Options​

Global options apply to this process and the tasks it starts, not to an already running service instance. Position affects parsing. Place all options in the following table before the subcommand, for example taosx -c /etc/taos/taosx.toml --monitor-fqdn keeper-host run .... Not every option can follow a subcommand; consult help for the relevant position.

--log.path, --log.level, --log.compress, --log.rotationCount, --log.keepDays, --log.rotationSize, --log.reservedDiskSize, --log.watching, and --monitor-fqdn are declared only at the main command level. Placing them after run, serve, or other subcommands may produce an unknown-option error. Use --version at the main command level as well. Do not use TOML spellings, add arbitrary prefixes, or put them in a DSN to work around a command-position error.

OptionPurpose
-c, --configTOML file for this process; does not automatically change a running system service
-v, --verbose; -q, --quietRepeatable; increase or decrease log verbosity
--tracing-eventsHelp default is none; accepted, but does not control tracing-event output. Do not rely on it to enable troubleshooting logs
--plugins-home, --data-dir, --instance-idPlugin directory, data directory, and instance identifier on the same host
--logs-home, --log-keep-daysCompatibility log directory and retention settings; prefer the unified log configuration
--log.path, --log.levelLog path and level
--log.compressLog rotation compression switch; accepts an optional boolean value
--log.rotationCount, --log.keepDaysRotated log count and retention days
--log.rotationSize, --log.reservedDiskSizeRotation size and reserved disk threshold, as strings with units
--log.watchingWatches module log configuration changes; does not mean all configuration supports hot reloading
-d, --debugAccepted, but does not add log locations or adjust log levels; location display depends on the program build. Use log.level to configure the level
--no-log-to-filesRedirects this process's logs to standard error; consider the impact on log collection
--no-async-logAccepted, but does not control asynchronous log writing; cannot guarantee that all logs are written before exit
-j, --jobsDefault runtime thread count, with 0 calculated automatically; not the number of tables, tasks, or concurrent connector reads
--otelOpenTelemetry switch, also limited by package build capabilities and deployment conditions; not the taosKeeper reporting switch
--monitor-fqdn, --monitor-port, --monitor-intervaltaosKeeper host, port, and interval in seconds; default port 6043 and interval 10. The CLI interval option accepts integers from 1–10. Reporting is disabled when no host is configured
--backup.autoCreateDirWhether to create a user-specified backup directory, default false; does not control backup scheduling
--resource.enabledMain resource-control switch; disabled without a resource section, enabled by default when the section exists
--resource.maxWriteMBpsData egress budget, with 1 MB equal to 1048576 bytes; 0 is unlimited
--resource.maxMemoryMBSoft RSS budget for the main process plus connector subprocesses, in MiB. With 0, Linux attempts to use the process cgroup limit; otherwise this memory budget is disabled
--resource.maxPauseSecsMaximum resource pause in seconds, default 10; 0 uses the default. Resumption is allowed at expiry; this is not a hard memory guarantee
--resource.cgroupPathAdvanced Linux resource path override; not used on Windows
--resource.maxCpuPercent, --resource.cpuResumePercentHigh and resume watermarks measured against total CPU capacity; a limit of 0 is unlimited, and a resume value of 0 uses 80% of the high watermark
--resource.maxCpuCoresLimit for each runtime worker thread pool, not a process-wide CPU utilization or total thread count limit
--resource.cpuPriorityLinux nice value 1–19 to lower priority; 0 makes no adjustment
-h, --help; -V, --versionView help and version; place the version option at the main command level

For configuration keys, environment variables, and precedence, see Configuration Files. For resource units, platforms, and verification, see Tuning and Resource Control. Source DSN parameters such as workers and batch_size belong to the relevant connector and cannot be replaced with --jobs or arbitrary global options.

6.1 Boolean Options and Values​

Boolean options cannot always be used alone. Check <值> or [<值>] in help to determine whether a value is required. <值> requires a value immediately after the option; [<值>] makes the value optional. When setting a value explicitly, prefer --选项=值 to avoid interpreting the following subcommand as the option value.

Type and exampleCorrect interpretation
--resource.enabled=true, serve --do-not-resume=falseRequires true or false; the option name alone is not sufficient.
--backup.autoCreateDir=true, --backup.autoCreateDir=falseValue is optional. The option alone means true; omitting it does not override the existing configuration, so it does not prove that the current value is false.
--log.compress=true, --log.compress=falseValue is optional. The option alone enables compression; omitting it preserves the merged configuration result.
--log.watching, --debug, --no-log-to-files, --no-async-log, --otelValueless flags. Do not append false to disable them; check the corresponding configuration and environment variables.
-vv, -qqRepeatedly increase or decrease log verbosity; not concurrency or retry options with integer values.

These are syntax illustrations only. Do not use them to start another instance while an existing service is running. An accepted parameter does not mean it implements the effect suggested by its name. See the table above for the limits of --debug, --tracing-events, --no-async-log, and --do-not-resume. Use explicit true or false for compression. Other strings may not cause an error for this option, and a misspelling may enable compression; command acceptance does not prove the value is correct. --no-log-to-file is a compatibility alias for --no-log-to-files; use the latter in new commands. Verify actual logs, budgets, and recovery behavior after configuration changes according to the relevant operations guide.

7. Positional Arguments in Help​

Main-command help also shows the following three positional arguments. They have no -- and are parsed in order. There are no corresponding --telemetry.server or --max-activities-per-entity options. Appending numbers or hostnames to routine ingestion commands to try to configure them is not recommended.

Positional argumentType and fallbackPurpose and limits
MAX_ACTIVITIES_PER_ENTITYNonnegative integer; 100 when unset at service startupEntry point for the number of activities retained; the service controller does not use this value to limit activity records. It cannot guarantee a log count, set retention days, or limit task count.
telemetry.serverHostname; help default telemetry.taosdata.comDestination for instance and version reporting, separate from taosKeeper monitoring and OpenTelemetry. The service startup path attempts to send an HTTP request to /report on this host; actual sending also depends on the state of the instance identifier file in the data directory. Not a configuration for per-message business reporting or periodic metrics reporting.
telemetry.portUnsigned 16-bit port; help default 80Destination port for that instance reporting. Changing it to 443 does not automatically change the protocol to HTTPS, taosX listeners, or the taosKeeper port.

Instance reports include the instance identifier, taosX version, build information, and commit identifier. Do not treat this behavior as evidence that --monitor-fqdn or --otel has taken effect, or an existing instance identifier file as proof of successful reporting. In restricted networks, have operations and security owners confirm egress policy and how reporting is managed in the package. Do not delete the data directory or instance file to repeatedly trigger requests, or disable TLS verification to solve connection issues with different purposes.