Skip to content

Instantly share code, notes, and snippets.

@falexandrou
Created September 9, 2025 21:19
Show Gist options
  • Save falexandrou/854874bca638ebaf107066991953c4ac to your computer and use it in GitHub Desktop.
Save falexandrou/854874bca638ebaf107066991953c4ac to your computer and use it in GitHub Desktop.
Get Sensitive configuration from 1Password
#!/bin/bash
if ! command -v op &>/dev/null; then
echo "Error: 1password-cli (op) is not installed or not available in PATH" >&2
exit 1
fi
eval $(op signin)
op document get "SSH Config file" --output ~/.ssh/config --force
op document get "Private SSH key" --output ~/.ssh/id_ed25519 --force
op document get "Public SSH key" --output ~/.ssh/id_ed25519.pub --force
op document get "AWS Config file" --output ~/.aws/config --force
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment