The tool is called airport (what a surprise!), and it's hiding in /System -> Library -> PrivateFrameworks -> Apple80211.framework -> Versions -> A -> Resources. It appeared there after one of the Panther updates, and Apple has actually been slowly improving it since then; it's really functional. Just go to that directory and launch it in Terminal (no root privileges required) like this:
$ ./airport -h
and you'll see all the available options. It can scan for broadcasting networks (-s), or for a hidden one if you know it's name (-sNAME). It can associate you with a network (-A), show you status of your card, and many other good things. I created a soft link for easy access to this little gem, and if you have admin privileges, you can make one like this:
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.\
framework/Versions/A/Resources/airport /usr/bin
Enjoy!

