nmcli is a command-line tool for controlling the NetworkManager.
nmcli
Arguments:
-a
--ask
$ nmcli dev wifi list $ nmcli dev wifi connect "Name Of Network" -a