Couldn't you just use pass and have something like this in your bash script/env:
export SOME_SECRET="$(pass show some/secret)"
export SOME_SECRET="$(pass show some/secret)"
but don't put that in <shell>rc , as it a) will be visible for all other (child) processes of your shell b) will spawn pinentry everytime the agent's cache ttl expires