Access your vault cubbyhole login items within tmux!
This plugin allows you to access your vault cubbyhole items within tmux, using vault's CLI.
This plugin relies on the following:
In any tmux mode:
prefix + u
- list login items in a bottom pane.prefix + N
- create new login item in a bottom pane.
Using Tmux Plugin Manager (recommended)
-
Add plugin to the list of TPM plugins in
.tmux.conf
:set -g @plugin 'dbd/tmux-vault'
-
Hit
prefix + I
to fetch the plugin and source it. You should now be able to use the plugin.
-
Clone this repo:
$ git clone https://github.com/dbd/tmux-vault ~/some/path
-
Source the plugin in your
.tmux.conf
by adding the following to the bottom of the file:run-shell ~/some/path/plugin.tmux
-
Reload the environment by running:
$ tmux source-file ~/.tmux.conf
On the initial use you will be prompted to login if you don't have a ~/.vault-token
file. Once
the file is created you will have no keys in the cubbyhole for that token. Credentials can be added
by running the following. Where ldap
is the key for the account, username
is the ldap
username
and password
is the ldap
password. username
is optional but password
is a required field.
read -s pass
export pass
vault write cubbyhole/ldap username=jdoe password="$pass"
unset pass
Alternatively you can use the utility helper to create new keys easily. This can be done by doing
PREFEX+U
. Note the capital u
. This open a similar pane and will prompt for the key, ldap
in the
above example, username, jdoe
, and password.
Customize this plugin by setting these options in your .tmux.conf
file. Make sure to reload the
environment afterwards.
set -g @vault-key 'x'
Default: 'u'
set -g @vault-key 'U'
Default: 'N'
set -g @vault-url 'https://vault.example.com'
Default: 'https://vault/'
set -g @vault-login-method 'ldap'
Default: 'userpass'
By default, the plugin will use send-keys
to send the selected password to the targeted pane. By
setting the following, the password will be copied to the system's clipboard, which will be cleared
after 30 seconds.
set -g @vault-copy-to-clipboard 'on'
Default: 'off'
Also see:
MIT © Yarden Sod-Moriah