Sign in
op signin
Sign in (prompts only if needed)
eval $(op signin --account <shorthand>)
Sign in, set session in this shell
Needed only without the desktop app integration.
op whoami
Show the signed-in account
op account list
List configured accounts
op account add --address <host>
Add an account
op signin --raw
Print only the session token
op update
Check for a new CLI version
op completion <shell>
Generate shell completions
Items
op item list --vault <vault>
List items in one vault
op item list --categories Login
Filter by category
op item list --tags <tag>
Filter by tag
op item get <item>
Show item details
op item get <item> --fields label=password
Print one field
op item get <item> --otp
Current one-time password
op item get <item> --format json
Full item as JSON
op item get <item> --share-link
Get a share link
op item create --category login --title <title>
Create a login item
op item create ...
--generate-password=20,letters,digits
Create with a generated password
op item create ... <field>=<value>
Set a field on create
Section fields use
<section>.<field>=<value>.
op item create --template <file.json>
Create from a JSON template
op item edit <item> <field>=<value>
Change a field
op item edit <item> --generate-password
Regenerate the password
op item edit <item>
'<section>.<field>[delete]'
Delete a custom field
op item edit <item> --tags
<t1>,<t2>
Set tags
op item delete <item>
Delete an item
Stays in Recently Deleted for 30 days.
op item delete <item> --archive
Archive instead of delete
op item move <item> --current-vault <a>
--destination-vault <b>
Move to another vault
Creates a copy with a new item ID.
op item share <item> --emails <addr>
--view-once
Share by link
op item template list
List item categories
op item template get <category>
Get a category's JSON template
Secret references
op read op://<vault>/<item>/<field>
Print a secret
op read
op://<vault>/<item>/<section>/<field>
Read a field in a section
op read "op://<vault>/<item>/one-time
password?attribute=otp"
Read the current OTP
op read "op://<vault>/<item>/private
key?ssh-format=openssh"
SSH key in OpenSSH format
op read -o <file>
op://<vault>/<item>/<field>
Write a secret to a file
File mode defaults to 0600.
op read -n
op://<vault>/<item>/<field>
No trailing newline
Run and inject
op run -- <cmd>
Run with env var references resolved
op run --env-file=<file> -- <cmd>
Resolve references from a .env file
op run --no-masking -- <cmd>
Show secrets in command output
Output is masked by default.
op run --environment <id> -- <cmd>
Load a 1Password Environment
Environments are in beta.
op inject -i <tpl> -o <out>
Fill a template into a file
op inject -i <tpl> -f -o <out>
Overwrite without asking
op inject --file-mode 0640 -i <tpl> -o
<out>
Set output permissions
cat <tpl> | op inject
Fill a template from stdin