Yes, "nmcli" is a command. It's a shortened version of NetworkManager command-line interface. You can find it by using the "which" command, like this (but it should already be in your PATH)
[jcall@laptop ~]$ which nmcli
/usr/bin/nmcli
The 'connection name' will be something you created previously. Your connections could be created from the command-line, but I usually just use the GUI to create them (especially wireless connections.) You can list your connections with the command "nmcli connection show" or the abbreviated way "nmcli c s" Here is an example of my connections...
[jcall@laptop ~]$ nmcli connection show
NAME UUID TYPE DEVICE
Home_WiFi c1c95bd9-78f3-4764-9922-971339702735 802-11-wireless --
Hotel_WiFi 921ad0bf-e18e-4d90-87d9-0f1c852c3dc7 802-11-wireless --
Google Starbucks d5242485-ebd6-4152-a839-eaedacc49b4a 802-11-wireless --
enp0s25 6c6036d5-4739-3540-ac21-bf7a04669ed6 802-3-ethernet --
Finally, you need to execute the commands in order, one after the other. You could use && to do that, if you want to create a long single-line command. I usually just create a small script file to make things easier. Here is my example.
[jcall@laptop ~]$ cat ~/bin/mac-changer.sh
#!/bin/bash
DEV=wlp3s0
NEWMAC=9c:d9:17:2e:ae:5f
if [ $# -lt 1 ]
then
echo "You forgot to tell me which network to connect to..."
echo "Please run \`nmcli con show\` for ideas..."
exit 1
fi
if $(nmcli -t -f NAME con show | grep -q $1)
then
nmcli connection modify --temporary $1 802-11-wireless.cloned-mac-address $NEWMAC
nmcli connection up $1
else
echo "Error: $1 is not a known network. Please run \`nmcli con show\` for ideas..."
fi