1Password CLI command not recognised

Hello, I'm trying to use the 1Password CLI in order to make it do stuff since it does not support AppleScript (anymore).

So I'm using a "Execute a Shell Script" step to do this, with the following command:

op item get sjbTlrym4ZjzvznX5okrwqb7yv --reveal
(I used a fake ID as example)

Works perfectly in Terminal, but when I execute the step with KM, I get this:
Execute a Shell Script failed with script error: text-script: line 1: op: command not found.

Any idea what might be going on? Can KM maybe not execute commands that have been installed in the shell (the 1P CLI is installed through Homebrew)?

Thanks --Mike

If you precede "op" in the "Execute Shell Script" action with the full path, it will possibly work. There are other solutions, I won't talk about yet, but this might be the simplest.

Indeed that worked!

/opt/homebrew/Caskroom/1password-cli/2.30.3/op item get sjbTlrym4ZjzvznX5okrwqb7yv --reveal

Thanks! --Mike

In the action, in the Gear menu, there is a Help item, which will take you to the Execute a Shell Script action help which covers this and other issues.

1 Like