Pass is a tiny Ruby script to suggest and retrieve passwords for macOS.
After running the requirements, use the Makefile
$ git clone https://github.com/keegnotrub/pass
$ cd pass
$ sudo make install
# Macports
$ sudo port install pwgen
# Homebrew
$ brew install pwgen
$ pass <search> <offset>
Use search to provide grep text to match on
$ echo "site.com,login,pass" >> $HOME/.pass
$ pass site.com
An offset can be provided to retrieve the nth result
$ echo "site.com,login1,pass1" >> $HOME/.pass
$ echo "site.com,login2,pass2" >> $HOME/.pass
$ pass site.com 1
$ pass