Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
4 years agoHow to load content from file using yaml template?
So, I've been trying to work around based on https://developer.1password.com/docs/cli/secrets-config-files#step-1-create-secret-references link.
My idea is to have a file on 1Password like:
ya...
andi_t_1P
1Password Team
4 years agoHi @matheushent, thanks for reaching out. If I understood your question correctly, the CLI allows for creation of items from a template file using either piping or passing a file path to the command's --template flag, under the condition that the file has json format (so yaml is not currently supported for creation - nor editing for that matter). To achieve this, use: op item create --template myFile. To get a sense of how myFile should look like, use op item template get Login, for instance. The piped version of this command should then go like this op item template get Login | op item create --vault Private -. If you need a way to replicate nested fields like in yaml, you could make use of an item's section/field structure. If you need more than 2 nested fields this would no longer suit your needs, and what I would do is straight up attach a yaml file to my item or create a document type item with a yaml file.
Let me know if this answers your question.
Best,
Andi