一键导入
setup
Set up GitHub CLI (gh): install, authenticate, and verify. Use when user needs to install gh, fix gh authentication, or configure GitHub CLI from scratch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up GitHub CLI (gh): install, authenticate, and verify. Use when user needs to install gh, fix gh authentication, or configure GitHub CLI from scratch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
'Create a new Claude Code skill with best practices. Use when user wants to create a skill, custom command, slash command, or extend Claude capabilities.'
Initialize a new Claude Code plugin with interactive wizard. Use when creating a new plugin or setting up a plugin marketplace.
Manage Claude Code memory — CLAUDE.md files, AGENTS.md, and .claude/rules/. Use when user wants to create, update, review, or optimize project memory files. Triggers: "manage memory", "create CLAUDE.md", "update rules", "init memory", "optimize CLAUDE.md".
'Modify an existing Claude Code custom subagent. Use when user wants to edit, update, refactor, or change an agent at any scope (project, user, plugin).'
'Modify an existing Claude Code skill. Use when user wants to edit, update, refactor, or change a skill at any scope (project, user, plugin).'
Configure GitHub organization or repository settings: rulesets, roles, security, branch protection, Dependabot, secret scanning, merge settings. Use when user wants to set up, configure, or audit GitHub settings.
| name | setup |
| description | Set up GitHub CLI (gh): install, authenticate, and verify. Use when user needs to install gh, fix gh authentication, or configure GitHub CLI from scratch. |
Automatically install, authenticate, and verify GitHub CLI (gh). Run all steps without asking questions — use sensible defaults throughout.
Execute each step sequentially. Skip steps that are already satisfied.
gh is installedRun which gh or gh --version.
ghDetect the platform and install using the appropriate package manager:
| Platform | Command |
|---|---|
| macOS (Homebrew) | brew install gh |
| macOS (no Homebrew) | Install Homebrew first: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)", then brew install gh |
| Ubuntu/Debian | sudo apt install gh (if available) or install from GitHub's apt repo |
| Fedora/RHEL | sudo dnf install gh |
| Arch Linux | sudo pacman -S github-cli |
| Windows (winget) | winget install --id GitHub.cli |
| Windows (scoop) | scoop install gh |
For Linux distros where gh is not in default repos, use the official GitHub apt/yum repository:
# Debian/Ubuntu
(type -p wget >/dev/null || sudo apt-get install wget -y) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
After installation, verify with gh --version.
If installation fails, report the error and stop. Do NOT retry.
Run gh auth status.
gh auth login with defaults (GitHub.com, HTTPS protocol, browser-based auth). This will open a browser for the user to complete OAuth.IMPORTANT: After gh auth login, the user must complete the browser-based authentication flow. Wait for the command to finish before proceeding.
Run these verification commands:
gh auth status — confirm authenticatedgh api user --jq .login — confirm API access works, print usernamePrint a summary:
GitHub CLI setup complete:
- gh version: <version>
- Authenticated as: <username>
- Protocol: HTTPS
If any verification step fails, report the specific error and suggest the fix (e.g., "Run gh auth login to re-authenticate").