0.2.1 • Published 6 years ago
vaultp v0.2.1
vaultp - VAULT Profile Switcher
Switch Vault profile easily
Preparation
Setup your profile in ~/.vault/config (create folder if not exists)
config example:
{
"default": {
"address": "https://vault.example.com",
"token": "toke1"
},
"profile2": {
"address": "https://vault2.example.com",
"token": "toekn2"
}
}Setup
npm install -g vaultpAdd the following to your .bashrc or .zshrc config
alias vaultp="source _vaultp"Usage
vaultpor
vaultp defaultShell prompt
function vault_prompt {
local profile="${VAULT_PROFILE:=default}"
echo "%{$fg_bold[blue]%}vault:(%{$fg[yellow]%}${profile}%{$fg_bold[blue]%})%{$reset_color%} "
}PROMPT='OTHER_PROMPT_STUFF $(vault_prompt)'