A command-line tool for exporting a 1Password item to a CSV file along with any attachments on the item. This tool helps you securely export and optionally encrypt your 1Password item for backup or migration purposes.
- This tool has been tested on macOS. It may work on other Unix-like systems, but Windows users may need to modify the script for compatibility.
- The tool was tested with 1Password CLI version 2.30.3 and Python 3.12.0.
- 1Password records with attachments were used for testing. These are records that contain files or images attached to them directly inside the record.
- Export any 1Password item to a CSV file
- Download all attachments associated with the item
- Create an organized directory structure for exported data
- Optionally encrypt the exported data into a password-protected ZIP file
- Optionally wipe the original unencrypted data after encryption
- Verify 1Password CLI compatibility
- Python 3.12 or higher
- 1Password CLI (version 2.30.3 or higher)
- 1Password account with valid session
-
Clone this repository:
git clone https://github.com/ericwastaken/1password-export.git cd 1password-export
-
Run the bootstrap script to set up the Python environment:
./x_bootstrap.sh
This script will:
- Check for Python 3.12+
- Check for 1Password CLI 2.30.3+
- Create a virtual environment
- Install required dependencies
-
If you don't have the 1Password CLI installed, you can get it from: 1Password CLI Downloads
./export-1password-item.py [--verbose] [--encrypt] [--wipe] "<item_id_or_title>"
--verbose
: Show detailed output and the entire item JSON. NOTE: This option WILL output sensitive record data to the console!--encrypt
: Encrypt the exported directory into a password-protected ZIP file--wipe
: Delete the original directory after encryption (only valid with--encrypt
)<item_id_or_title>
: The ID or title of the 1Password item to export
The tool creates the following directory structure:
output/
<sanitized_item_title>/
_1password_item.csv
<attachment1>
<attachment2>
...
If encryption is enabled, it will create:
output/
<sanitized_item_title>.zip # Password-protected ZIP file
Export a 1Password item by its title:
./export-1password-item.py "My Important Password"
Export and encrypt the data:
./export-1password-item.py --encrypt "My Important Password"
You will be prompted to enter and confirm an encryption password.
For maximum security, export, encrypt, and remove the unencrypted data:
./export-1password-item.py --encrypt --wipe "My Important Password"
For debugging or to see all item details:
./export-1password-item.py --verbose "My Important Password"
Note: This argument will cause the output of sensitive data to the console. Use with caution!