An extension for the gh CLI to manage GitHub's Sub-issue feature.
gh sub-issue provides a set of commands to intuitively manage the parent-child relationships of your issues directly from the command line.
- List sub-issues for a parent issue (
list) - Add an existing issue as a sub-issue (
add) - Remove a parent-child relationship (
remove) - Change the priority of a sub-issue (
reprioritize)
- You must have the GitHub CLI (gh) installed.
After you publish this repository under your GitHub username, it can be installed with the following command:
# Replace YOUR_USERNAME with your actual GitHub username
gh extension install YOUR_USERNAME/gh-sub-issueDisplays a table of sub-issues linked to a parent issue.
Command:
gh sub-issue list <parent-issue-number>Example:
gh sub-issue list 123Adds an existing issue as a sub-issue to a specified parent.
Command:
gh sub-issue add <parent-issue-number> --sub-issue-number <child-issue-number> [--replace-parent]Options:
--replace-parent: If the child issue already has a parent, this option will overwrite it.
Examples:
# Add issue #124 as a child of issue #123
gh sub-issue add 123 --sub-issue-number 124
# Forcefully add issue #125 as a child of #123, even if it has another parent
gh sub-issue add 123 --sub-issue-number 125 --replace-parentRemoves the parent-child relationship between two issues.
Command:
gh sub-issue remove <parent-issue-number> --sub-issue-number <child-issue-number>Example:
gh sub-issue remove 123 --sub-issue-number 124Changes the priority of a sub-issue within its sibling list.
Command:
gh sub-issue reprioritize <parent-issue-number> --sub-issue-number <issue-to-move> [--before <issue> | --after <issue>]Options:
--before <issue>: Moves the target issue before the specified sibling issue (increases priority).--after <issue>: Moves the target issue after the specified sibling issue (decreases priority).
Examples:
# In parent issue #123, move sub-issue #125 before #124 (higher priority)
gh sub-issue reprioritize 123 --sub-issue-number 125 --before 124
# In parent issue #123, move sub-issue #124 after #125 (lower priority)
gh sub-issue reprioritize 123 --sub-issue-number 124 --after 125This project is licensed under the MIT License.