Skip to content
/ labels Public

Create your GitHub labels with ease

Notifications You must be signed in to change notification settings

ink8bit/labels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

labels

Rust

labels is a CLI utility to synchornize your labels in a specific GitHub repo.

Installation

At this time labels is only available from GitHub. I'll publish it on crates.io later.

You can install labels via several ways.

Using repo url

cargo install --git https://github.com/ink8bit/labels

Using repo url with a specific tag

cargo install --git https://github.com/ink8bit/labels --tag v0.1.0

Using repo url with a specific branch

cargo install --git https://github.com/ink8bit/labels --branch main

Setup

Config file

You should create a configuration file called .labelsrc in the root of your project. It should be a valid JSON with the following structure:

{
  "owner": "repo_owner",
  "repo": "repo_name",
  "labels": [
    {
      "name": "bug",
      "description": "Something isn't working",
      "color": "d73a4a"
    },
    {
      "name": "enhancement",
      "description": "New feature or request",
      "color": "a2eeef"
    }
  ]
}

Note

Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing :beetle: will render the emoji 🪲. For a full list of available emoji and codes, see "Emoji cheat sheet.".

{
  "name": ":beetle: bug",
  "description": "Something isn't working",
  "color": "d73a4a"
}

Token

You should create a personal access token using GitHub UI with scope values:

  • repo
  • read:user

And export your token as an environment variable in your .zshrc (or .bashrc):

export LABELS_TOKEN="GITHUB_TOKEN_VALUE"

Usage

USAGE:
    labels [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help      Prints this message or the help of the given subcommand(s)
    list      Prints labels in current repository (first 100 items)
    remove    Removes all labels in current repository
    update    Updates all labels in current repository

Subcommands

list

Print the first 100 labels from the current repo:

labels list

update

Update all labels from the current repo:

labels update

remove

Remove all labels from the current repo:

labels remove