Skip to content

feat: label auto completion

Kerri Miller requested to merge github/fork/bgraf/175_label_auto_completion into trunk

Created by: bgraf

  • Adds auto-completition for the label prompt during issue creation
  • Adds caching of labels during $ glab label list if local configuration is enabled

Usage

Create an issue with normal label prompt

At this point, nothing is cached.

$ glab issue new -t "title" -d "description"
? Label(s) [Comma Separated] Label1, Label2
#36 title (less than a minute ago)
...

Retrieve a label list

Retrieving a list of labels will store them, comma-separated under key PROJECT_LABELS in .glab-cli/config/.env.

$ glab label list
Showing label 2 of 2 on XXX/YYY
#67 Label1
#68 Label2

Next time we create an issue, we can select from the list of cached labels.

$ glab issue new -t "title" -d "description"
? Label(s)  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  Label1
  [ ]  Label2
...

Questions

  • How to deal with new labels when prompting via multi select? => Users should use the -l command line option to specify new labels.
  • Does Gitlab allow label names to contain commas? => no, thus no problem in storing them comma-separated

Merge request reports