Add the below line(s) to ~/.zshrc
# function to remove first line of pass output
passp() { command pass "$@" | tail -n +2 }
brew install pass
# Generate the key pair
gpg --gen-key
# List the keys generated
gpg -K
# Edit the Key and remove expiry date.
# Also trust the key (use '5')
gpg --edit-key <id>
> expire
> trust
> save
# Password Store. Use the public key generated by GPG in the earlier step
pass init <id>
pass git init
# add password
pass insert <name>
# ass password value
# generate password
pass generate aws
# create passwords with namespace
pass generate github/personal
# look for a password
pass find github
# see all passwords
pass
# see password
pass show github
# don't display. just copy to clipboard
pass show -c github
# add metadata
pass edit github
# use meta-data to search
pass grep "info@email.com"
pass grep "email:"
# delete password
pass rm github
# undo previous change. undo previous commit
pass git revert HEAD
# set up git remote
pass git remote add origin <repo-link.git>
# push to remote
pass git push origin main
# clone password store
pass git clone <repo-link.git>
mkdir exported-keys
cd exported-keys
# email serves as the GPG key's ID (instead of actual ID)
# 'public.gpg' is the file that will contai public key after this command is run
# 'armor' refers to base64 format
gpg --output public.gpg --armor --export info@email.com
# export private key
gpg --output private.gpg --armor --export-secret-key info@email.com
gpg --import private.gpg
gpg --import public.gpg
Increase the trust level of the public key
gpg --edit-key info@email.com
> trust
# assign '5' -> high trust
> save