Skip to content

bboles/glids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glids - GitLab ID Lister

glids is a small command-line utility for quickly listing GitLab Group and Project IDs based on search terms and activity. It can display projects, groups, or a full group/project hierarchy.

When working with the GitLab API, you have to plug in a numeric ID instead of the group or project name in many places. This can be painful if there are dozens or hundreds of groups/projects you are working with. I made this tool so I could quickly map the group/project names to their respective ID.

Features

  • List projects and groups matching a search term (default mode).
  • List only groups matching a search term (--groups).
  • List only projects matching a search term (--projects).
  • Display a hierarchical view of groups, subgroups, and their projects (--hierarchy).
  • Filter results by recent activity (last 30 days by default).
  • Option to show all items regardless of activity (--all).
  • Configure GitLab host via --host flag or GITLAB_HOST environment variable.
  • Requires a GitLab Personal Access Token via GITLAB_TOKEN environment variable.
  • Debug logging (--debug).
  • Can be installed via Homebrew.
  • No third-party modules used.

Demo

Installation

Using Homebrew/Linuxbrew

brew tap bboles/tap
brew install glids

Using go install

go install github.com/bboles/glids/cmd/glids@latest

From Source

  1. Clone the repository:
    git clone https://github.com/bboles/glids.git
    cd glids
  2. Build the binary:
    go build -o glids ./cmd/glids
  3. (Optional) Move the glids binary to a directory in your $PATH.

Configuration

  1. GitLab Host:

    • Set the GITLAB_HOST environment variable:
      export GITLAB_HOST="gitlab.example.com"
    • Or, use the --host flag when running the command:
      glids --host gitlab.example.com <search_term>
    • The --host flag takes precedence over the environment variable.
  2. GitLab Token:

    • Set the GITLAB_TOKEN environment variable with a Personal Access Token (PAT) that has api or read_api scope:
      export GITLAB_TOKEN="your_gitlab_api_token"

Usage

glids [flags] [search_term]
  • search_term: (Optional) A term to filter projects or groups by name/path. If omitted, lists recently active items. Can also be provided via --search.

Flags

  • --search <term>: Explicitly provide the search term. The string is passed to either the group search or project search API (depending on the other flags used).
  • --groups: List groups only.
  • --projects: List projects only.
  • --hierarchy: Show a hierarchical tree view starting from matching groups.
  • --all: Include all projects/groups, ignoring the default 30-day activity filter.
  • --host <host>: Specify the GitLab server hostname (e.g., gitlab.com). Overrides GITLAB_HOST.
  • --debug: Enable verbose debug logging to stderr.
  • --nohttps: Disable HTTPS and use HTTP for API calls.
  • --help: Show help message.

Examples

  1. List recently active projects and groups matching "my-app":

    glids my-app
    # or
    glids --search my-app
  2. List all projects matching "my-app" (including inactive):

    glids --projects --all my-app
  3. List recently active groups matching "platform":

    glids --groups platform
  4. Show the hierarchy for the group "platform/teams":

    glids --hierarchy platform/teams
  5. Disable HTTPS (use HTTP) for API calls:

    glids --nohttps platform
    # or 
    GLID_NOHTTPS=true glids platform
  6. List all recently active projects and groups on a specific GitLab instance:

    glids --host gitlab.mycompany.com
  7. List groups with debug output:

    glids --groups --debug internal-tools

About

Small CLI for browsing Group and Project IDs in GitLab

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages