Tested on macOS 10.13

Manage passwords with security(1) on macOS

Add a password to the default keychain:

$ security add-generic-password -a ${USER} -s NAME -w

Retrieve the password:

$ security find-generic-password -a ${USER} -s NAME -w

Delete the password:

$ security delete-generic-password -a ${USER} -s NAME

© 2008–2019 Roman Zolotarev  User Agreement  Privacy Policy  Newsletter