GitHub Issue Management
Work with GitHub issues using the gh CLI.
Read-only commands (always allowed)
bash
gh issue list gh issue list --state all gh issue list --label "bug" gh issue view <number> gh issue view <number> --comments gh issue status gh label list
Modification commands (ask first)
These commands modify state - confirm with the user before running:
bash
gh issue create --title "Title" --body "Description" gh issue edit <number> --add-label "label" gh issue edit <number> --add-assignee @me gh issue close <number> --comment "Reason" gh issue reopen <number> gh issue comment <number> --body "Comment text"
Before creating an issue
Each repository has its own conventions. Before drafting a new issue:
- •Study existing issues: Run
gh issue listandgh issue viewon several recent issues to learn the preferred title format and body structure - •Fetch all labels: Run
gh label listto see available labels and choose the most appropriate ones
Match the style and conventions you observe in the existing issues.
Fixing an issue
When asked to fix an issue:
- •Understand the issue: Run
gh issue view <number> --comments - •Identify affected code: Search the codebase for relevant files
- •Implement the fix: Make minimal, focused changes
- •Test the changes: Run relevant tests
- •Create a commit: Reference the issue number (e.g., "Fix #123: description")
Arguments
When invoked with /gh <number>, view that issue:
bash
gh issue view $ARGUMENTS --comments