GitHub Issue Close
When to use
- The user asks to close or resolve an issue.
- Work is finished, or the issue is duplicate/invalid/out of scope.
Inputs to confirm
- Issue number or URL.
- Target repo if not the current repo (
--repo OWNER/REPO). - Close reason:
completedornot planned. - Optional closing comment text.
Workflow
- Verify auth and access:
gh --version gh auth status - Check current state:
gh issue view 123 --json number,title,state,stateReason - Close with the right reason and optional comment:
gh issue close 123 --reason "completed" gh issue close 123 --reason "not planned" --comment "Duplicate of #45" - Verify closure:
gh issue view 123 --json state,stateReason,closedAt --jq '"\(.state) \(.stateReason) \(.closedAt)"'
Examples
# Close as completed
~ gh issue close 123 --reason "completed"
# Close as not planned with a reason
~ gh issue close 123 --reason "not planned" --comment "Out of scope for current roadmap."
Notes
- Arguments accept number or URL (
gh issue close --help). - Close reasons are exactly
completedornot planned.
References
- GitHub CLI manual: https://cli.github.com/manual/
gh issue close --help