1Password Command Line Cheat Sheet

Installation

Download the right version from https://app-updates.agilebits.com/product_history/CLI

wget https://cache.agilebits.com/dist/1P/op/pkg/v1.8.0/op_darwin_amd64_v1.8.0.pkg
installer -pkg op_darwin_amd64_v1.8.0.pkg -target CurrentUserHomeDirectory

First Time

op signin aranix.1password.com obay@aranix.com
export OP_SESSION_aranix="RAWWO8X8g_xR6JB_2W9c3bJicE7yoXNKDIEOapIXNNc"

Login (Every Session)

eval $(op signin aranix)

Sign Out

op signout

Get a Password from an Entry

op get item "CompanyTone - HashiCorp Vault" | jq -r ".details.fields[1].value"
op get item "CompanyTone - HashiCorp Vault" | jq -r '.details.fields[] | select(.designation=="password").value'

Create new Password

op create item login $(op get template login | jq -c '.fields[0].value = "GoodGuy"' | jq -c '.fields[1].value = "my secret"' | op encode) --title "My New Item"