-
-
Notifications
You must be signed in to change notification settings - Fork 1
GitHub Labels
The labels command lets you manage GitHub repository labels using your local terminal via the ghitgud CLI. It supports listing, syncing, editing, and cleaning labels efficiently through the GitHub API.
ghitgud labels [options] [command]Manage labels for a repository.
-
-h, --help– Display help for thelabelscommand.
ghitgud labels listLists all labels for the current repository. Outputs metadata to the terminal including:
- Label name
- Color
- Description
ghitgud labels pullPulls all labels from the current GitHub repository and writes them to:
~/.config/ghitgud/labels.json
This file includes each label’s:
namecolordescription
You can edit this file manually to:
- Create new labels
- Rename existing ones (by adding a
"newName"field) - Modify descriptions or colors
ghitgud labels pushPushes the local labels.json back to the GitHub repository, applying all changes:
- Creates new labels
- Updates existing ones
- Renames labels using the
"newName"key
ghitgud labels pruneDeletes all existing labels in the GitHub repository that are not present in the current labels.json file.
Tip: Use
pull→prune→ editlabels.json→pushfor a clean-slate label sync.
The ghitgud project includes pre-made label templates that you can use as a starting point. To use one:
-
Copy a template JSON structure into:
~/.config/ghitgud/labels.json -
Optionally run
pruneto remove current labels from the repository. -
Run
pushto apply the template.