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

# Store the email associated with keeper here
keeper_email=your_email@email_provider.com
if [[ "$(echo 'n' | keeper)" ]]; then
    # Get gmail password and store in clipboard
    alias gmail_pw="keeper --find-password gmail.com | pbcopy"
else
    # You're not logged in, so we will start that process
    keeper login "${keeper_email}"
fi

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}'