Blob


1 .\" Copyright (c) 2021, 2022 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 find Op Ar pattern
64 Print the entries of the store one per line, optionally filtered by
65 .Ar pattern .
66 .It Cm mv Ar from Ar to
67 Rename a password entry, doesn't work with directories.
68 .Ar from
69 must exist and
70 .Ar to
71 mustn't.
72 .It Cm rm Ar entries ...
73 Remove the given
74 .Ar entries
75 from the store.
76 .It Cm tee Oo Fl q Oc Ar entry
77 Persist the data read from standard input into the store under the given
78 .Ar entry
79 name and then print it again on the standard output unless the
80 .Fl q
81 option is given.
82 .El
83 .Sh ENVIRONMENT
84 .Bl -tag -width Ds
85 .It Ev PLASS_GOT
86 Path to the
87 .Xr got 1
88 executable.
89 .It Ev PLASS_GPG
90 Path to the
91 .Xr gpg 1
92 executable.
93 .It Ev PLASS_STORE
94 Alternative path to the password store directory tree.
95 .El
96 .Sh FILES
97 .Bl -tag -width Ds
98 .It Pa ~/.password-store
99 Default password store.
100 .It Pa ~/.password-store/.gpg-id
101 File containing the GPG recipient used to encrypt the passwords.
102 .El
103 .Sh EXIT STATUS
104 .Ex -std
105 .Sh EXAMPLES
106 A got repository and password store can be initialized as follows:
107 .Bd -literal -offset indent
108 $ mkdir ~/.password-store
109 $ echo foo@example.com > ~/.password-store/.gpg-id
110 $ gotadmin init ~/git/pass.git
111 $ got import -r ~/git/pass.git -m 'initial import' ~/.password-store
112 $ got checkout -E ~/git/pass.git ~/.password-store
113 .Ed
114 .Pp
115 see
116 .Xr got 1
117 for more information.
118 .Pp
119 To migrate from
120 .Xr pass 1 ,
121 delete
122 .Pa ~/.password-store
123 and check out it again using
124 .Xr got 1 .
125 .Pp
126 Generate a random password and save it to the clipboard:
127 .Bd -literal -offset indent
128 $ pwg | plass tee entry/name | xsel -b
129 .Ed
130 .Pp
131 Display the entries matching
132 .Sq key
133 arranged comfortably for reading in a terminal window:
134 .Bd -literal -offset indent
135 $ plass find key | rs
136 .Ed
137 .Pp
138 Enable tab-completion of
139 .Nm
140 command names and entries in
141 .Xr ksh 1 :
142 .Bd -literal -offset indent
143 $ set -A complete_plass_1 -- cat find mv rm tee
144 $ set -A complete_plass -- $(plass find)
145 .Ed
146 .Sh SEE ALSO
147 .Xr got 1 ,
148 .Xr gpg 1 ,
149 .Xr pwg 1
150 .Sh HISTORY
151 .Nm
152 was heavily influenced by
153 .Xr pass 1
154 in the design, but it's a different implementation that prioritizes ease
155 of use and composability.
156 .Sh AUTHORS
157 .An -nosplit
158 The
159 .Nm
160 utility was written by
161 .An Omar Polo Aq Mt op@omarpolo.com .
162 .Sh CAVEATS
163 .Nm
164 .Cm find
165 output format isn't designed to handle files containing newlines.
166 Use
167 .Xr find 1
168 .Fl print0
169 or similar if it's a concern.
170 .Pp
171 .Nm
172 .Cm mv
173 is not able to move directory trees, only file entries.
174 .Pp
175 There isn't an
176 .Cm init
177 sub-command, the store initialization must be performed manually.