dch
Developer
https://blog.agilebits.com/2017/09/06/announcing-the-1password-command-line-tool-public-beta/ I've been using this "under wraps" for 9+ months, and while it has some limitations (no easy way to search titles or content of passwords), it's super handy, assuming you've got a 1P account obviously.
Code:
$ op signin myaccount
Please enter your password for user dave@example.com at example.1password.com:
export OP_SESSION_example="fhdasjkfdst6ufdtas67fidasghjfkas78423"
# This command is meant to be used with your shell's eval function.
# Run 'eval $(op signin example)' to sign into your 1Password account.
# If you wish to use the session token itself, pass the --output=raw flag value.
$ op get item sudo | jq -r '.details.fields[] | select(.designation == "password") | .value'
_my_sudo_password_here