This command will add your network parameters to the configuration file of wpa_supplicant
sudo -s
wpa_passphrase YOUR_SSID YOUR_PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf
If the SSID of the network is hidden additional step need to be done:
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
Update what you just added scan_ssid=1
in your network parameters, such as from