Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
firelizzard
3 years agoNew Contributor
Calling the CLI from a Go program
I'm working on a Go program and I want to call op , using the PolKit/app integration so a dialog appears prompting the user to type in their password. This works when I run op directly from my she...
Former Member
3 years agoAfter playing around a little more it seems to be certain criteria that needs to be fulfilled to make it work. You can not just run your Go program using go run main.go
for example. The executable needs to be in some system executable dir like /usr/bin
or /usr/local/bin
. The executable needs to be owned by root, chown root:root exe
and the permissions needs to be 755, chmod 755 exe
. I haven't played around extensively with different users and permissions.
I've tried to run the exe from a path in my home dir (/home/$USER/bin
) that's in the path $PATH
but I don't seem to be able to run the exe
in that dir and make it work even if the owner is root
and permissions are 755
(rwxr-xr-x
).
I'm planning to do the following to continue to develop the Go.
- Disable "Connect with 1Password CLI"
- Add a function to handle
op signin
session tokens - Develop
- Test
- During release move the compiled binary to
/usr/bin
and change user toroot
and permissions to755
- Enable "Connect with 1Password CLI"