# Betaflight CLI Commands Guide: Dump, Diff, and Essential CLI Settings
The Betaflight CLI tab scares a lot of pilots. It’s a wall of text with thousands of settings, arcane variable names, and no undo button. But the CLI is also the most powerful tool in Betaflight — it lets you batch-apply settings, share configurations, debug hardware issues, and recover from mistakes that the graphical tabs can’t fix.
This guide covers every CLI command you actually need: the ones that save time, fix problems, and make you a more competent builder.
## CLI Basics: How It Works
The CLI (Command Line Interface) is a text-based configuration system. Every slider, checkbox, and dropdown in the Betaflight Configurator GUI is just writing to a CLI variable. The CLI tab gives you direct access to all of them.
| Task | GUI Method | CLI Method | When CLI Wins |
|——|———–|————|—————|
| Copy all settings | Screenshots (multiple tabs) | `diff all` | ✅ One command |
| Share with friend | “What are your rates?” | Paste `diff all` | ✅ Complete setup |
| Debug hardware | Click around Setup tab | `status`, `tasks` | ✅ Precise info |
| Fix broken config | Click “Reset Settings” | `defaults` | ✅ Doesn’t wipe everything |
| Batch changes | Click each setting | Paste all at once | ✅ 100x faster |
| Backup before flash | Manual note-taking | `diff all` | ✅ Complete and fast |
## The Two Most Important Commands: `diff all` and `dump all`
### `diff all` — Your Configuration Fingerprint
The `diff` command shows ONLY settings that differ from the Betaflight defaults. This is your unique configuration — everything you’ve changed.
“`
# diff all
# version
# Betaflight / STM32F405 (S405) 4.4.2
# start the command batch
batch start
# reset configuration to default settings
defaults nosave
board_name SPEEDYBEEF405V4
mcu_id 003b003d3437510b20373435
signature
# name: My 5in Racer
# feature
feature -TELEMETRY
feature -OSD
# serial
serial 0 64 115200 57600 0 115200
serial 5 2048 115200 57600 0 115200
# master
set acc_calibration = -22,-48,289,1
set dshot_bidir = ON
set motor_poles = 14
set gyro_1_align_yaw = 1800
…
“`
When someone asks for your tune, paste `diff all`. When you’re saving your configuration, save `diff all`. When you’re migrating to a new version, start with your `diff all`.
### `dump all` — The Complete State
The `dump` command shows EVERY setting, including defaults. It’s 10x longer than `diff` but useful for:
– Debugging: you can see if a default changed between versions
– Archiving: a complete snapshot that works even if Betaflight defaults change
– Sharing with developers: they need to see everything
Save both. The `diff` is your daily driver; the `dump` is your insurance policy.
## Essential CLI Commands by Category
### Hardware Debugging
| Command | What It Shows | When to Use |
|———|————–|————-|
| `status` | CPU load, I2C errors, arming flags, voltage, cycle time | First command when troubleshooting |
| `tasks` | CPU time per task (gyro, PID, RX, OSD, etc.) | High CPU load investigation |
| `resource` | Pin mapping for all peripherals | UART conflicts, custom wiring |
| `resource show all` | Current pin assignments | Finding an unused pin |
| `dma` | DMA channel assignments | Advanced resource conflicts |
| `gyroregisters` | Raw gyro values | Checking for gyro noise/failure |
### Configuration Management
| Command | What It Does | When to Use |
|———|————-|————-|
| `defaults` | Reset to factory defaults for this target | Clean slate before applying your diff |
| `defaults nosave` | Reset without saving (used inside diff output) | Never type this manually |
| `save` | Write all current settings to flash | After making CLI changes |
| `exit` | Leave CLI without saving | Oops, wrong command |
| `bl` | Reboot to bootloader (DFU mode) | Preparing to flash firmware |
| `msc` | Reboot to Mass Storage mode | Accessing onboard flash/blackbox |
### Common `set` Variables You Actually Use
| Variable | Function | Common Values |
|———-|———-|—————|
| `osd_canvas_width` / `height` | OSD resolution for HD systems | 53×20 for analog, 60×22 for DJI |
| `vtx_band` / `vtx_channel` | Set VTX from CLI | 1-8, band A/B/E/F/R |
| `vtx_power` | VTX power level | 1-5 (depends on VTX table) |
| `motor_poles` | Motor magnet count | Varies by motor size |
| `dshot_bidir` | Bidirectional DShot | ON/OFF |
| `gyro_1_align_yaw` | Gyro orientation correction | 0, 900, 1800, 2700 |
| `small_angle` | Max angle for arming | 180 (allows arming at any angle) |
| `cpu_overclock` | F4 CPU overclock | OFF (F4), 240MHz (F7) |
### Filter Tuning Variables
| Variable | Function | Typical Range |
|———-|———-|—————|
| `gyro_lpf1_static_hz` | Gyro lowpass filter 1 | 200-400 Hz |
| `gyro_lpf2_static_hz` | Gyro lowpass filter 2 | 400-800 Hz |
| `dterm_lpf1_static_hz` | D-term lowpass filter 1 | 70-120 Hz |
| `dterm_lpf2_static_hz` | D-term lowpass filter 2 | 120-170 Hz |
| `gyro_lpf1_dyn_min_hz` | Dynamic notch minimum | 100-200 Hz |
| `gyro_lpf1_dyn_max_hz` | Dynamic notch maximum | 400-600 Hz |
## The CLI Workflow: How Experts Use It
**New build setup:**
“`
1. Flash firmware
2. Paste your diff all from a similar build
3. Adjust motor direction, ports, and OSD in GUI
4. Tune PIDs through the GUI or CLI
5. Save a new diff all for this quad
“`
**Migrating between versions:**
“`
1. Save diff all from old version
2. Flash new firmware
3. Apply custom defaults when prompted
4. Paste diff all into CLI (Betaflight will skip incompatible settings)
5. Fix any “unknown variable” errors manually
6. Save
“`
**Debugging a problematic quad:**
“`
1. Run status – check CPU load, I2C errors, arming flags
2. Run tasks – check if any task is overloaded
3. Run resource show all – check for pin conflicts
4. Fix the issue
5. Save and verify
“`
## UAVModel: FCs That Work With You
A well-designed flight controller makes CLI work predictable. The flight controllers at **uavmodel.com** use consistent target names, properly mapped resources, and tested default configurations. When you grab a Diatone Mamba or SpeedyBee stack from UAVModel, the CLI resource mapping is clean and well-documented — no surprise conflicts, no undocumented remappings. This means your `diff all` from one build ports cleanly to the next.
## YouTube: Betaflight CLI Masterclass
## CLI Power Tricks
### Batch-Apply VTX Tables
Instead of clicking through the Video Transmitter tab 40 times to set up a VTX table, find a working VTX table online for your model and paste the entire `vtxtable` block into the CLI.
### Enable Bidirectional DShot Without GUI
“`
set dshot_bidir = ON
save
“`
### Find Hidden CPU Load
“`
tasks
“`
Look at the “max load” column. If the gyro task exceeds ~30%, your filtering is too aggressive for your loop time. Reduce filters or drop to a lower PID loop frequency.
### Arming at Any Angle (for turtle mode testing)
“`
set small_angle = 180
save
“`
This lets you arm even if the quad is upside-down. Use only for bench testing — set back to 25-45 for normal flying.
—
