password-menu is a UI wrapper (“porcelain”) for the built-in Emacs auth-source
secrets library. This package allows you to display auth-source entries in the
minibuffer with either completing-read
or transient
. The password for the
selected entry is copied to the kill ring and system clipboard and automatically
removed later.
If you use MELPA, an easy way to install this package is via
package-install
. Alternatively, download password-menu.el
, put it in
your load-path
and require
it.
If you use both MELPA and use-package
, you can use this, too:
(use-package password-menu
:ensure t)
(global-set-key (kbd "C-x j") 'password-menu-transient)
(global-set-key (kbd "C-x J") 'password-menu-completing-read)
Doom configuration
;;...
(package! password-menu)
;;...
These can be added to config.el
as shown above.
- I have only tested this with Emacs 29.1.
- Testing of the
auth-source
backends was limited to only authinfo.gpg.
Menu item entries are formatted with user@host
.
M-x password-menu-transient
This uses a one or two character keyboard selection of entries (transient
prefix). Since the prefix ordering always matches that of the source, this
method is better suited for the use of repeatable discreet key sequences, for
example C-x j 3
.
M-x password-menu-completing-read
Entries are found by scrolling through or searching the list. This is likely preferable when the list is long.
Copied password for rnadler@github.com to the kill ring and system clipboard. Will clear in 45 seconds.
Here are the variables that can be customized:
Variable | Default | Desc. |
---|---|---|
password-menu-time-before-clipboard-restore | 45 | Number of seconds to wait before restoring the clipboard. Can also be set with the PASSWORD_MENU_CLIP_TIME environment variable. |
password-menu-prompt | “Get password for: ” | Menu prompt string. |
password-menu-sources-max | 100 | Maximum number of sources to find. |