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 areauth,signingorauth_and_signing. the default value isauth_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 eitherOWNER/REPOorGROUP/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 π
glab-ssh-key(1)β the whole ssh-key family, go say hi π«
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
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms