A cli utility written in Rust that allows fetching all the labels of a project, save those as a YAML file

Overview

glabel

Intro

A utility to import (=get) and export (=apply) Github labels.

Install

cargo install --git https://github.com/chevdor/glabel --locked
glabel --help

You may also enable the wipe feature but bare in mind that it comes with a rather high risk unless you know well what you are doing.

Usage

Help

USAGE:
    glabel 
   
    

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

SUBCOMMANDS:
    apply    Apply a label set from a given file
    get      Get/download labels from a given repository
    help     Print this message or the help of the given subcommand(s)

   

Get

USAGE:
    glabel get [OPTIONS] 
   
    

ARGS:
    
    
         The repo string for now in the form owner/repo such as chevdor/foobar

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

OPTIONS:
    -o, --output 
         The output filename

    
   

Without passing the --output|-o flags, the labels will be shown in your terminal as:

 - bug                      [d73a4a]: Something isn't working
 - documentation            [0075ca]: Improvements or additions to documentation
 - duplicate                [cfd3d7]: This issue or pull request already exists
 - enhancement              [a2eeef]: New feature or request
 - good first issue         [7057ff]: Good for newcomers
 - help wanted              [008672]: Extra attention is needed
 - invalid                  [e4e669]: This doesn't seem right
 - question                 [d876e3]: Further information is requested
 - wontfix                  [ffffff]: This will not be worked on

However, if you provide an output file, the yaml will be stored as:

---
name: chevdor/glabel
description: Import from chevdor/glabel
labels:
  - name: bug
    description: "Something isn't working"
    color: d73a4a
  - name: documentation
    description: Improvements or additions to documentation
    color: 0075ca
  - name: duplicate
    description: This issue or pull request already exists
    color: cfd3d7
  - name: enhancement
    description: New feature or request
    color: a2eeef
  - name: good first issue
    description: Good for newcomers
    color: 7057ff
  - name: help wanted
    description: Extra attention is needed
    color: "008672"
  - name: invalid
    description: "This doesn't seem right"
    color: e4e669
  - name: question
    description: Further information is requested
    color: d876e3
  - name: wontfix
    description: This will not be worked on
    color: ffffff

Apply

USAGE:
    glabel apply [FLAGS] --token 
    
     
     

ARGS:
    
     
          The repo string for now in the form owner/repo such as chevdor/foobar
    
               The filename where your set is stored

FLAGS:
    -h, --help       Print help information
    -r, --replace    By default, existing labels will NOT be updated. If you set this flag to true,
                     they will. Beware, there is no automatic backup so it could be a good idea to
                     run the `get` command first and make a backup
    -V, --version    Print version information

OPTIONS:
    -t, --token 
      
           If you follow good security practices, your GITHUB_TOKEN should not have
                           write access to your repos. Here since we need to write labels, we use
                           another variable for the token with write access. It is highly
                           recommended to pass this as an Environment variable [env: TOKEN=
       
        ] 
       
      
     
    
   

Wipe

If you follow good security practices, your GITHUB_TOKEN should not have write access to your repos. Here since we need to write labels, we use another variable for the token with write access. It is highly recommended to pass this as an Environment variable [env: TOKEN= ]">
USAGE:
    glabel wipe [FLAGS] --token 
     
     
      

ARGS:
    
      
           The repo string for now in the form owner/repo such as chevdor/foobar

FLAGS:
    -a, --apply      By default, for your safety, the command will NOT do anything. If you however
                     pass this flag, there will be no way back :) It is highly recommended to call
                     `get` first and backup your labels but keep in mind that it does not save which
                     labels are applied to PRs and issues. So if you have labels "in use", you will
                     lose them
    -h, --help       Print help information
    -V, --version    Print version information

OPTIONS:
    -t, --token 
       
            If you follow good security practices, your GITHUB_TOKEN should not have
                           write access to your repos. Here since we need to write labels, we use
                           another variable for the token with write access. It is highly
                           recommended to pass this as an Environment variable [env: TOKEN=
        
         ] 
        
       
      
     
    

Documentation

If you feel fancy (and lazy), you may even generate a documentation from your tags using tera-cli.

Using the template in this repo and the following command:

tera --template templates/doc.md.tera doc/sample_yaml.yaml

Will generate the following output:

This is the documentation for your set named `chevdor/glabel`.

It contains 9 labels:

