LinuxCommandLibrary

gh-label

Manage GitHub issue and pull request labels

TLDR

List labels for the repository in the current directory

$ gh label list
copy

View labels for the repository in the current directory in the default web browser
$ gh label list [[-w|--web]]
copy

Create a label with a specific name, description and color in hexadecimal format for the repository in the current directory
$ gh label create [name] [[-d|--description]] "[description]" [[-c|--color]] [color_hex]
copy

Delete a label for the repository in the current directory, prompting for confirmation
$ gh label delete [name]
copy

Update the name and description for a specific label for the repository in the current directory
$ gh label edit [name] [[-n|--name]] [new_name] [[-d|--description]] "[description]"
copy

Clone labels from a specific repository into the repository in the current directory
$ gh label clone [owner]/[repository]
copy

Display help for a subcommand
$ gh label [subcommand] --help
copy

SYNOPSIS

gh label [flags] []

PARAMETERS

--help
    Show help for gh-label.

create
    Create a new label with given name.

edit
    Edit properties of label with given name.

list
    List all labels in repository.

delete
    Delete a label with given name.

-R, --repo
    Specify the repository to use. Defaults to the current repository.

DESCRIPTION

gh-label is a command-line tool that simplifies the management of GitHub repository labels.
It allows users to create, list, edit, and delete labels directly from their terminal, eliminating the need to interact with the GitHub web interface for label administration.
This tool is particularly useful for maintaining consistent label sets across multiple repositories, enforcing organizational standards, and automating label-related tasks.
It streamlines workflows related to issue triaging, feature tracking, and bug reporting, ultimately improving project organization and collaboration within GitHub repositories. gh-label typically provides functionalities for bulk operations like syncing labels from a configuration file, ensuring consistency across repositories.

CAVEATS

The 'gh-label' command relies on the GitHub API. Rate limits imposed by GitHub may restrict the number of label operations that can be performed within a given timeframe.
Ensure proper authentication with the GitHub CLI is configured before using 'gh-label'.

CONFIGURATION

gh-label often uses configuration files (e.g., YAML, JSON) to define label specifications. These files allow you to define label names, descriptions, and colors centrally, enabling consistent label creation across multiple repositories.
Refer to the tool's documentation for specific configuration file formats and options.

AUTHENTICATION

The tool requires authentication with GitHub. This is generally handled through the main 'gh' command-line tool. Ensure you are logged in to your GitHub account using 'gh auth login' before attempting to use gh-label.

SEE ALSO

gh(1), gh issue(1), git(1)

Copied to clipboard