I found what seems to be a flaw in the CLI software which appears to be a show-stopper for my effort to write CLI utility scripts (https://discussions.agilebits.com/discussion/90284/utility-scripts-for-the-cli).
The basic principle of my procedure is to use
op list items and search for uuid's in order to see whether any given item exists outside of the Trash.
However, this methodology falls apart in the following manner:
Suppose I delete all the entries in my vault and then create a new secure note with the title "abcdefg" via
op create item "Secure Note" ..., and suppose its uuid is "7i7gmvbmbemnmygkf2njchhf6a".
After doing this, I can do an
op get item "abcdefg", and it correctly shows uuid="7i7gmvbmbemnmygkf2njchhf6a".
Furthermore, I can do an
op list items, and it also shows uuid="7i7gmvbmbemnmygkf2njchhf6a".
Then, if I do an
op create item "Secure Note" ... with the same title and different data followed by
op delete item "7i7gmvbmbemnmygkf2njchhf6a", the original item properly goes into Trash.
Then, I can do an
op get item "abcdefg", and it shows a new uuid, for example, "snj266t5yytufjprfmr63k574y". Doing an
op list items also shows this new uuid, and the Trashed item does not appear in that list ... and when I go to the 1Password web site, I indeed see that one deleted item in the Trash.
So far, so good. However, if I repeat this process, this is where the problem occurs.
If I once again do an
op create item "Secure Note" ... with the same title and different data, doing an
op get item "abcdefg" indeed shows a new uuid, for example, "olmjqwedln6drvfcardbjt3ldy". But now, if I follow that with
op delete item "snj266t5yytufjprfmr63k574y" and an
op list items, the
op list items still shows a single entry with "snj266t5yytufjprfmr63k574y" as the uuid, even though
op get item "abcdefg" shows the new uuid="olmjqwedln6drvfcardbjt3ldy".
op get list seems to occur when there are two or more items in the Trash with the same title, and if that is the same title of an already-existing, non-Trashed Secure Note.
If I then go and manually empty the Trash, the problem goes away, and once again,
op list items and
op get item "abcdefg" are back in sync.
Because of this inconsistent
op get list behavior, my methodology cannot be utilized.
I'm now stopping work on my CLI utility scripts, and I will wait until enough CLI issues get fixed so I can go forward with this effort again.
Again, I think that if we were simply provided with some way to empty the Trash via the CLI, I could then write all these scripts and they would work more reliably.
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided