Skip to content

Build a wrapper to integrate the GitLab CLI (glab) with the GDK

Problem Statement

Currently, developers working on the GitLab CLI (glab) need to manually configure authentication and specify the hostname when connecting to their local GDK instance. This involves multiple steps and environment variables that make the development workflow cumbersome.

The current process requires (example):

# authenticate
glab auth login --hostname "gdk.test:3443" --token "$GDK_GITLAB_TOKEN"
# execute a glab command
GITLAB_HOST=gdk.test:3443 glab duo ask list last 10 commit titles

Proposal

Implement a dedicated GDK command like gdk glab <glab command> that:

  1. Uses a dedicated configuration file that points to the local GDK instance
  2. Automatically includes auth token and hostname in the configuration
  3. Generates the auth token automatically for the root user via GDK
  4. Simplifies the development workflow by eliminating manual setup steps

Example Usage

# Instead of the current multi-step process
gdk glab duo ask list last 10 commit titles
gdk glab issue list
gdk glab mr create

Technical Implementation

  • Create a GDK-specific glab configuration file with:
    • Hostname: gdk.test:3443 (or configured GDK hostname)
    • Auth token: Auto-generated for root user
    • Any other necessary local development settings
  • Implement a command like gdk glab that:
    • Uses the dedicated config file
    • Passes through all glab commands and arguments
    • Handles configuration management automatically

Expected Outcome

  • Implement gdk glab command wrapper
  • Create automatic configuration file generation
  • Auto-generate and manage auth tokens for local development
  • Update GDK documentation with usage examples
  • Enable integration tests to run against local GDK data more easily

Additional Benefits

  • Integration tests can be run with local data instead of requiring gitlab.com test projects
  • Improved developer experience for CLI feature development
  • Consistent local development setup across different environments

Impacted categories

  • gdk-usability - Improves how developers interact with GDK for CLI development

Related Issues