Hi,
I've added two useful features to kpcli:
- the ability to run a single command ("eval") instead of starting the interactive ui
- the possibility of reading a master password from a file instead of the console
Both of these allow me to use kpcli to automatically retrieve secrets from a kdb file like so:
getsecret() {
local keydb="$KEYDB"
local path="$1"; shift
local password=""
read -sp "Enter master password to unlock '$keydb': " password
echo "" > /dev/tty
echo $password | kpcli --readonly --kdb "$keydb" --passwdfile=/dev/fd/0 --eval "show -f \"$path\"" | awk '/Pass:/ { print $2; }'
}
The patch is applied, if you like it please include it in the upstream code so others can use it too.
Regards,
Maciej Grela
I don't understand what you added that did not already exist in version 3.1 via --pwfile and --command, the --help typo in --pwfile notwithstanding (which will be fixed in 3.2):
Last edit: Lester Hightower 2017-02-12
Having heard no follow up on this, closing.