feat(deploy-key): Deploy key functionality
Description
Adds the add delete get and list verbs for the deploy-key command. Includes tests for all verbs.
- feat(deploy-key): Deploy key functionality
Related Issues
Resolves #7849 (closed)
How has this been tested?
Generate a new key for testing purposes.
❯ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/faleksic/.ssh/id_ed25519): /Users/faleksic/Projects/ci-testing/id_ed25519
Enter passphrase for "/Users/faleksic/Projects/ci-testing/id_ed25519" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/faleksic/Projects/ci-testing/id_ed25519
Your public key has been saved in /Users/faleksic/Projects/ci-testing/id_ed25519.pub
The key fingerprint is:
SHA256:vpWy/1oGN5zfGLn13YZj96s1AZzLQy+5IZnGK1YkWTI faleksic@faleksic--20250331-WTRJ7
The key's randomart image is:
+--[ED25519 256]--+
| E . |
| = . . |
| o . = |
| +.=.=. |
| S .B=Boo.|
| . o+oo=B=|
| ooo.o.BoB|
| .=.o ..+o|
| o.oo....o|
+----[SHA256]-----+
Use it with the tool
❯ ~/Projects/cli/bin/glab deploy-key add -t 'test' id_ed25519.pub
✓ New deploy key added.
❯ ~/Projects/cli/bin/glab deploy-key list
Title Key Can Push Created At
test ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFHc+Y8A6YmFDmz... false less than a minute ago
❯ ~/Projects/cli/bin/glab deploy-key list --show-id
ID Title Key Can Push Created At
17681600 test ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF... false less than a minute ago
❯ ~/Projects/cli/bin/glab deploy-key get 17681600
Title Key Can Push Created At
test ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFHc+Y8A6Ym... false 2025-05-22 12:32:23.209 +0000 UTC
❯ ~/Projects/cli/bin/glab deploy-key delete 17681600
✓ Deploy key deleted.
❯ ~/Projects/cli/bin/glab deploy-key list --show-id
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap