It is recommended to not install the CLI tool globally.
mkdir ghlabel
# this is where the labels config will be located
cd ghlabel
python -m venv .venv
# Linux/Mac
. .venv/bin/activate
# Windows
.venv\Scripts\activate.bat
pip install ghlabel
# check if installed
ghlabel -v
# Linux/Mac
touch .env
# Windows
type nul > .env
GITHUB_PERSONAL_ACCESS_TOKEN=<your_github_personal_access_token>
GITHUB_REPO_OWNER=<target_github_repository_owner>
GITHUB_REPO_NAME=<target_github_repository_name>
ghlabel dump
ghlabel setup -p
ghlabel setup
For advanced usage, see:
ghlabel -h
Setup Github Labels from a yaml/json config file.
$ ghlabel [OPTIONS] COMMAND [ARGS]...
Show version and exit.
Enable debug mode and show logs.
Show this message and exit.
Generate starter labels config files.
Add/Remove Github labels from config files.
Generate starter labels config files.
$ ghlabel dump [OPTIONS]
Deletes all files in labels dir.
Specify the dir where to find labels.
Label file extension.
App to determine label template.
Show this message and exit.
Add/Remove Github labels from config files.
$ ghlabel setup [TOKEN] [REPO_OWNER] [REPO_NAME] [OPTIONS]
Specify the directory where to find labels.
Dry run and preview result before adding/removing labels from repo.
Strictly mirror Github labels from labels config.
Add more labels.
Remove more labels.
Remove all Github labels.
Show this message and exit.
REPO_NAME=medrec ghlabel setup
# -r [comma-separated string]
# will be parsed as list[str]
ghlabel setup -r "Type: Feature Request, Type: Bug"
# -a [valid json string]
# will be parsed as list[dict[str, str]]
ghlabel setup -a "[{'name': 'wontfix', 'color': '#ffffff'}, {'name': 'bug', 'color': '#d73a4a', 'description': 'Something isn't working'}]"
# yaml
- name: <label_name>
color: <label_color_hash>
description: <label_description>
# json
[
{
"name": <label_name>,
"color": <label_color_hash>,
"description": <label_description>,
},
]
- bug
- dependencies
- documentation
- duplicate
- enhancement
- github_actions
- help wanted
- invalid
- python
- question
- wontfix