Skip to content

Instantly share code, notes, and snippets.

View ewa's full-sized avatar

Eric Anderson ewa

View GitHub Profile
@ewa
ewa / delete_duplicate_bitwarden_items.py
Last active September 24, 2023 14:36 — forked from jwmcgettigan/bitwarden_duplicate_cleaner.py
Use the BitWarden command-line client to purge duplicate entries from your vault. NOTE: this is my one-time-use variant, and the original has been improved significantly since I forked it, so you should probably look there.
#!/usr/bin/env python3
# This script will pull all of your vault 'items' using the 'bw list items' command and then it will compare
# all properties that are not inherently unique from the returned JSON to determine if they are duplicates.
# Note: It removes older duplicates first - the newest copy of the 'item' will be the only one to remain.
# You can simply flip the '>' sign to '<' if you want to preserve the oldest 'item' instead.
#
# Setup Steps
# 1. You must install Bitwarden CLI first: https://bitwarden.com/help/cli/#download-and-install
# 2. Login to the CLI with the 'bw login' command. You need your session key setup before continuing: https://bitwarden.com/help/cli/#using-a-session-key