You can use this command-line tool to get the wifi password cross-platform:
$ npm i -g wifi-password && wifi-password
https://github.com/kevva/wifi-password#cli