1password-client icon indicating copy to clipboard operation
1password-client copied to clipboard

Don't edit my `.bashrc`

Open CallieNCI opened this issue 9 months ago • 2 comments

Describe the bug The module silently adds ...

export OP_ACCOUNT="<ACCOUNT>.1password.com"

to my .bashrc.

To Reproduce Steps to reproduce the behavior:

The-Matrix$ tail -2 ~/.bashrc
. "$HOME/.local/bin/env"
export alpha=beta

The-Matrix$ cat r.py
#!/usr/bin/env python3

from onepassword import OnePassword

op = OnePassword()

The-Matrix$ ./r.py
Please input your 1Password personal or business acount name e.g. company from company.1password.com: my.1password.com

The-Matrix$ tail -2 ~/.bashrc
export alpha=beta
export OP_ACCOUNT="my.1password.com"

Expected behavior It should not do that!

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Version 15.3.1

Additional context For someone who is working with multiple 1Password accounts, this causes unexpected bevhaviours, but you should not touch my .bashrc, and never do something like that silently.

CallieNCI avatar Mar 21 '25 02:03 CallieNCI

I think it's a very fair point and the best we could do is add some logging to tell users it's happening. However if we didn't add that line to the bashrc the integration between the op cli and python kernel wouldn't work which is the whole purpose of this library. This is how sessions are upheld in the cli and python os environment is not great at maintaining that.

Would that extra notification be better for now?

dtpryce avatar Mar 21 '25 09:03 dtpryce

@dtpryce Unfortunately this means this library is unusable in a Nix-setting. My .zshrc is a read-only file since I'm using NixOs which causes this library to crash.

Lewenhaupt avatar May 11 '25 16:05 Lewenhaupt