I was wondering if anyone successfully automated the LastPass CLI login process. I cannot seem to get around the password prompt, which I need to automate to make it useful.
I've tried commands like
echo <password> | lpass login <username>
or
yes <password> | lpass login <username>
I keep getting output saying the password is not correct. Has anyone automated this?
Thanks!
You would probably need to disable the pinetry password prompt so that lpass reads your password from standard input.
As the man pages say:
Meaning: It should work if you run it like this:
Or by just setting the environment variable for your shell (
export LPASS_DISABLE_PINENTRY=1
in your~/.profile
or similar)