現在接続されているWi-Fiネットワークのパスワードを忘れてしまった場合、以下のコマンドを実行することで、パスワードを表示できます。ただし、実行には管理者権限が必要ですので注意してください。
$ security find-generic-password -ga <SSID>
実行例
$ security find-generic-password -ga "Time Capsule 5GHz"
コマンドを実行すると、管理者権限を持つユーザのユーザ名とパスワードの入力を求められますので、入力します。
すると、「password:」欄に平文でパスワードが表示されます。
参考リンク

How to Find the Wi-Fi Password of your Current Network
How to recover the forgotten Wi-Fi password on Windows, Mac, and Linux computers.