.\" Copyright (c) 2022, 2023 Omar Polo .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .Dd January 2, 2023 .Dt PLASS 1 .Os .Sh NAME .Nm plass .Nd manage passwords .Sh SYNOPSIS .Nm .Op Fl h .Ar command .Op Ar argument ... .Sh DESCRIPTION .Nm is a simple password manager. Passwords are stored as a directory tree where every password is a file encrypted with .Xr gpg 1 . .Pp A password store is a .Xr got 1 repository with a worktree checked out at .Pa ~/.password-store . The only restriction is that a special file called .Pa .gpg-id containing the GPG recipient must exist in the root of the directory tree for most .Nm commands to work. .Pp Password entries can be referenced using the path relative to the store directory. The file extension .Dq \&.gpg can be omitted. .Pp .Nm provides global and command-specific options. Global options must precede the command name, and are as follows: .Bl -tag -width Ds .It Fl h Display usage information and exit immediately. .El .Pp The following commands are available: .Bl -tag -width Ds .It Cm cat Ar entries ... Decrypt and print the content of .Ar entries in the given order. .It Cm edit Ar entry Modify the content of the given .Ar entry using an editor. .It Cm find Op Ar pattern Print the entries of the store one per line, optionally filtered by the case-insensitive .Ar pattern . .It Cm mv Ar from Ar to Rename a password entry, doesn't work with directories. .Ar from must exist and .Ar to mustn't. .It Cm rm Ar entries ... Remove the given .Ar entries from the store. .It Cm tee Oo Fl q Oc Ar entry Persist the data read from standard input into the store under the given .Ar entry name and then print it again on the standard output unless the .Fl q option is given. .El .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev PLASS_GPG Path to the .Xr gpg 1 executable. .It Ev PLASS_STORE Alternative path to the password store directory tree. .It Ev VISUAL , Ev EDITOR The editor spawned by .Nm .Cm edit . If not set, the .Xr ed 1 text editor will be used in order to given it the attention it deserves. .El .Sh FILES .Bl -tag -width Ds .It Pa ~/.password-store Default password store. .It Pa ~/.password-store/.gpg-id File containing the GPG recipient used to encrypt the passwords. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES A got repository and password store can be initialized as follows: .Bd -literal -offset indent $ mkdir ~/.password-store $ echo foo@example.com > ~/.password-store/.gpg-id $ gotadmin init ~/git/pass.git $ got import -r ~/git/pass.git -m 'initial import' ~/.password-store $ got checkout -E ~/git/pass.git ~/.password-store .Ed .Pp see .Xr got 1 for more information. .Pp To migrate from .Xr pass 1 , delete .Pa ~/.password-store and check out it again using .Xr got 1 . .Pp Generate a random password and save it to the clipboard: .Bd -literal -offset indent $ pwg | plass tee entry/name | xsel -b .Ed .Pp Display the entries matching .Sq key arranged comfortably for reading in a terminal window: .Bd -literal -offset indent $ plass find key | rs .Ed .Pp Enable tab-completion of .Nm command names and entries in .Xr ksh 1 : .Bd -literal -offset indent $ set -A complete_plass_1 -- cat edit find mv rm tee $ set -A complete_plass -- $(plass find) .Ed .Sh SEE ALSO .Xr got 1 , .Xr gpg 1 , .Xr pwg 1 .Sh HISTORY .Nm was heavily influenced by .Xr pass 1 in the design, but it's a different implementation that prioritizes ease of use and composability. .Sh AUTHORS .An -nosplit The .Nm utility was written by .An Omar Polo Aq Mt op@omarpolo.com . .Sh CAVEATS .Nm .Cm find output format isn't designed to handle files containing newlines. Use .Xr find 1 .Fl print0 or similar if it's a concern. .Pp .Nm .Cm mv is not able to move directory trees, only file entries. .Pp There isn't an .Cm init sub-command, the store initialization must be performed manually.