GitLab CLI Configuration
Installation
Install glab following the instructions in the official installation guide.
macOS Additional Requirements
On macOS, you also need to install GNU coreutils for the analytics scripts to work:
brew install coreutils
This is required because the analytics scripts (count-MR-approvals.sh and count-progress.sh) use GNU date syntax which is not available in BSD date (the default on macOS).
Setup Application on GitLab
-
Navigate to GitLab User Settings > Applications
-
Create a new application with these settings:
- Name:
glab - Redirect URI:
http://localhost:7171/auth/redirect - Confidential: Unchecked (application is not confidential)
- Scopes: Select the following scopes needed for authentication:
apiread_userwrite_repositoryopenidprofile
- Name:
-
After creating the application, copy the Application ID (Client ID) for the next step.
Configure CLI
- Set the client ID:
Replaceglab config set client_id <APPLICATION_ID> --host gitlab.tuwien.ac.at<APPLICATION_ID>with the Application ID from the previous step.
Authenticate
-
Start the authentication process:
glab auth login --hostname gitlab.tuwien.ac.at -
Follow the prompts:
- Sign-in method: Select
Web - Domain: Select
gitlab.tuwien.ac.at - Browser authorization: Complete the OAuth flow in your web browser
- Git protocol: Choose your preferred protocol (HTTPS or SSH)
- API protocol: Select HTTPS (recommended for security)
- Git authentication: Select
Yeswhen asked to authenticate Git with GitLab credentials
- Sign-in method: Select
Troubleshooting
If you encounter an "invalid_client" error, verify that:
- The Application ID is correct
- The application is configured as not confidential
- All required scopes are selected
- The redirect URI matches exactly:
http://localhost:7171/auth/redirect