Skip to main content

Complete Meshtastic CLI Command Reference

The Meshtastic Python CLI provides the most comprehensive access to node configuration and data. This reference covers all major command categories.

Installation

pippip3 install meshtastic--upgrade "meshtastic[cli]"
# or for the latest developmentpre-release version:
pippip3 install meshtastic--upgrade --pre "meshtastic[cli]"

Connection Options

# Auto-detect serial port (most common):
meshtastic --info

# Specify serial port (Windows):
meshtastic --port COM3 --info

# Specify serial port (Linux/Mac):
meshtastic --port /dev/ttyUSB0 --info

# Connect via TCP (WiFi-enabled nodes):
meshtastic --host 192.168.1.100 --info

# Connect via BLE:BLE. First scan to find the real device name/address:
meshtastic --ble-scan
# then connect using the name or address it reports:
meshtastic --ble "Meshtastic_ABCD" --info

Information and Status

# Show device info, config, and channels:
meshtastic --info

# Show node database (all known nodes):
meshtastic --nodes

# ShowView channels: --info lists them; --qr-all shows channel list:URLs/QR codes:
meshtastic --export-configqr-all

Configuration Get/Set

# Get a specific config value:
meshtastic --get device.role
meshtastic --get lora.hop_limit
meshtastic --get power.is_power_saving

# Set a config value:value (role values are bare enum names: CLIENT, ROUTER, ROUTER_LATE, CLIENT_MUTE, etc. - no _ROLE suffix):
meshtastic --set device.role ROUTER
meshtastic --set lora.hop_limit 5
meshtastic --set lora.region US

# Set multiple values at once:
meshtastic --set device.role ROUTER --set lora.hop_limit 5 --set power.is_power_saving false

Channel Management

# Show current channels:
meshtastic --info # includes channel list

# Set channel 0 (primary) name and key:
meshtastic --ch-index 0 --ch-set name "CommunityMesh"
meshtastic --ch-index 0 --ch-set psk "base64key=="

# Add a new channel:
meshtastic --ch-add

# Delete channel (specify index):
meshtastic --ch-del --ch-index 2

# Enable/disable MQTT uplink per channel:
meshtastic --ch-index 0 --ch-set uplink_enabled true
meshtastic --ch-index 0 --ch-set downlink_enabled true

Identity

# Set long name:
meshtastic --set-owner "Your Name"

# Set short name (4 chars max):
meshtastic --set-owner-short "AB01"

Position

# Set fixed GPS position (lat,latitude lon,and alt in meters)longitude):
meshtastic --setlat 45.5051 --setlon -122.6750 --setalt 50

# Remove fixed position (use live GPS):
meshtastic --remove-position

The CLI sets a fixed position with --setlat and --setlon only; there is no --setalt flag. To set altitude as well, use the Python API (interface.localNode.setFixedPosition(lat, lon, alt)).

Messaging

# Send a text message to primary channel:
meshtastic --sendtext "Hello, mesh!"

# Send to a specific channel index:
meshtastic --ch-index 1 --sendtext "Admin message"

# Listen for incoming messages and packets (Ctrl+C to stop):
meshtastic --listen
#

Waypoints Sendare GPScreated waypoint:from meshtasticthe mobile/desktop apps. The CLI does not provide a --sendwaypoint / --waypoint-name* "Meetingset Point"of --waypoint-latflags 45.5051as --waypoint-lona -122.6750documented way to send a waypoint.

Maintenance

# Export full config to file:file (output is YAML):
meshtastic --export-config > config.jsonyaml

# ImportRestore/apply config from a YAML file:
meshtastic --import-configconfigure config.jsonyaml

# Factory reset (clears all config and node DB):
meshtastic --factory-reset

# Reboot device:
meshtastic --reboot

There is no --import-config flag. The output of --export-config is YAML (not JSON), and it is applied back with --configure.