Skip to content

Instantly share code, notes, and snippets.

View mrantivirus's full-sized avatar
💭
Hiring!

Dennis Norton mrantivirus

💭
Hiring!
View GitHub Profile
@mrantivirus
mrantivirus / 1password_import_dotenv.sh
Last active October 31, 2023 08:38
Bash script to import dotenv files into 1Password.
#!/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."
@mrantivirus
mrantivirus / 1password_to_dotenv.sh
Created October 25, 2023 10:34
Bash script to export a 1Password item to a dotenv file
#!/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