360 Secure SkillHub
360 安全技能中心

GitHub CLI

该 Skill 指导使用 GitHub CLI(gh)完成认证检查、仓库创建/克隆/Fork、Issue 与 Pull Request 管理、Release 发布等核心 GitHub 操作,并强调显式、幂等命令与销毁性操作确认,实施后回报 URL。

分类:开发
trumppo
trumppo
热度 58.55
最近更新 2026-05-11 15:54:46

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add trumppo/gh
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
gh
description
Use the GitHub CLI (gh) to perform core GitHub operations: auth status, repo create/clone/fork, issues, pull requests, releases, and basic repo management. Trigger for requests to use gh, manage GitHub repos, PRs, or issues from the CLI.

GitHub CLI (gh)

Overview

Use gh for authenticated GitHub operations from the terminal. Prefer explicit, idempotent commands and report URLs back to the user.

Quick checks

  • Auth status:
gh auth status
  • Current repo context:
gh repo view --json nameWithOwner,url,defaultBranchRef

Core workflows

Repo create (private by default)

gh repo create OWNER/NAME --private --confirm --description "..."

If running inside a local repo, use --source . --remote origin --push.

Clone / fork

gh repo clone OWNER/NAME
gh repo fork OWNER/NAME --clone

Issues

  • List:
gh issue list --limit 20
  • Create:
gh issue create --title "..." --body "..."
  • Comment:
gh issue comment <num> --body "..."

Pull requests

  • Create from current branch:
gh pr create --title "..." --body "..."
  • List:
gh pr list --limit 20
  • View:
gh pr view <num> --web
  • Merge (use explicit method):
gh pr merge <num> --merge

Releases

gh release create vX.Y.Z --title "vX.Y.Z" --notes "..."

Safety notes

  • Confirm the target repo/owner before destructive actions (delete, force push).
  • For private repos, ensure --private is set on create.
  • Prefer --confirm to avoid interactive prompts in automation.