Gregg's MOTD

Tips & Tricks that I've Encountered Over the Years...

Parsing Bitwarden CLI

June 15, 2023 — Gregg Szumowski

If you use the excellent Bitwarden app for you password storage you may not be aware that they also have a command line version on Linux. It outputs data using the JSON format. You can install the jq JSON parser and pipe the output of the CLI’s query to it in order to extract the username and password for a specific site in your search:

$ bw list items --search accounts.google.com | jq '.[] | .login.uris[].uri,.login.username,.login.password'
"https://accounts.google.com"
"john.doe@gmail.com"
"** password1 **"
"https://accounts.google.com"
"jdoe@gmail.com"
"** password2 **"

Tags: cli, bitwarden, json, password-managers, motd