https://github.com/coder/ghlabels
A tool to synchronize labels on GitHub repositories sanely.
https://github.com/coder/ghlabels
Last synced: 15 days ago
JSON representation
A tool to synchronize labels on GitHub repositories sanely.
- Host: GitHub
- URL: https://github.com/coder/ghlabels
- Owner: coder
- License: mit
- Created: 2019-11-25T03:19:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-23T16:20:30.000Z (over 5 years ago)
- Last Synced: 2025-04-02T22:35:28.709Z (23 days ago)
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ghlabels
A tool to synchronize labels on GitHub repositories sanely.
It uses the same credentials as [hub](http://github.com/github/hub) to access github repositories. In fact, it uses the same library
as hub so if you have multiple credentials with hub and expect to be able to select between them,
ghlabels will offer the same prompts. If you do not have hub setup, it will prompt for the credentials
the same way hub does. You will need to set `$GITHUB_HOST` before running a command for the first time
if you are using a custom GitHub enterprise setup and have not used it already with hub. After that,
ghlabels will prompt you to select between hosts.## Install
```
go get -u go.coder.com/ghlabels
```## Usage
ghlabels uses a JSON file that looks like this and represents the labels for a given repository:
```json
[
{
"name": "blocked",
"description": "",
"color": "032e70"
},
{
"name": "good first issue",
"description": "",
"color": "e7dff5"
},
{
"name": "p1",
"description": "",
"color": "df0000"
},
{
"name": "p2",
"description": "",
"color": "ff7474"
},
{
"name": "p3",
"description": "",
"color": "ffabab"
},
{
"name": "p4",
"description": "",
"color": "ffe3e3"
}
]
```You may create and edit a file manually or have ghlabels create this file for you via
```
ghlabels pull / > labels.json
```The above command will create a `labels.json` file in the current directory for the labels on `/`
You can push this to an entire organization's repos (or a single repo) via
```
ghlabels push [/] < labels.json
```Its important to note that this will not delete labels not included in the labels.json. This is to allow
individual repos to create their own custom labels.You can delete labels across entire organizations or repos via the `delete` subcommand.
```
ghlabels delete [] []
```If you do not provide a label, all the labels of the organization will be deleted.
You can rename labels across entire organizations or repos via the `rename` subcommand.
```
ghlabels rename [/]
```