Blob


1 .\" Copyright (c) 2022, 2023 Omar Polo <op@omarpolo.com>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .Dd Januaury 2, 2023
15 .Dt PLASS 1
16 .Os
17 .Sh NAME
18 .Nm plass
19 .Nd manage passwords
20 .Sh SYNOPSIS
21 .Nm
22 .Op Fl h
23 .Ar command
24 .Op Ar argument ...
25 .Sh DESCRIPTION
26 .Nm
27 is a simple password manager.
28 Passwords are stored as a directory tree where every password is a
29 file encrypted with
30 .Xr gpg 1 .
31 .Pp
32 A password store is a
33 .Xr got 1
34 repository with a worktree checked out at
35 .Pa ~/.password-store .
36 The only restriction is that a special file called
37 .Pa .gpg-id
38 containing the GPG recipient must exist in the root of the directory tree
39 for most
40 .Nm
41 commands to work.
42 .Pp
43 Password entries can be referenced using the path relative to the
44 store directory.
45 The file extension
46 .Dq \&.gpg
47 can be omitted.
48 .Pp
49 .Nm
50 provides global and command-specific options.
51 Global options must precede the command name, and are as follows:
52 .Bl -tag -width Ds
53 .It Fl h
54 Display usage information and exit immediately.
55 .El
56 .Pp
57 The following commands are available:
58 .Bl -tag -width Ds
59 .It Cm cat Ar entries ...
60 Decrypt and print the content of
61 .Ar entries
62 in the given order.
63 .It Cm edit Ar entry
64 Modify the content of the given
65 .Ar entry
66 using an editor.
67 .It Cm find Op Ar pattern
68 Print the entries of the store one per line, optionally filtered by
69 the case-insensitive
70 .Ar pattern .
71 .It Cm mv Ar from Ar to
72 Rename a password entry, doesn't work with directories.
73 .Ar from
74 must exist and
75 .Ar to
76 mustn't.
77 .It Cm rm Ar entries ...
78 Remove the given
79 .Ar entries
80 from the store.
81 .It Cm tee Oo Fl q Oc Ar entry
82 Persist the data read from standard input into the store under the given
83 .Ar entry
84 name and then print it again on the standard output unless the
85 .Fl q
86 option is given.
87 .El
88 .Sh ENVIRONMENT
89 .Bl -tag -width Ds
90 .It Ev PLASS_GOT
91 Path to the
92 .Xr got 1
93 executable.
94 .It Ev PLASS_GPG
95 Path to the
96 .Xr gpg 1
97 executable.
98 .It Ev PLASS_STORE
99 Alternative path to the password store directory tree.
100 .It Ev VISUAL , Ev EDITOR
101 The editor spawned by
102 .Nm
103 .Cm edit .
104 If not set, the
105 .Xr ed 1
106 text editor will be used in order to given it the attention
107 it deserves.
108 .El
109 .Sh FILES
110 .Bl -tag -width Ds
111 .It Pa ~/.password-store
112 Default password store.
113 .It Pa ~/.password-store/.gpg-id
114 File containing the GPG recipient used to encrypt the passwords.
115 .El
116 .Sh EXIT STATUS
117 .Ex -std
118 .Sh EXAMPLES
119 A got repository and password store can be initialized as follows:
120 .Bd -literal -offset indent
121 $ mkdir ~/.password-store
122 $ echo foo@example.com > ~/.password-store/.gpg-id
123 $ gotadmin init ~/git/pass.git
124 $ got import -r ~/git/pass.git -m 'initial import' ~/.password-store
125 $ got checkout -E ~/git/pass.git ~/.password-store
126 .Ed
127 .Pp
128 see
129 .Xr got 1
130 for more information.
131 .Pp
132 To migrate from
133 .Xr pass 1 ,
134 delete
135 .Pa ~/.password-store
136 and check out it again using
137 .Xr got 1 .
138 .Pp
139 Generate a random password and save it to the clipboard:
140 .Bd -literal -offset indent
141 $ pwg | plass tee entry/name | xsel -b
142 .Ed
143 .Pp
144 Display the entries matching
145 .Sq key
146 arranged comfortably for reading in a terminal window:
147 .Bd -literal -offset indent
148 $ plass find key | rs
149 .Ed
150 .Pp
151 Enable tab-completion of
152 .Nm
153 command names and entries in
154 .Xr ksh 1 :
155 .Bd -literal -offset indent
156 $ set -A complete_plass_1 -- cat edit find mv rm tee
157 $ set -A complete_plass -- $(plass find)
158 .Ed
159 .Sh SEE ALSO
160 .Xr got 1 ,
161 .Xr gpg 1 ,
162 .Xr pwg 1
163 .Sh HISTORY
164 .Nm
165 was heavily influenced by
166 .Xr pass 1
167 in the design, but it's a different implementation that prioritizes ease
168 of use and composability.
169 .Sh AUTHORS
170 .An -nosplit
171 The
172 .Nm
173 utility was written by
174 .An Omar Polo Aq Mt op@omarpolo.com .
175 .Sh CAVEATS
176 .Nm
177 .Cm find
178 output format isn't designed to handle files containing newlines.
179 Use
180 .Xr find 1
181 .Fl print0
182 or similar if it's a concern.
183 .Pp
184 .Nm
185 .Cm mv
186 is not able to move directory trees, only file entries.
187 .Pp
188 There isn't an
189 .Cm init
190 sub-command, the store initialization must be performed manually.