I use wireless_tools, eg:
each one has its own man page.
If your wireless device is wlan0, the typical drill would be:
ifconfig wlan0 up
iwconfig wlan0 essid yourapname key yourkey
I use this for WEP--check the iwconfig man page for the WPA details.