Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with 1Password CLI v2.x #77

Open
edgar opened this issue May 27, 2022 · 3 comments
Open

Doesn't work with 1Password CLI v2.x #77

edgar opened this issue May 27, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@edgar
Copy link

edgar commented May 27, 2022

Describe the bug
1Password released a v2.x of their CLI, and introduced breaking changes in the commands, for instance now the commands are something like:

op item list --categories login --tags SSHKeys

instead of what currently ssh-manager is expecting:

op list  items --categories login --tags SSHKeys

Below the error when trying to run ssh-manager list

❯ ssh-manager list --provider op
Error: 'op list': Execution failed: exit status 1: [ERROR] 2022/05/27 17:08:39 unknown command "list" for "op"
Usage:  op [command] [flags]

Management Commands:
  account     Manage your locally configured 1Password accounts
  connect     Manage Connect instances and Connect tokens in your 1Password account
  document    Perform CRUD operations on Document items in your vaults
  events-api  Manage Events API integrations in your 1Password account
  group       Perform CRUD operations on the groups of users in your 1Password account
  item        Perform CRUD operations on the 1Password items in your vaults
  user        Manage users within this 1Password account
  vault       Manage permissions and perform CRUD operations on your 1Password vaults

Commands:
  completion  Generate shell completion information
  inject      Inject secrets into a config file
  read        Read a secret using the secrets reference syntax
  run         Pass secrets as environment variables to a process
  signin      Sign in to a 1Password account
  signout     Sign out of a 1Password account
  update      Check for and download updates.

Global Flags:
      --account account    Select the account to execute the command by account shorthand, sign-in address, account ID, or user ID. For a list
                           of available accounts, run 'op account list'. Can be set as the OP_ACCOUNT environment variable.
      --cache              Store and use cached information.
      --config directory   Use this configuration directory.
      --debug              Output debug logs. Can also be set using $OP_DEBUG environment variable.
      --encoding type      Use this character encoding type. Default: UTF-8. Supported: SHIFT_JIS, gbk.
      --format string      Use this output format. Can be 'human-readable' or 'json'. Can be set as the OP_FORMAT environment variable.
                           (default "human-readable")
  -h, --help               Get help for op.
      --iso-timestamps     Format timestamps according to ISO 8601 / RFC 3339. Can be set as the OP_ISO_TIMESTAMPS environment variable.
      --no-color           Print output without color.
      --session token      Authenticate with this session token. 1Password CLI outputs session tokens for successful 'op signin' commands when
                           biometric unlock is disabled.

Run 'op [command] --help' for more information on the command.

To Reproduce
Steps to reproduce the behavior:

  1. Install the new 1Password CLI
  2. Try to list/get a SSH Key using ssh-manager

Expected behavior
Get/list the SSH Key items stored in 1Password

Environment:

  • CLI Version (retrieve with ssh-manager version): INFO[27-05-2022 17:11:12] ssh-manager v1.0.0
  • Operating System/Architecture: macOS Monterey v12.4/ARM64
@edgar edgar added the bug Something isn't working label May 27, 2022
@omegion
Copy link
Owner

omegion commented May 30, 2022

We can support v1.x and v2.x together but it would require some work. Personally, I still use v1.x. I cannot assume everyone uses the new version.

@edgar
Copy link
Author

edgar commented May 30, 2022

Thanks for the quick response.
I was thinking that probably an approach will be to to have a op2 provider, it seems most of the code will be the same just need to adjust the CLI params order.
I can try to prepare a PR if you are interested

@omegion
Copy link
Owner

omegion commented Jun 1, 2022

Feel free to create a PR for it, I would definitely contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants