mcjones.ca

1Password CLI Snippets

Password generated elsewhere

op item create \
--category login \
--title "TITLE" \
--vault "VAULT NAME" \
password="Password"

NOTE: Not recommended since this stores it in your history and other places. Using JSON files or having 1Password generated is the correct way (versus the quick and dirty for a temp password way).

The password/field values are found by looking at the template:

op item template get Login

And then assigned with assignment statements (see https://developer.1password.com/docs/cli/item-create/#with-assignment-statements)

1Password generates the password

op item create \
--category login \
--title "TITLE" \
--vault "VAULT NAME" \
--generate-password='letters,digits,symbols,32'

https://developer.1password.com/docs/cli/item-create/