.\" Copyright (c) 2021, 2022 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 October 1, 2022 .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 .Pq or Ev PLASS_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 is optional. .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 find Op Ar pattern Print the entries of the store one per line, optionally filtered by .Ar pattern . .It Cm gen Oo Fl nq Oc Oo Fl c Ar chars Oc Oo Fl l Ar length Oc Ar entry Generate and persist a password for the given .Ar entry in the store. .Fl c can be used to control the characters allowed in the password (by default .Dq !-~ i.e. all the printable ASCII characters) and .Fl l the length .Pq 32 by default . Unless the .Fl q flag is provided, print the generated password. If the .Fl n flag is given the password won't be persisted and the .Ar entry argument is optional. .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 Prompt for a password and persist it into the store under the given .Ar entry name and the print it again on the standard output unless the .Fl q option is given. .El .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev PLASS_CHARS default range of characters to use to generate passwords. .It Ev PLASS_GOT Path to the .Xr got 1 executable. .It Ev PLASS_GPG Path to the .Xr gpg 1 executable. .It Ev PLASS_LENGTH Default length for the generated passwords. .It Ev PLASS_STORE Path to the password store directory tree. .El .Sh FILES .Bl -tag -width Ds .It Pa ~/.password-store Password store used by default. .It Pa ~/.password-store/.gpg-id File containing the GPG recipient used to encrypt the passwords. .El .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 To generate a temporary random password use .Bd -literal -offset indent $ plass gen -n .Ed .Sh SEE ALSO .Xr got 1 , .Xr gpg 1 , .Xr pass 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 a .Cm init sub-command, the store initialization must be performed manually.