A tool for easy management of labels in GitHub repositories. This repository contains scripts for creating and deleting labels with predefined categories for various project types.
- Creating Labels: Predefined labels for bugs, features, status and more
- Easy Label Deletion: Targeted removal of unwanted labels
- GitHub CLI Integration: Uses the official GitHub CLI for secure API calls
- Color-coded Labels: Professional color scheme for better overview
- GitHub CLI installed and configured
- Bash shell (Linux, macOS, WSL)
- Permission to manage labels in the target repository
# macOS
brew install gh
# Ubuntu/Debian
sudo apt install gh
# Windows (with Chocolatey)
choco install ghgh auth login- Clone the repository:
git clone https://github.com/yourusername/label-sync.git
cd label-sync- Make scripts executable:
chmod +x create-labels.sh delete-labels.shRun the script in the desired repository:
./create-labels.shNote: Make sure you are in the correct repository directory or specify the repository as a parameter.
You can also create labels in another repository without switching repositories:
# Format: OWNER/REPOSITORY
./create-labels.sh --repo username/repository-name
# Example:
./create-labels.sh --repo octocat/hello-worldTo delete labels, first edit the delete-labels.sh file:
# Open the file in your editor
nano delete-labels.shRemove the comments before the labels you want to delete:
labels=(
"🐞 Bug" # Remove comment to delete
# "🔁 Duplicate" # Remains commented
)Then run the delete script:
./delete-labels.shYou can also delete labels in another repository:
# Format: OWNER/REPOSITORY
./delete-labels.sh --repo username/repository-name
# Example:
./delete-labels.sh --repo octocat/hello-worldEdit the create-labels.sh file and add new entries to the labels array:
labels=(
# Existing labels...
"🎨 Design,Design-related changes,ff6b6b"
)Format: "Name,Description,Color"
Comment out the corresponding lines in create-labels.sh or remove them completely.
- Make sure GitHub CLI is installed
- Check your PATH
- Run
gh auth login - Check your repository permissions
- This is normal - existing labels are skipped
- Use
delete-labels.shto remove labels
- Check your repository permissions
- Make sure you have admin rights
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test the scripts
- Create a pull request
These scripts directly modify labels in your GitHub repository. Use them with caution and test them in a test repository before using them in production repositories.
Tip: You can also use these scripts in GitHub Actions to automatically manage labels!