Subcommands
- item create: Create an item
- item delete: Delete or archive an item
- item edit: Edit an item’s details
- item get: Get an item’s details
- item list: List items
- item move: Move an item between vaults
- item share: Share an item
- item template: Manage templates
item create
Create a new item.Flags
Generate a password
Use the--generate-password option to set a random password for a Login
or Password item. The default is 32-characters, and includes upper and
lowercase letters, numbers, and symbols (!@.-_*).
You can specify the password length (between 1 and 64 characters) and the
character types to use:
Set additional fields with assignment statements
You can use assignment statements as command arguments to set built-in and custom fields.name or n).
Create an item using a json template
Use an item JSON template to assign sensitive values to an item. If you combine a template with assignment statements, assignment statements take precedence.-
Save the appropriate item category template to a file:
- Edit the template.
-
Create a new item using the
-—templateflag to specify the path to the edited template: -
After 1Password CLI creates the item, delete the edited template.
You can also create an item from standard input using an item JSON template.
Pass the
-character as the first argument, followed by any assignment statements.You can’t use both piping and the--templateflag in the same command, to avoid collisions.
Examples
Create a Login item with a random password and website set using flags and custom and built-in fields set with assignment statements, including a one-time password field and a file attachment:item delete
Permanently delete an item.Flags
--archive option to move it to the Archive instead.
An item may be specified by its name, ID, or sharing link.
Specify items on standard input
The command treats each line of information on standard input (stdin) as an object specifier. Runop help to learn more about how to specify
objects.
The input can also be a list or array of JSON objects. The command will
get an item for any object that has an ID. This is useful for
passing information from one op command to another.
Examples
Permanently delete an item:item edit
Edit an item’s details.Flags
Edit an item using assignment statements
Caution: Command arguments can be visible to other processes on your machine.[delete] in place of the fieldType. If a
section no longer has any fields, the section will also be deleted. You can’t
delete built-in fields, but you can set them to empty strings.
Learn more about assignment statements: op item create –-help.
Learn more about available fields and fieldTypes.
Edit an item using a template
JSON item templates do not support passkeys. If you use a JSON template to update an item that contains a passkey, the passkey will be overwritten. To fix this, you can restore a previous version of the item.
-
Get the item you want to edit in JSON format and save it to a file:
- Edit the file.
-
Use the
--templateflag to specify the path to the edited file and edit the item: op item edit oldLogin —template=updatedLogin.json -
Delete the file.
You can also edit an item using piped input:
--template
flag in the same command.
Examples
Add a 32-character random password that includes upper- and lower-case letters, numbers, and symbols to an item:item get
Get details about an item. Specify the item by its name, ID, or sharing link.Flags
--vault flag.
Learn more about IDs and caching.
To retrieve the contents of a specific field, use op read instead.
When using service accounts, you must specify a vault with the --vault flag
or through piped input.
Specify items on standard input
op item get treats each line of information on standard input (stdin) as an
object specifier.
You can also input a list or array of JSON objects, and the command will get an
item for any object that has an ID key. This is useful for passing information
from one command to another.
Items in the archive
Items in the Archive are ignored by default. To get details for an item in the Archive, specify the item by ID or use the--include-archive option.
Examples
Get details for all items with a specified tag:item list
List items.Flags
- API Credential
- Bank Account
- Credit Card
- Database
- Document
- Driver License
- Email Account
- Identity
- Login
- Membership
- Outdoor License
- Passport
- Password
- Reward Program
- Secure Note
- Server
- Social Security Number
- Software License
- Wireless Router
Examples
Get details for all items with a specified tag:<tag> will also return items with tags sub-nested to <tag>. For example: <tag/subtag>.
item move
Move an item between vaults. Moving an item creates a copy of the item in the destination vault and deletes the item from the current vault. As a result, the item gets a new ID.Flags
Examples
Move an item from the Private vault to the Shared vault:item share
Share an item.Flags
item template
Subcommands
- item template get: Get an item template
- item template list: Get a list of templates
item template get
Return a template for an item type.Flags
op item create --help for more information.
Categories are:
- API Credential
- Bank Account
- Credit Card
- Database
- Document
- Driver License
- Email Account
- Identity
- Login
- Membership
- Outdoor License
- Passport
- Password
- Reward Program
- Secure Note
- Server
- Social Security Number
- Software License
- Wireless Router
item template list
Lists available item type templates.op item template get <category> to get a template.