Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years agoHow do I create/attach a File Field to an existing item using the 1Password CLI
Trying to automate a workflow and was wondering how to use the 1Password CLI to attach/upload a File Field to an existing item. See uploaded picture with the file depicted. Any help would be much a...
1P_Simon
1Password Team
4 years agoHi oliverroos, you're correct that it is not supported to attach file fields to document type items via the CLI at this time.
Document type items are currently only supported in the separate op document create
command and adding file fields is only supported in op item create
.
I'll file a feature request to add support for attaching file fields to Document type items via the CLI as well. Probably easiest to merge op document create
and op item create
(and similarly for edit
).
In the meantime, here's an example how you can attach file fields to any other type of item:
echo "Hello from Simon" > hello.txt && op item create --title "Greeting" --category SecureNote "greeting[file]=hello.txt" && rm hello.txt