op account list
op whoami
op signin
op signin --account my # account flag must be passed subset of the URL from `op account list` (e.g. `my` matches `my.1password.com`)
op vault list --format json
op item list --vault "Private" --format json
op item get "Your Item Title" --vault "Private" --format json
op item get "Your Item Title" --vault "Private" --fields password --reveal
e.g. an application config file or even an environment variable exported as part of a shell script.
format:
op://<VAULT_NAME>/<ITEM_NAME>/<FIELD>
you can easily get the reference to any field using the 1Password GUI.
op read "op://Private/Fastly API Tokens/Integralist-PersonalAllServices/Token"
op inject -i some_input_file.tpl -o the_output_file_with_secret
export FASTLY_API_TOKEN=$(op read "op://Private/Fastly API Tokens/Integralist-PersonalAllServices/Token")
export FASTLY_API_TOKEN=$(echo "op://Private/Fastly API Tokens/Integralist-PersonalAllServices/Token" | op inject)
curl -sX GET "https://api.cloudflare.com/client/v4/user/tokens/verify" -H "Authorization: Bearer $(op read 'op://Private/6bky6ykumav2wfpguwn4dokcku/API Token')" -H "Content-Type:application/json" | jq
curl -sX GET "https://api.cloudflare.com/client/v4/user/tokens/verify" -H "Authorization: Bearer $(echo 'op://Private/6bky6ykumav2wfpguwn4dokcku/API Token' | op inject)" -H "Content-Type:application/json" | jq
Note
When entering a title for a 1Password entry, the use of a :
will cause the "Copy Secret Reference" feature to use a cryptic hash instead of a descriptive name.
If you want to find the entry this secret reference is related to, then you can search in 1Password using the hash, but from a documentation perspective I much prefer the "descriptive" version.