Skip to content

Instantly share code, notes, and snippets.

@joshtrichards
Last active February 22, 2023 16:57
Show Gist options
  • Save joshtrichards/a060b79001426e524a5335035f468d6f to your computer and use it in GitHub Desktop.
Save joshtrichards/a060b79001426e524a5335035f468d6f to your computer and use it in GitHub Desktop.
Some useful Bitwarden CLI entry searching/reporting tidbits

Find all entries that have integrated TOTP configured:

bw list items | jq '.[] | select(.login.totp != null)'

Calculate how many entries have integrated TOTP configured:

bw list items | jq '.[] | select(.login.totp != null)' | jq -s length

Find all entries that don't have integrated TOTP configured:

bw list items | jq '.[] | select(.login.totp == null)'

Calculate how many entries don't have integrated TOTP configured:

bw list items | jq '.[] | select(.login.totp == null)' | jq -s length

Find all entries that had their password changed since a particular date:

bw list items | jq '.[] | select(.login.passwordRevisionDate >= "2023-01-01")'

Calculate how many entries have had their password changed since a particular date:

bw list items | jq '.[] | select(.login.passwordRevisionDate >= "2023-01-01")' | jq -s length

Calculate how many entries have had their password changed in the last "X days":

DAYS_AGO=`date -d"30 days ago" +%Y-%m-%d` bw list items | jq -r --arg DAYS_AGO "$DAYS_AGO" '.[] | select(.login.passwordRevisionDate >= $DAYS_AGO)' | jq -s length

Sort all entries by revisionDate:

bw list items | jq '. |= sort_by(.revisionDate)'

Find all entries with a particular username (login):

bw list items | jq '.[] | select(.login.username == "user@domain.com")'

Find all entries that have notes specified:

bw list items | jq '.[] | select(.notes != null)'

Find all entries that have notes specified and spit out just the notes:

bw list items | jq '.[] | select(.notes != null)' | jq .notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment