Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
Former Member
3 years agoHow to load content from file using yaml template?
So, I've been trying to work around based on this link.
My idea is to have a file on 1Password like:
yaml
db:
username: blabla
password: iamasecret
api:
whatever: whenever
...
andi_t_1P
1Password Team
3 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