Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
Former Member
3 years ago1Password CLI is fussy about TTYs
I upgraded from 2.0 to 2.5 of the CLI this week and it broke the iTerm2 integration. The issue seems to be that the CLI really cares about whether stdin is a tty or not.
These commands fail to op...
mickael
3 years agoContributor
I encounter a similar or related issue with the python wrapper I developed around op cli.
This wrapper helps to create various normative things: server account / database account / ssh keys / website accounts.
Now all op item create
commands I call fails silently while returning a 0 return code.
You can have a look at how I call op cli
from my python script here: https://github.com/mickaelperrin/onepassword-tools/blob/653649eb851c54b6638ba9d339bd12112ee7b33f/onepassword_tools/lib/OnePasswordUtils.py#L168
e = os.environ.copy()
p = subprocess.Popen('op ' + cmd,
bufsize=0,
close_fds=True,
env=e,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
try:
out, err = self._communicate(p, inputstr=inputstr)
except subprocess.CalledProcessError:
out = ''
err = ''
rc = p.returncode
return rc, out.decode('utf-8'), err.decode('utf-8')
For example, the cmd item create --no-color --format json --template /var/folders/t0/4z0_cwt538d4qkkvnpb81_6m0000gn/T/tmpvo18gwde --title="USER test ON test.fr" -
returned an empty string for err, out and rc is 0.
@"Horia.Culea_1P" Can I return back to an old version of op-cli while this issue is resolved ? In which version that change was introduced ?