Pass tool fuzzy finder

(, en)

Some of you might use pass - the standard unix password manager to store passwords. I use it exclusively, but at times it can be cumbersome to look up a password that you don’t remember exactly. As mentioned earlier, in such fuzzy situations, fzf can be of great help. Here is a snippet to fuzzy search the passwords of pass. Add this to your .bashrc or equivalent:

fpass() {
  local pwdir=$(cd ${PASSWORD_STORE_DIR:=~/.password-store/} && pwd)
	local paz=$(find $pwdir -name "*.gpg"  | \
		perl -pE "s#^(?:.*)\\Q$pwdir\\E/(.*)\.gpg#\\1#"  | \
		fzf +m);
  [[ ! -z "$paz" ]] && echo $paz && EDITOR=vim pass $* $paz
}

Now you can run fpass and start the fuzzy search of fzf.