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.
- 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
--hostflag orGITLAB_HOSTenvironment variable. - Requires a GitLab Personal Access Token via
GITLAB_TOKENenvironment variable. - Debug logging (
--debug). - Can be installed via Homebrew.
- No third-party modules used.
brew tap bboles/tap
brew install glidsgo install github.com/bboles/glids/cmd/glids@latest- Clone the repository:
git clone https://github.com/bboles/glids.git cd glids - Build the binary:
go build -o glids ./cmd/glids
- (Optional) Move the
glidsbinary to a directory in your$PATH.
-
GitLab Host:
- Set the
GITLAB_HOSTenvironment variable:export GITLAB_HOST="gitlab.example.com"
- Or, use the
--hostflag when running the command:glids --host gitlab.example.com <search_term>
- The
--hostflag takes precedence over the environment variable.
- Set the
-
GitLab Token:
- Set the
GITLAB_TOKENenvironment variable with a Personal Access Token (PAT) that hasapiorread_apiscope:export GITLAB_TOKEN="your_gitlab_api_token"
- Set the
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.
--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). OverridesGITLAB_HOST.--debug: Enable verbose debug logging to stderr.--nohttps: Disable HTTPS and use HTTP for API calls.--help: Show help message.
-
List recently active projects and groups matching "my-app":
glids my-app # or glids --search my-app -
List all projects matching "my-app" (including inactive):
glids --projects --all my-app
-
List recently active groups matching "platform":
glids --groups platform
-
Show the hierarchy for the group "platform/teams":
glids --hierarchy platform/teams
-
Disable HTTPS (use HTTP) for API calls:
glids --nohttps platform # or GLID_NOHTTPS=true glids platform -
List all recently active projects and groups on a specific GitLab instance:
glids --host gitlab.mycompany.com
-
List groups with debug output:
glids --groups --debug internal-tools
