item
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
Get a list of all item categories:
Use assignment statements or an item category JSON template to save details in built-in or custom fields.
Learn more about creating items.
Learn more about item fields and fieldTypes.
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.
Command arguments get logged in your command history, and can be visible to other processes on your machine. If you’re assigning sensitive values, use a JSON template instead.
For example, to create a text field named "host" within a section named "Database Credentials", with the value set to 33.166.240.221:
The section name is optional unless multiple sections contain fields with the same name.
Use a backslash to escape periods, equal signs, or backslashes in section or field names. Don’t use backslashes to escape the value.
You can omit spaces in the section or field name, or refer to the field by
its JSON short name (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
-—template
flag 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 --template
flag 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:
Create an item by duplicating an existing item from another vault and modifying it with assignment statements:
Duplicate all items in a vault in one account to a vault in another account:
item delete
Permanently delete an item.
Flags
Use the --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. Run op 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:
Move an item to the Archive:
item edit
Edit an item's details.
Flags
Specify the item by its name, ID, or sharing link. Use flags to update the title, tags, or generate a new random password.
You can use assignment statements as command arguments to update built-in or custom fields. For sensitive values, use a template instead.
Edit an item using assignment statements
Caution: Command arguments can be visible to other processes on your machine.
To create a new field or section, specify a field or section name that doesn’t already exist on the item.
To edit an existing field, specify the current section and field name, then make changes to the fieldType or value. If you don’t specify a fieldType or value, it will stay the same.
To delete a custom field, specify [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.
To edit the websites that 1Password can use to autofill a Login or Password
item's details, use the --autofill-urls
flag with URL assignment statements.
Edit an item using a template
You can use a JSON template to edit an item, alone or in combination with command arguments. Field assignment statements overwrite values in the template.
Get the item you want to edit in JSON format and save it to a file:
Edit the file.
Use the
--template
flag to specify the path to the edited file and edit the item:Delete the file.
You can also edit an item using piped input:
To avoid collisions, you can't combine piped input and the --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:
Edit a custom field's value without changing the fieldType:
Edit a custom field's fieldType without changing the value:
Edit a custom field's type and value:
Add a new custom field to an item:
Remove an existing custom field:
Set the built-in username field to an empty value:
Edit an item using a template alongside command arguments and assignment statements:
item get
Get details about an item. Specify the item by its name, ID, or sharing link.
Flags
If you have multiple items with the same name, or if you’re concerned about
API rate limits, specify the item by its ID or limit the scope of the search
with the --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:
Get a CSV list of the username, and password for all logins in a vault:
Get a JSON object of an item's username and password fields:
Get a list of fields by type:
Get an item's one-time password:
Retrieve a shareable link for the item referenced by ID:
item list
List items.
Flags
Returns a list of all items the account has read access to by default. Use flags to filter results. Excludes items in the Archive by default.
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
Examples
Get details for all items with a specified tag:
Get a CSV list of the username, and password for all logins in a vault:
Selecting a 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
To restore or permanently delete the original item, find the item in Recently Deleted in your 1Password app or on 1Password.com.
Moving an item between vaults may change who has access to the item.
Examples
Move an item from the Private vault to the Shared vault:
item share
Share an item.
Flags
You can securely share copies of passwords and other items you've saved in 1Password with anyone, even if they don't use 1Password.
When you share an item, you'll get a unique link that you can send to others.
Copy the URL, then send the link to the person or people you want to share the item copy with, like in an email or text message. Anyone with the link can view the item copy unless you specify addresses with the emails flag.
If you edit an item, your changes won't be shared until you share the item again. Note that file attachments and Document items cannot be shared.
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
You can create a new item with a template.
Run 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.
Use op item template get <category>
to get a template.