4

1Password Exporter to CSV so that you can import it in Bitwarden

 2 years ago
source link: https://gist.github.com/dennypradipta/f931618429881d9d16c22bd14d087c28
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
1Password Exporter to CSV so that you can import it in Bitwarden · GitHub

Instantly share code, notes, and snippets.

1Password Exporter to CSV so that you can import it in Bitwarden

#!/bin/bash

# You may need to install 1Password CLI tools first. # (https://support.1password.com/command-line-getting-started/#set-up-the-command-line-tool) # After you installed 1Password CLI tools, make sure you are logged in. # (https://support.1password.com/command-line-getting-started/#get-started-with-the-command-line-tool)

# TODO: Log in using the CLI and check if login success or not # Run eval $(op signin my) to log in into 1Password # If login success, run the command below. If not, print "Login error, exiting..."

# Create file FILE="1password-$(date "+%Y%m%d-%H%M%S").csv" if [ -f "${FILE}" ]; then echo "file already exists '$1'" exit 1 fi

# Define items to print ITEMS=$(op list items) UUIDS=($(echo "${ITEMS}" | jq '.[] | .uuid' --raw-output)) ITEMS=()

# Append the data to the file echo -ne "Exporting data (this may take a while)..." printf "title,urls,username,password\n" >> "${FILE}" for UUID in ${UUIDS[@]}; do echo -e "$(op get item "${UUID}" --fields title,url,username,password --format CSV)" >> "${FILE}" # Sleep as to not trigger rate limiter sleep 0.5 done

# And we're done! echo -e "\nData exported to ${FILE}!"


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK