Forum Discussion
Hi suchademon ,
I also have this problem. I found a solution. It was a variation on what the pubs suggested. The trick is to enclose the empty tags statement in single quotes.
Example:
op item edit "ZZZ Test DELETEABLE" 'tags='
Below I provide a longer version of a console log showing the same approach. The original Password item has 4 tags, picked at random. Please note the following:
- I use the
op read
feature to quickly read the tags in the CLI - I was able to verify this solution in other more rigorous code (not shown)
```
/tmp/experiment1 % op item get "ZZZ Test DELETEABLE" --format json
{
"id": "muy2lvljbycgtto5dg7ddh77gu",
"title": "ZZZ Test DELETEABLE",
"tags": ["estimate", "murky", "twiddling", "wicked"],
"version": 3,
"vault": {
"id": "nlv4anz4x763hlyyp42hdjzzbm",
"name": "Private"
},
"category": "PASSWORD",
"created_at": "2024-06-21T16:19:15.98229-05:00",
"updated_at": "2024-06-21T16:19:18.22646-05:00",
"additional_information": "Fri Jun 21 16:19:15 CDT 2024",
"fields": [
{
"id": "password",
"type": "CONCEALED",
"purpose": "PASSWORD",
"label": "password",
"value": "handclasp whacky herbal eastern",
"reference": "op://Private/ZZZ Test DELETEABLE/password",
"password_details": {
"strength": "FANTASTIC"
}
},
{
"id": "notesPlain",
"type": "STRING",
"purpose": "NOTES",
"label": "notesPlain",
"reference": "op://Private/ZZZ Test DELETEABLE/notesPlain"
},
]
}
/tmp/experiment1 % op signin && op read "op://Private/ZZZ Test DELETEABLE/tags"
estimate, murky, twiddling, wicked
/tmp/experiment1 % op item edit "ZZZ Test DELETEABLE" 'tags='
ID: muy2lvljbycgtto5dg7ddh77gu
Title: ZZZ Test DELETEABLE
Vault: Private (nlv4anz4x763hlyyp42hdjzzbm)
Created: 22 minutes ago
Updated: now
Favorite: false
Version: 4
Category: PASSWORD
Fields:
password: handclasp whacky herbal eastern
/tmp/experiment1 % op signin && op read "op://Private/ZZZ Test DELETEABLE/tags"
/tmp/experiment1 %
```