GitHub Commit Labels
A userscript that enhances GitHub commits by adding beautiful labels for conventional commit types. It automatically detects commit types (like feat, fix, docs) and adds visually appealing labels to make your commit history more readable.
Features
- 🏷️ Adds beautiful labels to conventional commit messages
- 🎨 GitHub-style design that matches the platform
- 🌓 Automatic theme detection (light, dark, and dark dimmed)
- 💬 Informative tooltips showing detailed descriptions
- 👆 Toggle button to quickly show/hide labels
- 📤 Export/Import configurations for team sharing
- ⚙️ Fully customizable through a user-friendly configuration panel
- 🔄 Supports multiple aliases for each commit type
- 🎯 Works on commit history and single commit pages

Supported Commit Types
Default commit types and their aliases:
-
Feature:
feat
, feature
-
Added:
added
, add
-
Updated:
update
, updated
-
Removed:
removed
, remove
-
Fix:
fix
, bugfix
, fixed
-
Hot Fix:
hotfix
-
Documentation:
docs
, doc
, documentation
-
Style:
style
, css
-
UI:
ui
-
Refactor:
refactor
-
Performance:
perf
, performance
-
Optimize:
optimize
-
Test:
test
, tests
, testing
-
Build:
build
-
CI/CD:
ci
, cd
-
Deploy:
deploy
, release
-
Dependencies:
deps
, dep
, dependencies
-
Chore:
chore
-
Revert:
revert
-
WIP:
wip
-
Security:
security
-
Internationalization:
i18n
-
Accessibility:
a11y
-
API:
api
-
Database:
data
-
Configuration:
config
-
Initial Setup:
init
- You Can ADD More
Example Commit Formats
Here are some examples of how to format your commits to get the labels:
# Basic format
feat: add new login functionality
fix: resolve authentication bug
docs: update API documentation
# With scope
feat(auth): implement OAuth2 login
fix(api): handle rate limiting errors
docs(readme): add installation guide
style(button): improve hover effects
refactor(service): clean up user service code
perf(db): optimize database queries
test(auth): add unit tests for auth service
The script will automatically detect the commit type from the first word of your commit message and add the appropriate label. Make sure to:
- Use one of the supported commit types or their aliases
- Follow the format:
type(scope): description
or type: description
- Keep the commit message clear and concise
- Use meaningful scopes that describe the area of the codebase being changed
Installation
-
Install a userscript manager:
-
Install the script:
Configuration
- Click on your userscript manager's icon
- Select "GitHub Commit Labels" > "Configure Commit Labels"
- Customize:
- Add/remove commit types
- Edit aliases
- Change emojis
- Modify colors
- Toggle prefix removal
- Enable/disable tooltips
- Show/hide floating toggle button
- Export/Import your configuration

Development
To contribute or modify the script:
-
Clone the repository:
git clone https://github.com/nazdridoy/github-commit-labels.git
Make your changes to github-commit-labels.js
Test the script by loading it in your userscript manager
Submit a pull request with your changes
License
MIT License - see LICENSE for details
Credits
Created by nazdridoy
Support
If you encounter any issues or have suggestions: