README.md
1# LastPass CLI
2#### (c) 2014-2018 LastPass.
3
4Command line interface to [LastPass.com](https://lastpass.com/).
5
6## Operating System Support
7
8`lpass` is designed to run on GNU/Linux, Cygwin and Mac OS X.
9
10## Dependencies
11
12* [LibreSSL](http://www.libressl.org/) or [OpenSSL](https://www.openssl.org/)
13* [libcurl](http://curl.haxx.se/)
14* [libxml2](http://xmlsoft.org/)
15* [pinentry](https://www.gnupg.org/related_software/pinentry/index.en.html) (optional)
16* [AsciiDoc](http://www.methods.co.nz/asciidoc/) (build-time documentation generation only)
17* [xclip](http://sourceforge.net/projects/xclip/), [xsel](http://www.vergenet.net/~conrad/software/xsel/), [pbcopy](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pbcopy.1.html), or [putclip from cygutils-extra](https://cygwin.com/cgi-bin2/package-grep.cgi?grep=cygutils-extra) for clipboard support (optional)
18
19### Installing on Linux
20#### Arch
21* A binary package is available from the community repository, use pacman to simple install lastpass-cli.
22* Can be build from source with the "lastpass-cli-git" *[Arch User Repository (AUR)](https://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=lastpass-cli).
23Information about installing packages from the AUR [can be found on the Arch wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages).
24
25```
26# from community repository
27sudo pacman -S lastpass-cli
28# from AUR repository
29packer -S lastpass-cli-git
30```
31
32#### Fedora
33
34* Packages are available in Fedora 22 and later.
35
36```
37sudo dnf install lastpass-cli
38```
39
40#### Red Hat/Centos
41
42* Packages are available in [EPEL](https://fedoraproject.org/wiki/EPEL) for RHEL/CentOS 7 and later.
43
44```
45sudo yum install lastpass-cli
46```
47
48* For older versions: Install the needed build dependencies, and then follow instructions in
49 the 'Building' section.
50
51```
52sudo yum install openssl libcurl libxml2 pinentry xclip openssl-devel libxml2-devel libcurl-devel gcc gcc-c++ make cmake
53```
54
55
56#### Debian/Ubuntu
57
58* Install the needed build dependencies, and then follow instructions in
59 the 'Building' section.
60
61* For Ubuntu 16.04 (xenial)
62
63```
64apt-get --no-install-recommends -yqq install \
65 bash-completion \
66 build-essential \
67 cmake \
68 libcurl3 \
69 libcurl3-openssl-dev \
70 libssl1.0.0 \
71 libssl-dev \
72 libxml2 \
73 libxml2-dev \
74 pkg-config \
75 ca-certificates \
76 xclip
77```
78
79* For Debian (stable/oldstable) and other Ubuntus < 18.04
80
81```
82apt-get --no-install-recommends -yqq install \
83 bash-completion \
84 build-essential \
85 cmake \
86 libcurl3 \
87 libcurl3-openssl-dev \
88 libssl1.0 \
89 libssl1.0-dev \
90 libxml2 \
91 libxml2-dev \
92 pkg-config \
93 ca-certificates \
94 xclip
95```
96
97* For Debian (testing/experimental) and Ubuntu >= 18.04
98
99```
100apt-get --no-install-recommends -yqq install \
101 bash-completion \
102 build-essential \
103 cmake \
104 libcurl4 \
105 libcurl4-openssl-dev \
106 libssl-dev \
107 libxml2 \
108 libxml2-dev \
109 libssl1.1 \
110 pkg-config \
111 ca-certificates \
112 xclip
113```
114
115#### Gentoo
116* Install the package:
117
118```
119sudo emerge lastpass-cli
120```
121
122#### Other Linux Distros
123Install the packages listed in the Dependencies section of this document,
124and then follow instructions in the 'Building' section.
125
126### Installing on OS X
127
128#### With [Homebrew](http://brew.sh/) (easiest)
129* Install Homebrew, if necessary.
130* Update Homebrew's local formula cache:
131
132```
133brew update
134```
135
136* Install the lastpass-cli formula:
137
138```
139brew install lastpass-cli
140```
141
142#### With [MacPorts](https://www.macports.org/)
143* [Install MacPorts](https://www.macports.org/install.php), if necessary.
144* Update MacPorts' local ports tree:
145
146```
147sudo port selfupdate
148```
149
150* Install the lastpass-cli port:
151
152```
153sudo port install lastpass-cli
154```
155
156* Optionally install the documentation:
157
158```
159sudo port install lastpass-cli-doc
160```
161
162#### Manually
163Install the packages listed in the Dependencies section of this document,
164and then follow instructions in the 'Building' section.
165
166### Installing on FreeBSD
167* Install the binary package:
168
169```
170sudo pkg install security/lastpass-cli
171```
172
173* Or build the port yourself:
174
175```
176sudo make -C /usr/ports/security/lastpass-cli all install clean
177```
178
179### Installing on Cygwin
180* Install [apt-cyg](https://github.com/transcode-open/apt-cyg)
181* Using apt-cyg, install the needed build dependencies, and then follow
182 instructions in the 'Building' section.
183
184```
185apt-cyg install wget make cmake gcc-core gcc-g++ openssl-devel libcurl-devel libxml2-devel libiconv-devel cygutils-extra
186```
187
188## Building
189
190 $ make
191
192Under the covers, make invokes cmake in a build directory; you may also use
193cmake directly if you need more control over the build process.
194
195## Installing
196
197 $ sudo make install
198
199These environment variables can be passed to make to do the right thing: `PREFIX`, `DESTDIR`, `BINDIR`, `LIBDIR`, `MANDIR`.
200
201## Running
202
203If you've installed it:
204
205 $ lpass
206
207Otherwise, from the build directory:
208
209 $ ./lpass
210
211## Documentation
212
213Install `asciidoc` and `xsltproc` if they are not already installed.
214
215 $ sudo apt-get install asciidoc xsltproc
216
217The `install-doc` target builds and installs the documentation.
218
219 $ sudo make install-doc
220
221Once installed,
222
223 $ man lpass
224
225You can view the full documentation in the manpage, `man lpass` or [view it online](https://lastpass.github.io/lastpass-cli/lpass.1.html).
226