Interacting with LastPass through the CLI

Using lastpass-cli enables password lookups without opening the LastPass desktop client.

Login to the LastPass CLI:

[email protected]:~ $ lpass login [email protected]
Success: Logged in as [email protected]

Generate test data without a user name:

[email protected]:~ $ lpass generate lpasstest 15

View data:

[email protected]:~ $ lpass show lpasstest
lpasstest [id: 5943780687328672071]
Password: `+&x6%_YcuZbdua

Generate test data with a username:

[email protected]:~ $ lpass generate [email protected] lpasstest2 15

View data:

[email protected]:~ $ lpass show lpasstest2
lpasstest2 [id: 0]
Username: [email protected]
Password: +k]e?"F5+N3`I&L

Search for entries:

[email protected]:~ $ lpass show -G lpass
Multiple matches found.
lpasstest2 [id: 0]
lpasstest [id: 5943780687328672071]

Copy password to paste-buffer:

[email protected]:~ $ lpass show lpasstest --password -c

<CTRL-V> oLVne055$\[dFsD-qZ!(

New entries are synchronized to the desktop client quickly:

lastpass sync

CLI generated passwords in the desktop client:

lastpass view

comments powered by Disqus