GitHub CLI Skill
Overview
The github-cli skill provides procedural knowledge for interacting with GitHub using the gh command-line tool. It covers repository management, issue tracking, and pull request workflows.
Core Workflows
1. Authentication Check
Before performing any GitHub operations, it's essential to check if the user is authenticated.
- Command:
gh auth status - When to use: Use this as the first step for any GitHub task to avoid permission errors.
2. Repository Management
Create and list repositories easily.
- Create a repo:
gh repo create <name> --public --clone - List repos:
gh repo list <owner> - View README:
gh repo view <owner/repo>
3. Issue Tracking
Manage project issues directly from the CLI.
- List issues:
gh issue list - Create issue:
gh issue create --title "Title" --body "Body" - View issue:
gh issue view <number>
4. Pull Request Management
Handle the code review process efficiently.
- List PRs:
gh pr list - Create PR:
gh pr create --title "Title" --body "Body" - Check PR status:
gh pr status - View PR details:
gh pr view <number>
Detailed Command Reference
For more specialized flags and commands, refer to references/commands.md. This file contains exhaustive lists of options for repository, issue, and PR management.
Guidelines
- Conciseness: Prefer short, specific commands over verbose ones.
- Confirmation: When creating repositories, issues, or PRs, always provide the final URL in your response.
- Error Handling: If a command fails due to authentication issues, suggest running
gh auth loginto the user.