gh-labeler
๐ฆ A fast and reliable GitHub repository label management tool built with Rust.
Features
- ๐ Smart Synchronization: Minimize destructive operations by intelligently renaming similar labels
- ๐ท๏ธ Alias Support: Define aliases for labels to prevent unnecessary deletions
- ๐ Dry Run Mode: Preview changes before applying them
- โ๏ธ Flexible Configuration: Support for JSON and YAML configuration files
- ๐ Fast Performance: Built with Rust for speed and reliability
- ๐ Detailed Reporting: Comprehensive sync reports with operation details
- ๐ฏ CLI & Library: Use as a command-line tool or integrate as a library
Installation
npm (Recommended)
# Install globally
# Or run directly with npx
Cargo (Rust)
Download Binary
Download the latest binary from GitHub Releases.
Quick Start
- Generate a GitHub Personal Access Token with
reposcope - Create a configuration file (optional):
- Sync your repository:
Usage
Basic Commands
# Sync with default labels
# Preview changes (dry-run)
# Generate default configuration
# List current repository labels
Configuration File
Create a labels.json or labels.yaml file:
Command Line Options
)
)
)
Environment Variables
# Set GitHub token via environment variable
Configuration Format
Label Configuration
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | โ | Label name |
color |
string | โ | Hex color code (with # prefix required) |
description |
string | โ | Label description |
aliases |
array | โ | Alternative names for the label |
delete |
boolean | โ | Mark label for deletion |
Example YAML Configuration
- name: "priority: high"
color: "#ff0000"
description: "High priority issue"
aliases:
- name: "type: feature"
color: "#00ff00"
description: "New feature request"
aliases:
- name: "status: wontfix"
color: "#cccccc"
description: "This will not be worked on"
delete: true # Mark for deletion
Examples
Sync with Custom Labels
# Using JSON configuration
# Using YAML configuration
Preview Changes
# See what changes would be made
# Verbose preview with detailed operations
Preserve Additional Labels
# Keep labels that aren't in your configuration
Library Usage
You can also use gh-labeler as a Rust library in your projects:
[]
= "0.1"
= { = "1.0", = ["full"] }
use ;
async
Performance Benefits
| Aspect | gh-labeler (Rust) |
|---|---|
| Performance | โกโกโก Lightning fast |
| Memory Usage | ๐๐๐ Minimal footprint |
| Binary Size | ๐ฆ Compact single binary |
| Startup Time | ๐ Instant startup |
| Cross-platform | โ Windows, macOS, Linux |
| Configuration | JSON + YAML support |
| Dry-run | โ Safe preview mode |
| Verbose output | Detailed operations |
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development
# Clone the repository
# Build the project
# Run tests
# Install locally
# Test npm package locally
License
This project is licensed under the MIT License - see the LICENSE.md file for details.