- `bug`: *Something isn't working*
- `documentation`: *Improvements or additions to documentation*
- `duplicate`: *This issue or pull request already exists*
- `enhancement`: *New feature or request*
- `good first issue`: *Good for newcomers*
- `help wanted`: *Extra attention is needed*
- `invalid`: *This doesn't seem right*
- `question`: *Further information is requested*
- `wontfix`: *This will not be worked on*
You might also like...
Fast, compact and all-around subdomain enumeration tool written in Rust
Fast, compact and all-around subdomain enumeration tool written in Rust

Fast, compact and all-around subdomain enumeration tool written in Rust, which uses dns bruteforce, internet search and recursive http content search.

A fast, multi-threaded line counting utility written in Rust.

xloc A fast, multi-threaded line counting utility written in Rust. What is xloc A drop in replacement for bash's wc -l. Your project has x lines of co

Verbump - A simple utility written in rust to bump and manage git semantic version tags.

Verbump - A simple utility written in rust to bump and manage git semantic version tags.

This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to the arrow format.

Arrow2-derive - derive for Arrow2 This crate allows writing a struct in Rust and have it derive a struct of arrays layed out in memory according to th

This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

Postgres proxy which allows tools that don't natively supports IAM auth to connect to AWS RDS instances.

rds-iamauth-proxy rds-proxy lets you make use of IAM-based authentication to AWS RDS instances from tools that don't natively support that method of a

A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtuber models.

facelink_rs A VtubeStudio plugin that allows iFacialMocap to stream data to the app, enabling full apple ARkit facial tracking to be used for 2D Vtube

UnTeX is both a library and an executable that allows you to manipulate and understand TeX files.

UnTeX UnTeX is both a library and an executable that allows you to manipulate and understand TeX files. Usage Executable If you wish to use the execut

Peekable iterator that allows to peek the next N elements without consuming them.

peekaboo docs - crates.io Peekable iterator that allows to peek the next N elements without consuming them. It's no_std compatible by default. It also

Comments
  • Label Data

    Label Data

    could we also export other data of the labels? Such as:

    • how many open issues in this repo has this label on it?
    • how many issues in total has this label on it?
    • when was the last issue created that has this label on it?

    I would need it to see how important/how much this label is still used in the repo.

    enhancement 
    opened by the-right-joyce 1
Releases(v0.0.6)
Owner
Chevdor
Yep, just right there but I like it decentralized.
Chevdor
Generate a THIRDPARTY file with all licenses in a cargo project.

cargo-bundle-licenses Bundle all third-party licenses into a single file. NOTE This tools is not a lawyer and no guarantee of correctness can be made

Seth 58 Jan 7, 2023
A Rust library that simplifies YAML serialization and deserialization using Serde.

Serde YML: Seamless YAML Serialization for Rust Serde YML is a Rust library that simplifies YAML serialization and deserialization using Serde. Effort

Sebastien Rousseau 4 Apr 4, 2024
Bongo Copy Cat wants to be involved in everything you do but instead just imitates you hitting your keyboard all day. After all it's just a cat.

Bongo Copy Cat Introduction Bongo Copy Cat wants to be involved in everything you do but instead just imitates you hitting your keyboard all day. Afte

Abhijeet Singh 4 Jan 23, 2023
bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file

bevy_blender bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file.

Jerald Thomas 45 Jan 4, 2023
File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files.

FTZZ File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files. Installation $ cargo +nightly install

Alex Saveau 22 Dec 28, 2022
Devmode is a project management utility for developers.

Dev(mode) Dev(mode) is a project management utility for developers.

Eduardo Flores 15 Dec 11, 2022
Cakecutter - a utility tool that quickly sets up a project from a pre-built template

Cakecutter Create projects from pre-built cakes (templates)! Supports files, packages, content, running commands and more! Cakecutter is a utility too

Dhravya Shah 10 Jun 22, 2022
A tool that generates a Sublime Text project file that helps you get started using Scoggle.

README A tool that generates a Sublime Text project file that helps you get started using Scoggle. While Scoggle-Gen may not find every single source

Sanjiv Sahayam 0 Jan 10, 2022
A program written in Rust, that allows the user to find the current location of the International Space Station and see it on a map.

ISS Location ViewFinder A program written in Rust, that allows the user to find the current location of the International Space Station and see it on

Suvaditya Mukherjee 2 Nov 8, 2021
Utilities to gather data out of roms. Written in Rust. It (should) support all types.

snesutilities Utilities to gather data out of roms. Written in Rust. It (should) support all types. How Have a look at main.rs: use snesutilities::Sne

Layle | Luca 5 Oct 12, 2022