glab(1)

✨ glab-ssh-key-add ✨

okay so real quick β€” this is a page from glab(1), the GitLab CLI manual, and today's main character is the ssh-key add command. buckle up bestie πŸŽ€


🌸 NAME 🌸

glab-ssh-key-add β€” literally just: add an SSH key to your GitLab account. that's the whole vibe. πŸ”‘


πŸ¦‹ SYNOPSIS πŸ¦‹

glab ssh-key add [key-file] [flags]

πŸ’œ DESCRIPTION πŸ’œ

So what it does is it creates a new SSH key that's owned by whoever you're currently authenticated as. main character energy, but make it cryptographic. πŸ”

Heads up though β€” it requires the --title flag. no title, no key, no cap.

Also important, and GitLab is kinda strict about this: GitLab rejects a key whose fingerprint is already registered on your account β€” even when that key has expired. expired and still blocked, the disrespect 😭. so if you wanna re-register it, use --replace to delete the existing key with the same SHA256 fingerprint and add it again, this time with the new title, usage type, and expiration date. slay, fresh start. ✨


πŸ’… OPTIONS πŸ’…

  • -e, --expires-at="" β€” the expiration date of the SSH key. it uses ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. put it on the calendar bestie πŸ—“οΈ
  • --replace[=false] β€” delete an existing key with the same fingerprint (like, say, an expired one) before adding this one. bye felicia πŸ‘‹
  • -t, --title="" β€” the new SSH key's title. required, remember? don't forget it πŸ™ˆ
  • -u, --usage-type="auth_and_signing" β€” the usage scope for the key. possible values are auth, signing or auth_and_signing. the default value is auth_and_signing. pick your fighter 🫢

🧚 OPTIONS INHERITED FROM PARENT COMMANDS 🧚

  • -h, --help[=false] β€” show help for this command. when in doubt, ask for help, that's growth πŸ’–
  • -R, --repo="" β€” select another repository. you can use either OWNER/REPO or GROUP/NAMESPACE/REPO, and the full URL or Git URL is also accepted. flexible icon 🌈

πŸ”₯ EXAMPLE πŸ”₯

# Read ssh key from stdin and upload.
glab ssh-key add -t "my title"

# Read ssh key from specified key file, upload and set the ssh key type to "authentication".
glab ssh-key add ~/.ssh/id_ed25519.pub -t "my title" --usage-type "auth"

# Re-register an expired key with a new expiration date.
glab ssh-key add ~/.ssh/id_ed25519.pub -t "my title" --expires-at 2027-01-01 --replace

πŸ‘‘ SEE ALSO πŸ‘‘


ngl that's the whole page. go add that key, you've got this πŸ’ͺ

mwah πŸ’‹ β€” this page was Auto generated by spf13/cobra, dated Nov 2026, and it lives in the glab(1) manual. that's the tea, periodt. πŸ“

πŸ“¦ where this page comes from