OpenThread CLI Overview

Stay organized with collections Save and categorize content based on your preferences.

View source on GitHub

The OpenThread CLI exposes configuration and management APIs from a command-line interface. Use OT CLI to create an OpenThread development environment, or use it as a tool with additional application code. For example, the OpenThread test scripts use the CLI to execute test cases.

Get started

Complete our Simulation Codelab with Docker and review the CLI Command Reference.

Go to the Simulation Codelab Go to the CLI Command Reference


You can use OT CLI with OpenThread Border Router (OTBR) and Thread devices. CLI commands will vary depending on your device type and build flags.


To use OT CLI with OTBR, enter the following prefix before each command:

sudo ot-ctl

Thread devices

To use CLI Commands on a Thread device, refer to the platform documentation, codelab, or guide. For many examples, you can begin typing commands without a prefix:


Here are a few resources to help you get started:

Special characters

The whitespace character (' ') is used to delimit the command name and the different arguments, together with the tab ('\t') and new line characters ('\r', '\n').

Some arguments might include spaces, for example a Thread network name. To send arguments that include spaces, use the backslash character ('\') to escape separators or the backslash itself:

networkname Test\ Network
Test Network

Argument mappings

OT CLI uses predefined arguments that correspond to API configuration values. These mappings can be passed with CLI commands, and might also return to the CLI console for various Network Data commands, for example netdata show.


Some commands, for example prefix add, require otBorderRouterConfig values. To set otBorderRouterConfig members from the command line, OT CLI parses a mapped letter argument for each member. For example, the argument combination paros sets the mPreferred, mSlaac, mDefaultRoute, mOnMesh, and mStable members, consecutively.


In the following example, prefix is required, and otBorderRouterConfig arguments are optional, mapped as p, a, d, c, r, o, s, n, and D:

prefix add prefix [padcrosnD]


To use argument mappings, do not enter spaces between the letters:

prefix add 2001:dead:beef:cafe::/64 paros


To set the otRoutePreference, use high, med, or low in OT CLI commands.


prefix add prefix [padcrosnD] [high|med|low]


Here's an example of using mapped otBorderRouterConfig and otRoutePreference parameters:

prefix add 2001:dead:beef:cafe::/64 paros med


For otExternalRouteConfig values, s maps to mStable and n maps to mNat64.


publish route prefix [sn]


route add 2001:dead:beef:cafe::/64 s

Return values

Most commands return the requested value, followed by Done:

br onlinkprefix

Other commands that include Network Data might return argument mappings for prefix, route, and service records. For more information, refer to Display and Manage Network Data with OT CLI.