lastpass-cli: Installing and Using lpass from the Shell
LastPass command line interface tool
At a glance
- What is it?
- LastPass CLI is a C-based command line client for LastPass.com, aimed at users who want password operations and vault interaction from Unix-like terminals. The repository supports package installation or a source build, but its README focuses more on setup than on a complete first-login workflow.
- Who is it for?
- Adopt LastPass CLI if you already use LastPass and want terminal access on a supported Unix-like system. Do not choose it solely for Windows or unsupported platforms, or as a replacement for documented browser workflows.
- Can I use it commercially?
- Yes, with conditions. GPL-2.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 4 days ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What `lpass` Adds to the LastPass.com Workflow
LastPass CLI, invoked as `lpass`, provides command line access to LastPass.com. It is intended for people who manage passwords in terminals, scripts, and workstation setups where opening a browser is inconvenient. The repository contains command modules for adding, showing, editing, moving, removing, generating, importing, exporting, sharing, and synchronizing vault data. It also includes modules for login, logout, status checks, duplication, and password changes.
The appropriate users are existing LastPass.com customers working on GNU/Linux, macOS, or Cygwin. The README also gives a FreeBSD installation path, although its opening operating-system support statement names GNU/Linux, Cygwin, and Mac OS X rather than FreeBSD. Windows outside Cygwin is not listed. This boundary matters: `lpass` is not presented as a native Windows password manager or as a cross-platform desktop replacement for the LastPass browser extension.
Its practical value comes from fitting vault operations into shell-centered administration. The repository layout includes dedicated HTTP and endpoint modules, configuration handling, encryption-related source files, clipboard handling, JSON formatting, and individual command handlers. That design suggests a direct native client rather than a wrapper around the LastPass website. The README does not document automation syntax, shell completion behavior, return values, or a recommended pattern for unattended use, so administrators should not infer a supported scripting API from the existence of command modules alone.
The C Command Architecture Behind `lpass`
Based on the repository layout, the program is organized around command dispatch and several service layers. Files such as `cmd-add.c`, `cmd-show.c`, `cmd-ls.c`, `cmd-sync.c`, and `cmd-export.c` represent individual operations. Shared command definitions live in `cmd.c` and `cmd.h`, while `format.c` and `json-format.c` provide output-oriented modules.
Other source files indicate the responsibilities required for a password client. `agent.c` and `agent.h` relate to agent handling, `http.c` handles network communication, and `endpoints.c`, `endpoints-login.c`, and `endpoints-share.c` separate access to different service endpoints. `cipher.c`, `kdf.c`, and `blob.c` cover cryptographic and vault-data processing, while `config.c` manages local configuration. `clipboard.c` isolates clipboard integration. This is a modular C codebase built around native libraries rather than a Python or shell application.
The build confirms that command-line execution does not depend on an application server bundled in this repository. `make` creates a `build` directory, invokes CMake with `CMAKEOPTS`, and then builds inside that directory. Network and XML operations depend on `libcurl` and `libxml2`; TLS requires LibreSSL or OpenSSL. Optional `pinentry` can support interactive passphrase entry, while clipboard support depends on a platform utility.
The README does not explain the exact request sequence for login, vault synchronization, conflict handling, or account recovery. Repository filenames show where those concerns live, but they are not a substitute for API documentation. In particular, there is no documented explanation of offline behavior, multifactor authentication prompts, session expiry, or how credentials are cached on disk.
Installing `lpass` from Linux and macOS Packages
For Arch Linux, the README offers both the community repository and an AUR route. The community package is the simpler option. The documented AUR command uses the older `packer` command shown in the README, so a current Arch user should first confirm whether that installation path still matches their environment.
sudo pacman -S lastpass-cliOn Fedora, the documented package command is:
sudo dnf install lastpass-cliThe README says Fedora packages are available in Fedora 22 and later. For Red Hat and CentOS, it directs users to EPEL and documents this command for RHEL/CentOS 7 and later:
sudo yum install lastpass-cliOlder distributions require build dependencies and a source build. On macOS, Homebrew is labeled as the easiest documented method. Updating the local formula cache and installing the formula are separate operations.
brew update
brew install lastpass-cliThe README also lists MacPorts as an alternative. Its optional documentation package is separate from the main port:
sudo port selfupdate
sudo port install lastpass-cli
sudo port install lastpass-cli-docPackage managers reduce the initial build burden, but they do not remove all adoption checks. The reader should verify that the named repository is configured for the exact distribution and release, then confirm that `lpass` appears on the command path.
Building LastPass CLI and Opening Its Manual
Source installation starts with the required development dependencies. The Makefile hides the CMake invocation behind a small wrapper: it creates `build`, configures the project there, and delegates the remaining work to CMake. From a source checkout, the documented build command is:
makeAfter a successful build, the README gives two launch paths. An installed binary is invoked by name, while a binary in the build directory is run directly. This distinction is useful because it avoids installing the program merely to check whether it starts.
lpassIf the build has not been installed, use this command from the build directory:
./lpassInstalling system-wide requires elevated privileges because the default `PREFIX` is `/usr`. The Makefile accepts `PREFIX`, `DESTDIR`, `BINDIR`, `LIBDIR`, and `MANDIR` as environment-style make variables.
sudo make installDocumentation generation has separate prerequisites. The README calls for `asciidoc` and `xsltproc`, followed by the `install-doc` target. Once installed, the manual is available through `man lpass`.
sudo apt-get install asciidoc xsltproc
sudo make install-doc
man lpassThis is a build tutorial rather than a complete account tutorial. The README does not provide the first-use sequence for entering LastPass.com credentials, completing multifactor authentication, unlocking an existing vault, or choosing a vault. Those steps should be taken from the installed manpage and the current LastPass account interface rather than guessed from command filenames.
Optional `pinentry` and Clipboard Boundaries
LastPass CLI does not treat every dependency as mandatory in the same way. LibreSSL or OpenSSL, `libcurl`, and `libxml2` are listed as core dependencies. `pinentry` is optional. On supported systems, clipboard support is also optional and depends on a command-line clipboard utility.
For Linux and Cygwin-style environments, the README lists `xclip` or `xsel`. For macOS, it lists `pbcopy`. Cygwin users can use `putclip` from `cygutils-extra`. This platform split is concrete: installing the core client does not guarantee clipboard integration on every supported operating system.
A deployment team should treat these capabilities separately when packaging `lpass`. A minimal package can support direct terminal output without installing every optional helper, but commands that copy or paste through the system clipboard may fail or behave differently if the relevant utility is absent. The README does not document fallback behavior, clipboard timeouts, or whether clipboard contents are cleared automatically. It also does not explain how `pinentry` changes prompts or storage.
The dependency documentation also contains old distribution-specific package names for Ubuntu 16.04 and systems older than Ubuntu 18.04. Those lists should not be treated as current universal instructions. For example, the command for Debian testing, experimental, and Ubuntu 18.04 or later refers to `libssl1.1`, which may no longer match newer operating systems. Source builds therefore require attention to the distribution's package names and development headers, not merely copying the historical command block.
Maintenance, License, and the Cost of Upgrading
The repository is not archived. Its last push was on 2026-10-15, while the listed releases are v1.6.0 from 2024-08-13, v1.5.0 from 2024-05-17, and v1.3.7 from 2023-11-10. This combination indicates recent repository activity without a release dated as recently as the latest push. It does not establish the compatibility of unreleased changes with any installed `lpass` version.
The project is licensed under GPL-2.0. The repository also contains `LICENSE.OpenSSL`, indicating that licensing considerations extend beyond the main GPL designation. Organizations should review the repository files applicable to the version they distribute. This article does not interpret the license's obligations or provide legal advice.
Upgrade cost depends on installation method. Package-manager users may receive a packaged update according to the distribution's repository, but source builders must handle compiler and library compatibility themselves. The `Makefile` exposes installation paths, yet the README does not document migration commands, configuration-format upgrades, rollback, vault migration, or behavior when moving from an older version. It also does not explain whether local session data is retained across upgrades.
For unattended administration, the missing operational documentation is more significant than the size of the C codebase. Verify release notes for changed commands, confirm required TLS and XML packages on the target system, and keep the installed manpage aligned with the binary. Those checks are especially relevant because the latest repository push and latest listed release have different dates.
LastPass CLI Compared with Browser and Manual Vault Access
A browser-based LastPass workflow keeps vault interaction inside a graphical browser environment, while `lpass` exposes vault operations through a native terminal program. The repository's command modules and clipboard layer make that distinction concrete. Shell users can invoke one executable for listing, showing, editing, generating, importing, exporting, sharing, synchronization, and account-related actions.
Manual access to exported vault data follows a different model. The repository includes import and export command handlers, but the README excerpt does not specify supported formats, field mappings, conflict handling, or whether exported data is encrypted. It would therefore be incorrect to describe `lpass` simply as a viewer for plain text files.
Password-manager automation presents another alternative, but no specific third-party tool is documented in the repository material, so naming one would add an unsupported comparison. The meaningful boundary is capability based: `lpass` is purpose-built for LastPass.com and offers a command surface around that service. It is not documented as a generic password-store library, browser extension framework, or system-wide credential protocol implementation.
Choose `lpass` when terminal access and direct command execution are central. Choose browser access when graphical prompts and integration with an existing browser session matter more. Before choosing the CLI for automation, read the installed manual because the README does not promise scripting stability, machine-readable command options, exit-code semantics, or unattended multifactor authentication.
Editorial conclusion
Adopt LastPass CLI if you already use LastPass and want terminal access on a supported Unix-like system. Do not choose it solely for Windows or unsupported platforms, or as a replacement for documented browser workflows. Verify package availability, required libraries, account authentication, and your organization's password-storage policy before relying on it. For a source installation, confirm that `make`, `sudo make install`, and `man lpass` complete successfully on the target system.
Frequently asked questions
Which operating systems does LastPass CLI support?
The README says `lpass` is designed for GNU/Linux, Cygwin, and Mac OS X. It also documents installation on FreeBSD, but native Windows support outside Cygwin is not listed.
How do I build and install LastPass CLI from source?
Install the required dependencies, run `make` in the source checkout, and then run `sudo make install`. The Makefile invokes CMake in a `build` directory and accepts installation path variables such as `PREFIX` and `DESTDIR`.
What does `lpass` need for clipboard and interactive passphrase support?
Clipboard support can use `xclip`, `xsel`, `pbcopy`, or Cygwin's `putclip` from `cygutils-extra`. `pinentry` is listed as an optional dependency for interactive passphrase entry.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/lastpass-lastpass-cli)Was this useful?