Keeper

Install CLI client

Get the latest version and install the appropriate package:

AUTHOR='Keeper-Security'
REPO_NAME='Commander'
curl -s "https://api.github.com/repos/${AUTHOR}/${REPO_NAME}/releases/latest" \
  | jq -r '.assets[].browser_download_url'

Login to Keeper

Run this command:

keeper login

When prompted, enter your email, then your TOTP, and finally your master password.

Resource: https://docs.keeper.io/secrets-manager/commander-cli/using-commander/logging-in

Get a password using its name

This particular example will return the password for the entry called gmail.com in the vault:

My Vault> find-password gmail.com

Programmatically get password

This will allow you to get a credential without accessing the keeper shell:

keeper find-password gmail.com

You can find the options you can include for the config.json file here.

Resources: https://docs.keeper.io/secrets-manager/commander-cli/using-commander/command-reference/record-commands https://docs.keeper.io/enterprise-guide/user-and-team-provisioning/cli-provisioning-with-commander-sdk

Useful dotfile alias

KEEPER_EMAIL='your_email@email_provider.com'
pushd "${HOME}/.keeper"
# If we're logged in, get the Password/My Password credential
if [[ ! "$(echo 'n' | keeper login ${KEEPER_EMAIL} | grep -i 'not logged in')" ]]; then
    alias my_pw="keeper find-password 'Password/My Password' | pbcopy"
fi
popd

LastPass

Login to LP

To get started, you have to login:

lpass login <your email address>

Look for passwords matching a string

lpass show stringtomatch

Get a password

This will grab a password from LastPass via the cli.

lpass show folder_name/name_of_password \
  | grep -i password | awk -F ': ' '{print $2}'