Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
5 years ago[31] How to create multiple fields with same name?
Say that I want to store some account recovery codes and call them exactly that. If I do it manually in 1P app or on 1password.com, it's allowed and subsequent op item get ... returns these fields ...
Former Member
5 years agoHey again @affectiosus ,
While it is possible to create duplicate (in section and field name) fields in the 1P app and the webapp, it is not currently possible in the CLI.
The reason is because op item edit <ITEM> command will assume that if a section and field matches, it will be an overwrite instead of creating a new field, which fits most use case but not your specific one. While we don't have any plans to change this currently, I wonder if a flag such as --force-new-fields could work to create new fields even when the field already has a match. What do you think about that?
Also, is the condition of having identical section/field names mandatory for you? Otherwise I encourage you to consider adding a counter var in your for loop and adding it to the name, like:
for i in {0..10}; do
op item edit MyItem totpRecovery$i=$recoveryCode
done