Command Line Interface
Base Usage

ESPHome’s command line interface always has the following format
esphome [OPTIONS] <COMMAND> <CONFIGURATION...> [ARGUMENTS]
Note
You can specify multiple configuration files in the command line interface for some commands,
just list all files after the
esphome run livingroom.yaml kitchen.yaml
--help
Option

-h|--help
--help
for any command to get arguments specific to that command.esphome <some_command> --help
--verbose
Option

-v|--verbose
ESPHOME_VERBOSE=true
.--quiet
Option

-q|--quiet
--substitution
Option

(can be issued multiple times)
-s|--substitution KEY VALUE
run
Command

The esphome run <CONFIG>
command is the most common command for ESPHome. It
- Validates the configuration
- Compiles a firmware
- Uploads the firmware (over OTA or USB)
- Starts the log view
--device UPLOAD_PORT
/dev/cu.SLAB_USBtoUART
, or 192.168.1.176
to perform an OTA.--upload_speed BAUD_RATE
ESPHOME_UPLOAD_SPEED
.
This can be overridden in the platformio options on a per-config
basis, or set with this option at the time of uploading.--no-logs
--topic TOPIC
--username USERNAME
--password PASSWORD
--client-id CLIENT_ID
--host-port HOST_PORT
--reset
ESPHOME_SERIAL_LOGGING_RESET=true
.config
Command

The esphome config <CONFIG>
validates the configuration and displays the validation result.
compile
Command

The esphome compile <CONFIG>
validates the configuration and compiles the firmware.
--only-generate
upload
Command

The esphome upload <CONFIG>
validates the configuration and uploads the most recent firmware build.
--device UPLOAD_PORT
/dev/cu.SLAB_USBtoUART
, or 192.168.1.176
to perform an OTA.--upload_speed BAUD_RATE
ESPHOME_UPLOAD_SPEED
.
This can be overridden in the platformio options on a per-config
basis, or set with this option at the time of uploading.--host-port HOST_PORT
clean-mqtt
Command

The esphome clean-mqtt <CONFIG>
cleans retained MQTT discovery messages from the MQTT broker.
See Using with Home Assistant MQTT entities.
--topic TOPIC
--username USERNAME
--password PASSWORD
--client-id CLIENT_ID
wizard
Command

The esphome wizard <CONFIG>
command starts the ESPHome configuration creation wizard.
mqtt-fingerprint
Command

The esphome mqtt-fingerprint <CONFIG>
command shows the MQTT SSL fingerprints of the remote used
for SSL MQTT connections. See SSL Fingerprints.
version
Command

The esphome version
command shows the current ESPHome version and exits.
clean
Command

The esphome clean <CONFIG>
command cleans all build files and can help with some build issues.
dashboard
Command

The esphome dashboard <CONFIG>
command starts the ESPHome dashboard server for using ESPHome
through a graphical user interface. This command accepts a configuration directory instead of a
single configuration file.
--address ADDRESS
--port PORT
--socket SOCKET
--address
or --port
the values
for those parameters will be ignored. Cannot be used along with --systemd-socket
.--username USERNAME
--password PASSWORD
--open-ui
--socket
.logs
Command

The esphome logs <CONFIG>
command validates the configuration and shows all logs.
--topic TOPIC
--username USERNAME
--password PASSWORD
--client-id CLIENT_ID
--device SERIAL_PORT
/dev/cu.SLAB_USBtoUART
.--reset
ESPHOME_SERIAL_LOGGING_RESET=true
.Using Bash or ZSH auto-completion

ESPHome’s command line interface provides the ability to use auto-completion features provided by Bash or ZSH.
You can register ESPHome for auto-completion by adding the following to your ~/.bashrc file:
eval "$(register-python-argcomplete esphome)"
For more information, see argcomplete documentation.