glab icon indicating copy to clipboard operation
glab copied to clipboard

Need a group namespace list command

Open alerque opened this issue 4 years ago • 3 comments

I realize this tool is primarily targeting interactive use, but I find it useful to have tools that are both useful to run by hand and to script.

One of the things I still use lab for in scripting management of GitLab projects is to list the projects in a group namespace.

Glab currently has a search and I can cobble the results out of glab repo search -s 'group_name /', but even coming up with that search syntax is not intuitive and the output is horribly clunky to parse.

I suggest a simple glab repo list group_name that just expected the group name and returns sensible results.

alerque avatar Feb 18 '22 07:02 alerque

For reference, here is how the GitHub CLI does this:

$ gh repo list preservim | head -4
preservim/nerdcommenter Vim plugin for intensely nerdy commenting powers        public  2022-02-15T13:29:48Z
preservim/vim-litecorrect       Lightweight auto-correction for Vim     public  2022-02-13T13:23:46Z
preservim/vim-wordchipper       Power tool for shredding text in Insert mode    public  2022-02-13T12:38:03Z
preservim/vim-wordy     Uncover usage problems in your writing  public  2022-02-13T12:37:47Z

Note how easy that output would be to pars with say | IFS='\t' while read repo desc visibility date; do ...; done.

For Gitlab, the lab tool has a very easy to pars output, although the ability to restrict the list to a group is missing so you kind of have to parse that for yourself, e.g.:

$ lab project list -a | grep '^ahit/' | head -4
ahit/lectio_continua
ahit/veritas
ahit/ahityayinlari.com
ahit/athanasius

alerque avatar Feb 18 '22 07:02 alerque

Hey @alerque. This does make sense. I will try to look into it what can be done about this.

zemzale avatar Feb 19 '22 09:02 zemzale

This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.

clemsbot avatar Mar 22 '22 02:03 clemsbot