Is it possible to install the OP CLI using brew without sudo?

coordinated
coordinated
Community Member
edited May 2022 in CLI

Hi, folks

I've been looking forward to the CLI in v8 and have been excitedly waiting for the final release to come out :-)

I've run into a minor problem when installing the OP CLI using 'brew'.

I intentionally log into my Mac with a non-admin account which isn't set up to use 'sudo' (I have a separate admin account for that). I've always been able to install Homebrew packages without needing 'sudo' (and I thought it was frowned on by the Homebrew folk).

When I try to install the OP CLI package, I get:

$ brew install --cask 1password/tap/1password-cli

==> Downloading https://cache.agilebits.com/dist/1P/op2/pkg/v2.1.0/op_apple_universal_v2.1.0.pkg
######################################################################## 100.0%
==> Installing Cask 1password-cli
==> Running installer for 1password-cli; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
<username> is not in the sudoers file.  This incident will be reported.
==> Purging files for version 2.1.0 of Cask 1password-cli
Error: Failure while executing; `/usr/bin/sudo -E -- /usr/bin/env LOGNAME=<username> USER=<username> USERNAME=<username> /usr/sbin/installer -pkg /usr/local/Caskroom/1password-cli/2.1.0/op_apple_universal_v2.1.0.pkg -target /` exited with 1. Here's the output:
<username> is not in the sudoers file.  This incident will be reported.

Am I doing something wrong, or should I just use the manual installer?

Thanks,
Steve


1Password Version: 8.7.0 - 80700098 on PRODUCTION channel
Extension Version: N/A
OS Version: macOS 12.3.1

Comments

  • Hey Steve,

    Thank you for reaching out to us.
    After checking with my colleagues, I think the error here is because brew uses our .pkg installer, and installing .pkg requires privileged access, which is a built-in MacOS thing.
    Unfortunately, you would encounter the same issue with the manual installer as well. We currently do not distribute raw binaries for the 1Password CLI.
    However, distributing the CLI in more formats is on our roadmap, so this will be supported natively in the future. Can you please let us know, in the meantime, whether this is a blocker for your workflows, and if there is any immediate way that we can help with it?

    Thank you!

    Best,
    Horia

  • coordinated
    coordinated
    Community Member

    Thanks, Horia

    It's not a problem at all - I just used the manual installer (as it issues a system prompt to authenticate with an administrator account, which 'sudo' doesn't do if your account isn't an administrator).

    The only thing I'm missing out on is a way to monitor whether a later version of the CLI has been released.

    Would it be possible for the app to monitor whether the installed version of the CLI matches the latest one available and issue a warning if it needed upgrading?

    Best wishes,
    Steve

  • Horia.Culea_1P
    edited May 2022

    We've just today opened a ticket tracking this, as a follow-up to this discussion here: https://1password.community/discussion/129022/how-to-programatically-fetch-the-latest-versions#latest

    Currently, there is the op update command that implements the endpoint that my colleague describes in the post above, but an RSS feed has also been an idea there.

    It is a very interesting idea for the 1P8 app to be tracking the version of the CLI. I'll be making an addendum about this on our ticket.
    Let us know if you have any other ideas about how you'd see this working!

    Thank you! Looking forward to hearing back!

    Best,
    Horia

This discussion has been closed.