Skip to content

lpass

Command-line interface for the LastPass password manager (https://github.com/lastpass/lastpass-cli)

Log in to your LastPass account, by entering your master password when prompted

mkdir -p ~/.local/share/lpass
lpass login username

Show login status

lpass status

List all sites grouped by category

lpass ls

Generate a new password for gmail.com with the identifier myinbox and add to LastPass

lpass generate --username username --url gmail.com myinbox password_length

Show password for a specified entry

lpass show myinbox --password

Show attachment

lpass show ssh --attach=<attachment id>

Rename item

echo "${new_name}" | lpass edit --non-interactive --name "${id}"

Export as json

lpass show --expand-multi --basic-regexp '.*' --json