Get SSH public key with CLI?

forty2
forty2
Community Member

Hi all,

I've been playing with the new SSH key support (which is amazing!) but I've run into a few situations where it would be useful to be able to fetch the public key with the CLI. Unfortunately, that doesn't seem to be possible; op item get seems to only return the private key. I suppose I could store it as a note, but I really don't want to have to duplicate it like that. Is there another way? If not, I'd love to see it added -- is there a feature request process?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • Hey @forty2,

    We're currently working on this, stay tuned!

    Best,
    Horia

  • marksie19881
    marksie19881
    Community Member
    edited October 2022

    Is there any update on this?

    If i do op item get ssh_key it shows the fulll item but if i do op item get ssh_key --fields publicKey it is blank, I really need this for some automation im working on.

    I also notice that i cant seem to return the privatekey in OpenSSH format, it is some other format?

  • Hi @marksie19881 , op item get SSHKey --fields 'public key' should do the trick. Changing the user-facing format of the private key to OpenSSH is on our WIP list but is a broader scope change. The fact that the same value needs to be displayed in OP8 desktop app requires coordination and no promises for when this will be done can be made.

    All the best,
    Andi

This discussion has been closed.