This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1password_to_dotenv.sh | |
# Script to fetch fields from a 1Password item and save them as dotenv entries with secret references. | |
# Ensure `op` is logged in | |
if ! op user get --me >/dev/null 2>&1; then | |
echo "You need to sign in to op (1Password CLI) first." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to display help information | |
function display_help() { | |
echo "Usage: $0 [dotenv_path] [item_name] [-v vault_name] [-s section_name]" | |
echo "" | |
echo "dotenv_path: Path to the dotenv file." | |
echo "item_name: Name of the 1Password item." | |
echo "Optional Parameters:" | |
echo " -v vault_name: Name of the vault in 1Password." |