Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
3 years ago1P Zsh plugins no loading for shell script
Is there a documented way to make sure the 1P plugins load when invoking a shell script?
I use Zsh and have source d the plugins on shell load such that this works fine in an interactive window: ...
jinux_go
2 years agoOccasional Contributor
@"Horia.Culea_1P" I hope 1Password adds this feature as fast as possible! I don't know how much the work has gone through, but would you mind if you could share what use cases the new feature covers? Is 1Password's "proxy" command intended to be used only in shell scripts or in any executable programs? I wish for the second that gives users options.
I suggest the following approach: allow users to specify the desired plugin to use and the exact binary file path, like this op plugin run --target aws -- /opt/homebrew/bin/aws
. Users deserve more control over what to use.
Here is my current workaround for now (aws
as an example). Put this script file into the one of entries in the $PATH
, name it aws
, and make sure this file precedes the original one in priority.
```
!/bin/sh
if [ "${1-}" = '@FROM_PROXY' ]; then
shift
exec /opt/homebrew/bin/aws "$@"
else
exec op plugin run -- aws '@FROM_PROXY' "$@"
fi
```
The@FROM_PROXY
trick is here to prevent cyclic execution.