If you need to connect to an airport wireless network from the commandline you could check out the little known airport command line utility.
It’s hidden at
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
You can use –help for help and -I for signal strength and ID info