gh-fuda is a gh extension which extends label manipulations.
Install as a gh extension (ref. gh manual of gh extension install).
gh extension install tnagatomi/gh-fudaLogin to GitHub with gh auth login (ref. gh manual of gh auth login) so that the extension can access the repositories.
-R,--repos: Select repositories using theOWNER/REPOformat separated by comma (e.g.,owner1/repo1,owner2/repo1)--dry-run: Check what operations would be executed without actually operating on the repositories-v,--version: Print the installed extension version and exit (also available as theversionsubcommand)
gh fuda listList existing labels from the specified repositories.
gh fuda list -R "owner1/repo1,owner1/repo2,owner2/repo1"gh fuda createCreate specified labels to the specified repositories.
-l,--labels: Specify the labels to create (see Label Format below)--json: Specify the path to a JSON file containing labels to create--yaml: Specify the path to a YAML file containing labels to create-f,--force: Update the label color and description if label already exists
Note: --json, --yaml, and -l/--labels flags are mutually exclusive. You must use exactly one of these options.
# Using inline labels
gh fuda create -R "owner1/repo1,owner1/repo2,owner2/repo1" -l "bug,feature:a2eeef,enhancement:00ff00:New feature"
# Using JSON file
gh fuda create -R "owner1/repo1,owner1/repo2,owner2/repo1" --json labels.json
# Using YAML file
gh fuda create -R "owner1/repo1,owner1/repo2,owner2/repo1" --yaml labels.yamlThe --labels flag supports the following formats:
name- Name only (color is auto-generated)name:color- Name and colorname:color:description- Name, color, and descriptionname::description- Name and description (color is auto-generated)
Color Auto-Generation: When color is omitted, it is automatically generated from the label name using a hash function. The same label name always produces the same color.
The color field is optional. If omitted or empty, color is auto-generated.
[
{
"name": "bug",
"description": "Something isn't working"
},
{
"name": "enhancement",
"color": "a2eeef",
"description": "New feature or request"
},
{
"name": "documentation",
"color": "07c",
"description": "Improvements or additions to documentation"
}
]The color field is optional. If omitted or empty, color is auto-generated.
- name: bug
description: Something isn't working
- name: enhancement
color: a2eeef
description: New feature or request
- name: documentation
color: 07c
description: Improvements or additions to documentationgh fuda deleteDelete specified labels from the specified repositories.
-l,--labels: Specify the labels to delete in the format of'label1[,label2,...]'-y,--yes: Do not prompt for confirmation
gh fuda delete -R "owner1/repo1,owner1/repo2,owner2/repo1" -l "label1,label2,label3"gh fuda syncSync the labels in the specified repositories with the specified labels.
-l,--labels: Specify the labels to set (see Label Format in Create Labels section)--json: Specify the path to a JSON file containing labels to sync--yaml: Specify the path to a YAML file containing labels to sync-y,--yes: Do not prompt for confirmation
Note: --json, --yaml, and -l/--labels flags are mutually exclusive. You must use exactly one of these options.
# Using inline labels
gh fuda sync -R "owner1/repo1,owner1/repo2,owner2/repo1" -l "bug,feature:a2eeef,enhancement:00ff00:New feature"
# Using JSON file
gh fuda sync -R "owner1/repo1,owner1/repo2,owner2/repo1" --json labels.json
# Using YAML file
gh fuda sync -R "owner1/repo1,owner1/repo2,owner2/repo1" --yaml labels.yamlThe JSON and YAML file formats are the same as those used for the create command. See the Create Labels section for details.
gh fuda emptyDelete all labels from the specified repositories.
-y,--yes: Do not prompt for confirmation
gh fuda empty -R "owner1/repo1,owner1/repo2,owner2/repo1"gh fuda mergeMerge a source label into a target label across repositories. This command:
- Adds the target label to all issues, PRs, and discussions that have the source label
- Removes the source label from those items
- Deletes the source label from the repository
Both the source (--from) and target (--to) labels must exist in each repository.
--from: Source label to merge from (will be deleted)--to: Target label to merge into-y,--yes: Do not prompt for confirmation
gh fuda merge -R "owner1/repo1,owner1/repo2,owner2/repo1" --from "old-bug" --to "bug"- Go 1.25.0 or later
- gh CLI (for authentication)
go build# Run unit tests
go test ./...
# Run E2E tests (requires GH_TOKEN and two empty test repositories)
GH_FUDA_TEST_REPO_1=youruser/test-repo-1 GH_FUDA_TEST_REPO_2=youruser/test-repo-2 \
GH_TOKEN=$(gh auth token) go test -tags=e2e -vE2E tests execute actual CLI commands against real GitHub repositories. They are intended for local execution only (not run in CI).
Test Repositories:
Set GH_FUDA_TEST_REPO_1 and GH_FUDA_TEST_REPO_2 environment variables to repositories you own.
Warning
The tests will create, delete, and empty labels in these repositories. Use dedicated empty repositories.
golangci-lint run