Skip to content

Instantly share code, notes, and snippets.

@claui
Created October 23, 2025 08:24
Show Gist options
  • Save claui/fa8a8a65743e6406094bf21d52cf6c6f to your computer and use it in GitHub Desktop.
Save claui/fa8a8a65743e6406094bf21d52cf6c6f to your computer and use it in GitHub Desktop.
op-vault-client
#!/bin/bash
set -eu -o pipefail
if [ "${SKIP_VAULT_PASSWORD:-0}" -ne '0' ]; then
printf '\0'
exit 0
fi
if [ "$(op --version | cut -d . -f 1)" -le '1' ]; then
set -- op get item
elif [ "$(op --version | cut -d . -f 1)" -eq '2' ] \
&& [ "$(op --version | cut -d . -f 2)" -lt '30' ]
then
set -- op item get
else
set -- op item get --reveal
fi
exec "$@" --vault=?????? \
?????? --fields password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment