界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

glab-ssh-key

glab-ssh-key

【开发与工程】Manage SSH keys for GitLab account including add, list, and delete operations. Use when setting up SSH authentication, managing SSH keys, or configuring Git over SSH. Triggers on SSH key, add SSH key, SSH authentication, Git SSH.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: glab-ssh-key description: Manage SSH keys for GitLab account including add, list, and delete operations. Use when setting up SSH authentication, managing SSH keys, or configuring Git over SSH. Triggers on SSH key, add SSH key, SSH authentication, Git SSH.

glab ssh-key

Overview


  Manage SSH keys registered with your GitLab account.                                                                  
         
  USAGE  
         
    glab ssh-key <command> [command] [--flags]  
            
  COMMANDS  
            
    add [key-file] [--flags]   Add an SSH key to your GitLab account.
    delete <key-id> [--flags]  Deletes a single SSH key specified by the ID.
    get <key-id> [--flags]     Returns a single SSH key specified by the ID.
    list [--flags]             Get a list of SSH keys for the currently authenticated user.
         
  FLAGS  
         
    -h --help                  Show help for this command.
    -R --repo                  Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.

⚠️ Security Warning: Public Keys Only

Always verify you are uploading a PUBLIC key, not a private key.

  • ✅ Public keys: ~/.ssh/id_rsa.pub, ~/.ssh/id_ed25519.pub (.pub extension)
  • ❌ Private keys: ~/.ssh/id_rsa, ~/.ssh/id_ed25519 (no extension — NEVER upload these)

Uploading a private key to GitLab would expose your credentials. Double-check the filename before running glab ssh-key add.

# ✅ Safe — public key
glab ssh-key add ~/.ssh/id_ed25519.pub --title "My Laptop"

# ❌ NEVER do this — private key
# glab ssh-key add ~/.ssh/id_ed25519 --title "My Laptop"

Before uploading, verify your key is public:

# Should start with 'ssh-rsa', 'ssh-ed25519', 'ecdsa-sha2-*', etc.
head -c 20 ~/.ssh/id_ed25519.pub

Quick start

glab ssh-key --help

Subcommands

See references/commands.md for full --help output.

我的收藏