What is Betaflight CLI? CLI stands for command line interface, a configuration mode that gives users direct access to all the settings and parameters within the flight control firmware. CLI is a powerful tool, but can be daunting for less technical users. In this guide I will explain why and how to use CLI in Betaflight.
Why are we using CLI?
CLI was introduced back in the days in Baseflight and it continues to exist in Cleanflight, Betaflight, iNav, Butterflight etc.
Due to the vast amount of settings in these firmware, it’s simply impossible to list all of them in the GUI (graphical user interface – the configurator) without making it too confusing and difficult to use.
So it makes sense to only list the ones that are frequently used, and the rest can be changed via the CLI.
Another advantage of CLI is how easy it is to list all the settings and make a backup in a text file, which we will explain how later in this tutorial.
How to use CLI in Betaflight?
The CLI tab is available in Betaflight Configurator (where to download), you will have access to it once you’ve connected the flight controller to the configurator.
You can type in commands in the text input field at the very bottom of the screen, and press the “Enter” key on your keyboard to execute it.
Once you have changed a setting, you normally have to enter the command “save” in order to save the changes. If you exit CLI without doing so your changes might be lost.
To exit CLI, simply enter the command “exit” and press enter, or click on another tab, or disconnect and connect again.
How to check settings in CLI?
The first commands you should know about in Betaflight CLI are “dump” and “diff”.
When entering “dump”, it will simply dump all the settings in Betaflight. As you can probably guess, it’s a huge list and takes a while to go through.
If you only want to check the settings that have been changed from the default, you can enter “diff”. This is much easier to manage if you only want to check the settings that are previously changed.
See this article for more info about the “diff” command.
Backup and Restore Betaflight Settings using CLI
It’s good practice to make a backup of your Betaflight CLI settings every time before you make changes, so you can revert back if something goes wrong.
To backup, enter “diff all”, and copy the text to a text file.
To restore, simply copy and paste the text file you saved earlier in the CLI input field, and hit enter. Don’t forget to save before closing CLI.
Other Useful CLI Commands
There a lot of commands but some aren’t very useful. Here are the ones that I use a lot and I think you should know about :) Let me know which commands i should add to the list.
||reset controller to defaults and reboot|
||print configurable settings in a paste-able form|
||dump only the settings that are different from the defaults. Includes only the current PID profile.|
||dump only the settings that are different from the defaults. Includes ALL PID profiles.|
||exit without saving|
||get the value of the specified variable|
||lists all commands|
||save settings and reboot|
||set the the given value to the variable. (name=value or blank or * for list)|
||show system status|
Note different firmware types or versions in BetaFlight, Butterflight and iNav might have different sets of commands. You can confirm the available commands using
help in CLI or check on the respective project wiki page.