feat: add GPG key management commands#3822
Conversation
There was a problem hiding this comment.
Sorry @owenvoke for taking so long to review this. Thanks for the submission, the code looked great! I pushed some small 💅 changes as well as merged in trunk and updated the code to use the new v2 import statements since v2 was recently released.
|
Thank you so much @samcoe, that's brilliant! And no worries about the review time, glad I could contribute to the CLI. 🥳 |
mislav
left a comment
There was a problem hiding this comment.
Thanks for taking this on! I have minor output suggestions
| for _, gpgKey := range gpgKeys { | ||
| t.AddField(gpgKey.Emails.String(), nil, nil) | ||
|
|
||
| t.AddField(gpgKey.KeyId, nil, nil) |
There was a problem hiding this comment.
Should the ID field come first?
There was a problem hiding this comment.
I'd say it probably should do.
There was a problem hiding this comment.
I disagree here, I think the email associated with the key is how most people will recognize which key is which if there are multiple associated with an account since they don't have names like SSH keys. Additionally the UI on the GitHub settings page, as well as other GPG keystores I have seen, usually list email first.
|
Thank you @samcoe! |
This adds two new subcommands (
gpg-key listandgpg-key add) based off of thessh-keysubcommands. I've never worked with Go before, so hope this is correct.Related to #1755 (comment)
Currently
gh gpg-key listwill show the output using the following columns:I wasn't sure whether to included the date it was uploaded, or anything else as it seemed to get a bit cluttered.
I've temporarily created a GitHub CLI extension for this, however I'd much rather it be in core. 👍🏻