HOWTO: Sort BitWarden Passwords by Date
I highly recommend BitWarden as a password manager. It is free, open source, and has a great range of apps and APIs.
The one thing it doesn't have is a way to sort your accounts by creation date. I now have over a thousand accounts that I've added - so I wanted to prune away some of the older ones.
So, here's how to do it.
Export your vault
In the desktop version of BitWarden, go to File → Export Vault. Choose the JSON format (this doesn't work for CSV) and follow the on-screen instructions.
NOTE! This will save all of your passwords to disk. Do not do this on a shared machine. Delete the file as soon as you are done with it.
Sort with JQ
Using the jq
utility it is possible to search and sort the exported JSON.
This command pipes your export to JQ. It selects all the items
, then it sorts by when the item was last edited. It then displays the name of the account and the date, followed by a newline.
cat bitwarden.json | jq -r '.items | sort_by(.revisionDate) | .[] | .name, .revisionDate, " " '
Purge!
You could use the API to delete items based on their ID. Personally, I'd rather go through manually.
What's next?
It would be great if BitWarden allowed sorting by date in their UI. Even better if they could sort by usage. Until then, I'll spend every Valentine's Day manually deleting old and unloved accounts.
Anonymous says:
@blog This can also be done with their node.js command line version (https://www.npmjs.com/package/@bitwarden/cli)
Advantage that you can stream the output directly rather than leaving a plain file lying around.
Conor O'Neill said on mastodonapp.uk:
@Edent
As you say, it would be lovely if #Bitwarden could sort your vault entries by date (eg date password last changed?) and/or last used.
I used to use LastPass. One of their nice features was to be able to sort the entries by password score (ie complexity). That made it very easy to find old passwords which needed to be updated.
Bitwarden devs - are you listening at all?
#PasswordManager bitwarden passwordmanager
Owen Blacker says:
I would suggest using
shred -un 9 filename.json
if you're on a Mac or another Unix-like system. Git Bash also comes withshred
for Windows users.More comments on Mastodon.