MeshCore CLI configuration
Manage your MeshCore nodes via the powerful command-line interface. Perfect control for advanced users and automation.
What is the MeshCore CLI?
The MeshCore command-line interface (CLI) is a powerful Python-based tool that gives you complete control over your mesh network nodes. Instead of a graphical interface, you use text commands to change settings, send messages, and query network statistics.
The CLI is especially popular with system administrators, developers and power users who need to configure multiple nodes, want to write scripts for automation, or prefer keyboard-driven workflows. It's also essential for remote server configuration and headless repeater setups.
This guide shows you how to install the MeshCore CLI, use basic and advanced commands, export and import configurations, and automate complete node setups with scripts.
Why use the CLI?
Speed and efficiency
Configure nodes in seconds with a few commands, much faster than clicking through a graphical interface.
Scriptable automation
Write bash or Python scripts to apply the same configuration to dozens of nodes without manual work.
Full control
Access to all settings, including advanced features not visible in the mobile app.
Backup and restore
Export complete configurations to YAML files and restore them later or on other devices.
Remote management
Configure nodes on remote servers via SSH without needing a graphical interface.
Monitoring and logging
Real-time network monitoring, packet analysis and detailed logging for troubleshooting.
Installing MeshCore CLI
The CLI is installed as a Python package via pip. It works on Windows, macOS, Linux and Raspberry Pi.
Step 1: Check Python version
You need Python 3.7 or newer. Check your version:
python3 --version
If Python is not installed, download it from python.org
Step 2: Install meshtastic package
Install the official meshtastic CLI tool via pip:
pip3 install --upgrade meshtastic
Step 3: Verify installation
Check if the installation was successful:
meshtastic --version
Basic CLI commands
These commands are used most frequently for daily management of your nodes.
Query node information
View all details of your connected node: firmware version, hardware type, node ID, region settings and more.
meshtastic --info
Set node name
Give your node a recognizable name that other users see in the network.
meshtastic --set-owner "Mijn Node"
Configure region (868 MHz)
Set the correct frequency for Europe. This is required for legal use.
meshtastic --set lora.region EU_868
Set channel encryption
Configure a shared encryption key (PSK) for private communication.
meshtastic --ch-set psk base64:jgACAYdwH3VSvEIhqST7Q==
Send message
Send a text message to all nodes in the network (broadcast).
meshtastic --sendtext "Hallo MeshCore netwerk!"
Monitor network
Listen to all incoming messages and node activity in real-time.
meshtastic --listen
Advanced configuration
For power users: access to all technical settings of your node.
LoRa radio settings
Adjust transmit power, hop limit and other radio parameters for optimal range.
meshtastic --set lora.region EU_868meshtastic --set lora.tx_power 22meshtastic --set lora.hop_limit 3GPS and location settings
Configure how often your node shares its position and GPS settings.
meshtastic --set position.gps_enabled truemeshtastic --set position.position_broadcast_secs 900Configure device role
Set your node as router/repeater for optimal network performance.
meshtastic --set device.role ROUTERmeshtastic --set device.node_info_broadcast_secs 10800WiFi and network
Connect your node to WiFi for remote management and MQTT bridging.
meshtastic --set network.wifi_ssid "MijnWiFi"meshtastic --set network.wifi_psk "wachtwoord"Configuration backup and restore
Export your complete node configuration to a file and restore it later or use it as a template for other nodes.
Export configuration
Save all settings in a YAML file.
meshtastic --export-config > config.yaml
Import configuration
Restore a previously saved configuration on a node.
meshtastic --configure config.yaml
Bulk configuration with scripts
For configuring multiple nodes, you can create a configuration YAML file and apply it to all devices:
owner:
long_name: "Amsterdam Repeater"
short_name: "AMS1"
lora:
region: EU_868
tx_power: 22
hop_limit: 3
device:
role: ROUTER
node_info_broadcast_secs: 10800
Frequently asked questions about CLI
Can I manage multiple nodes simultaneously with the CLI?
Yes, but you need to handle them one by one or write scripts. Use meshtastic --port /dev/ttyUSB0 to select a specific USB port when you have multiple nodes connected. For bulk configuration, export a config YAML and apply it to each device.
Does the CLI also work via WiFi or Bluetooth?
Yes! By default the CLI looks for a USB connection, but you can also connect via: meshtastic --host 192.168.1.100 (WiFi) or meshtastic --ble "Node Name" (Bluetooth). This is handy for remote configuration.
How do I reset my node to factory defaults via CLI?
Use the command meshtastic --factory-reset. Note: this erases ALL settings including encryption keys. Make a backup first if you want to keep them.
Can I write Python scripts that use the CLI?
Absolutely! The meshtastic package provides a complete Python API. Instead of command-line commands you can use import meshtastic and programmatically interact with your nodes. Perfect for custom monitoring tools, bots and automation.
Where can I find a complete list of all CLI commands?
Use meshtastic --help for an overview. For detailed explanation: meshtastic --help-all. The official documentation on GitHub also has a complete command reference with examples.
Will my CLI configurations be lost during a firmware update?
No, configuration is stored in NVS memory which is preserved. Only with a --factory-reset or complete flash erase is the configuration lost. Firmware updates leave your settings intact.
Master the command-line
With the MeshCore CLI you have professional control over your mesh network. Ideal for repeater network management, scripting and bulk configuration.