How can I save environment variables (sensitive) in gopass and retrieve them and set in my bash terminal them from command line.
I know this can be done in 1password where the password are stored:
myaccount
- key1 - value1
- key2 - value2
- key3 - value3
Internally this is in json format and can be pull with a command like:
op get item "myaccount" | jq .
source <(op get item ${1} | jp -r --arg key2 "${2} '.details.section[] |
select(.title==$title) | .fields[0].v' | base64 -D ")
The whole idea is my environment variables must be set in a automate way from a secure vault rather than me exporting them like this:
export key1=value1
export key2=value2
export key3=value3
This is a bit of a late answer, but you could save them into gopass like this:
Or if you need them to be base64 ecoded:
Then you could source them still using
export
, but sourcing them from gopass, rather than hard coding them.