Blob


1 .Dd December 31, 2023
2 .Dt GPM 1
3 .Os
4 .Sh NAME
5 .Nm gpm
6 .Nd gpg-based secret (or password) manager
7 .Sh SYNOPSIS
8 .Nm
9 .Op Fl d Ar dir
10 .Op Fl g Ar command
11 .Ar command
12 .Op Ar arg ...
13 .Sh DESCRIPTION
14 The utility
15 .Nm
16 is a secret manager.
17 Secrets are stored in a directory tree as files, encrypted with
18 .Xr gpg 1 .
19 .Nm
20 provides several commands for manipulating secrets.
21 Commands may be specified by their shortest unique prefix (all characters
22 after are ignored).
23 Commands may accept additional arguments.
24 Commands may be preceeded by global options as follows:
25 .Bl -tag -width Ds
26 .It Fl d Ar dir
27 The directory to store and retrieve secrets from.
28 Overrides
29 .Ev GPM_DIR .
30 .It Fl g Ar command
31 The
32 .Xr gpg 1
33 command.
34 Overrides
35 .Ev GPM_GPG .
36 .El
37 .Pp
38 The
39 .Nm
40 commands are as follows:
41 .Bl -tag -width Ds
42 .It Xo
43 .Cm add
44 .Op Fl m
45 .Ar name
46 .Xc
47 Create a new secret
48 .Ar name .
49 The new secret is read from stdin.
50 If used from a TTY without the
51 .Fl m
52 flag, a single line is read twice, and not echoed.
53 Otherwise, an arbitrary amount of lines is read normally once.
54 .It Cm ls
55 List existing secrets, using the command in
56 .Ev GPM_LSCMD
57 if set.
58 .It Cm mv Ar from Ar to
59 Rename secret
60 .Ar from
61 to
62 .Ar to .
63 .It Cm rm Ar name ...
64 Remove secrets specified on the command line.
65 .Nm
66 will ask for confirmation before each removal.
67 .It Cm show Ar name
68 Decrypt the secret
69 .Ar name ,
70 and print plaintext to stdout.
71 .El
72 .Sh ENVIRONMENT
73 .Bl -tag -width XDG_DATA_HOME
74 .It Ev GPM_DIR
75 Directory in which the secrets are stored.
76 .It Ev GPM_LSCMD
77 Shell command used for the
78 .Nm
79 command
80 .Cm ls .
81 .It Ev XDG_DATA_HOME
82 If
83 .Ev XDG_DATA_HOME
84 is set, but
85 .Ev GPM_DIR
86 isn't, the default secret directory is
87 .Pa $XDG_DATA_HOME/gpm .
88 .El
89 .Sh FILES
90 .Bl -tag -width Ds
91 .It Pa $HOME/.gpm
92 The default secret directory if neither
93 .Ev GPM_DIR ,
94 nor
95 .Ev XDG_DATA_HOME
96 are set.
97 .El
98 .Sh EXIT STATUS
99 .Ex -std
100 .Sh EXAMPLES
101 Tab-completion may be set, e.g. with
102 .Xr ksh 1 :
103 .Bd -literal -offset indent
104 set -A complete_gpm_1 -- add ls mv rm show
105 set -A complete_gpm -- $(gpm ls)
106 .Ed
107 .Sh SEE ALSO
108 .Xr gpg 1 ,
109 .Xr gpg2 1 ,
110 .Xr pm 1
111 .Sh AUTHORS
112 .An Alexander Arkhipov Aq Mt aa@manpager.org .