Doesn't work on my vanilla Mac.
myuser@[~]$ security find-generic-password -ga MySSID | grep password
password: "password"
"desc"<blob>="AirPort network password"
(Obviously I've changed the values here, but this is what it outputs for me.)To find your current SSID:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep " SSID"
oathkeeper:~ user$ security find-generic-password -ga labnol | grep password
security: SecKeychainSearchCopyNext: The specified item could not be found in
the keychain.