finds.dev← search

// the find

rauchg/wifi-password

★ 4,567 · Shell · updated Jun 2024

Get the password of the wifi you're on (bash)

A single bash script that grabs the current WiFi password from macOS Keychain (or a specific SSID's saved password) so you can hand it to someone without digging through System Preferences. There's also a third-party Windows port linked from the README, but this repo itself is Mac-only.

It's a tiny, readable shell script wrapping `security find-generic-password` — you can read the whole thing in under a minute and know exactly what it's doing to your Keychain. Multiple install paths (Homebrew, bpkg, Antigen, Zgen, raw curl) cover most people's existing toolchains. Piping straight to `pbcopy` is a nice touch for the actual use case: someone's staring at you waiting for the password.

Last push was mid-2024 and it's a single-purpose script, so don't expect active maintenance or new features. No error handling shown for the common failure case — network not connected or SSID never associated with — you just get whatever `security` spits out to stderr. It shells out and parses Keychain output rather than using a documented API, so a macOS Keychain change could silently break it. Also worth noting: it needs your local admin password to authorize the Keychain read, which is a bit much for a party trick.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →