← 返回命令列表

Linux command

lpass 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Login to LastPass

lpass login [user@example.com]

Show password for a site

lpass show --password [sitename]

Copy password to clipboard

lpass show --clip --password [sitename]

List all accounts

lpass ls

Search for entries

lpass show -G [pattern]

Add a new password

lpass add [Folder/sitename]

Generate a password

lpass generate [sitename] [20]

Logout

lpass logout

说明

lpass is the command-line interface for LastPass password manager. It provides full access to your vault from the terminal, enabling scripted password retrieval and management. Authentication creates an encrypted local cache. The agent keeps your session active, avoiding repeated master password entry. Session timeout is configurable via LPASS_AGENT_TIMEOUT environment variable. Entries are organized in folders with full paths (e.g., "Work/email"). Fields include username, password, URL, and notes. Secure notes store arbitrary text. Custom fields are supported. For automation, --clip pipes to clipboard utilities, and --password outputs just the credential for use in scripts. The generate command creates random passwords meeting complexity requirements. Sharing and enterprise features accessible via the web vault are partially supported. Two-factor authentication works with TOTP apps.

参数

login _EMAIL_
Authenticate with LastPass.
logout
End session and clear cache.
show _NAME_
Display entry details.
ls _GROUP_
List entries, optionally filtered by group.
add _NAME_
Add new entry interactively.
edit _NAME_
Modify existing entry.
rm _NAME_
Delete entry.
generate _NAME_ _LENGTH_
Generate and store random password.
sync
Synchronize local cache with server.
export
Export vault as CSV.
import _FILE_
Import entries from CSV.
--password
Show only password field.
--username
Show only username field.
--url
Show only URL field.
--clip, -c
Copy to clipboard instead of printing.
-G, --basic-regexp
Match using regular expression.
--sync=auto|now|no
Control synchronization behavior.
--color=auto|always|never
Color output control.

FAQ

What is the lpass command used for?

lpass is the command-line interface for LastPass password manager. It provides full access to your vault from the terminal, enabling scripted password retrieval and management. Authentication creates an encrypted local cache. The agent keeps your session active, avoiding repeated master password entry. Session timeout is configurable via LPASS_AGENT_TIMEOUT environment variable. Entries are organized in folders with full paths (e.g., "Work/email"). Fields include username, password, URL, and notes. Secure notes store arbitrary text. Custom fields are supported. For automation, --clip pipes to clipboard utilities, and --password outputs just the credential for use in scripts. The generate command creates random passwords meeting complexity requirements. Sharing and enterprise features accessible via the web vault are partially supported. Two-factor authentication works with TOTP apps.

How do I run a basic lpass example?

Run `lpass login [user@example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does login _EMAIL_ do in lpass?

Authenticate with LastPass.