How lastpass/lastpass-cli works
LastPass CLI is a local command-line client for managing an encrypted LastPass vault and its shared folders. The principal workflow is to authenticate, load the session and vault, perform a requested operation, then display or synchronize the result. The tree and excerpts identify the command families, session persistence, encrypted-blob handling, HTTP endpoints, and share operations; wiring not shown in the sampled command sources is represented only where the command responsibilities or excerpts support it.
Main entry points: lpass.c CLI dispatcher · blob.c Encrypted vault · cmd-login.c Login/logout · cmd-show.c Show entries
Components 25
CLI commands
- CLI dispatcher
lpass.c - Login/logout
cmd-login.c - Vault operations
cmd-add.c - Show entries
cmd-show.c - Share management
cmd-share.c - Sync command
cmd-sync.c - Import/export
cmd-import.c
Identity and crypto
- Session state
session.c - Local configuration
config.c - Key agent
agent.c - Key derivation
kdf.c - Encryption
cipher.c
Vault and sync
- Encrypted vault
blob.c - Entry editing
edit.c - Output formats
format.c - Clipboard
clipboard.c
Service integration
- Upload queue
upload-queue.c - Vault endpoints
endpoints.c - Share endpoints
endpoints-share.c - Login endpoints
endpoints-login.c - HTTP transport
http.c - XML parsing
xml.c
Other components
- CLI user
- LastPass service
- System clipboard
Connections 30
- CLI user → CLI dispatcher: runs commands
- CLI dispatcher → Login/logout: dispatches
- CLI dispatcher → Vault operations: dispatches
- CLI dispatcher → Show entries: dispatches
- CLI dispatcher → Share management: dispatches
- CLI dispatcher → Sync command: dispatches
- CLI dispatcher → Import/export: dispatches
- Login/logout → Key derivation: derives key
- Login/logout → Login endpoints: authenticates
- Login/logout → Session state: manages session
- Session state → Local configuration: reads/writes
- Session state → Encryption: decrypts key
- Session state → Key agent: clears agent
- Vault operations → Entry editing: edits entries
- Vault operations → Encrypted vault: updates vault
- Show entries → Encrypted vault: searches entries
- Show entries → Clipboard: copies fields
- Show entries → Output formats: formats output
- Clipboard → System clipboard: writes
- Sync command → Encrypted vault: synchronizes vault
- Encrypted vault → Encryption: decrypts/encrypts
- Share management → Share endpoints: manages sharing
- Share management → Encrypted vault: uses vault data
- Share endpoints → HTTP transport: posts requests
- Vault endpoints → Upload queue: queues updates
- Upload queue → HTTP transport: sends requests
- Login endpoints → HTTP transport: posts requests
- HTTP transport → LastPass service: exchanges data
- Share endpoints → XML parsing: parses replies
- Login endpoints → XML parsing: parses replies