Skip to content

fix: Improve Docker/server support and fix glab --jq compatibility#6

Merged
konard merged 4 commits intomainfrom
issue-5-898734966645
Jan 25, 2026
Merged

fix: Improve Docker/server support and fix glab --jq compatibility#6
konard merged 4 commits intomainfrom
issue-5-898734966645

Conversation

@konard
Copy link
Member

@konard konard commented Jan 24, 2026

Summary

This PR addresses the issues reported in #5 about glab-setup-git-identity not working properly in Docker/server environments:

  • Fixed README.md manual commands to use pipe to jq instead of --jq flag (glab api does not have a built-in --jq flag in all versions)
  • Added note about jq requirement for manual commands
  • Added "Authentication in Docker/Server Environments" section to README with detailed instructions for:
    • Using screen + curl -L to complete OAuth in Docker containers
    • Using SSH port forwarding for remote servers
    • Token-based authentication (recommended for CI/CD)
  • Enhanced CLI with helpful headless auth instructions - when authentication is needed in Docker/server environments, the tool now prints clear instructions on how to complete the OAuth flow
  • Fixed src/index.js to parse JSON responses in JavaScript instead of relying on glab's --jq flag, improving compatibility with all glab versions
  • Optimized getGitLabUserInfo to use a single API call instead of two

Changes

README.md

  • Fixed example commands to use glab api user | jq -r '.username' instead of glab api user --jq '.username'
  • Added note that jq must be installed for manual commands
  • Added comprehensive section on authentication in headless environments
  • Fixed manual auth command from glab auth login --hostname... --git-protocol... to glab auth login (interactive mode doesn't support extra flags)

src/cli.js

  • Added printHeadlessAuthInstructions() function that displays helpful instructions when authentication is needed
  • Updated handleNotAuthenticated() to show these instructions before attempting auth
  • Improved error messages with multiple options for authentication

src/index.js

  • getGitLabUsername() now parses JSON response in JavaScript instead of using --jq flag
  • getGitLabEmail() now parses JSON response in JavaScript instead of using --jq flag
  • getGitLabUserInfo() optimized to make a single API call and parse both values
  • Added better error messages for parsing failures

Test Plan

  • All 13 unit tests pass
  • ESLint passes with no warnings
  • Prettier formatting verified
  • jscpd duplication check passes
  • CI checks pass

Fixes #5


Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #5
@konard konard self-assigned this Jan 24, 2026
konard and others added 2 commits January 24, 2026 17:51
- Fix README.md manual commands to use pipe to jq instead of --jq flag
  (glab api does not have a built-in --jq flag in all versions)
- Add note about jq being required for manual commands
- Add "Authentication in Docker/Server Environments" section to README
  with instructions for completing OAuth via curl or SSH tunneling
- Enhance CLI with helpful headless auth instructions when authentication
  is required in Docker/server environments
- Fix src/index.js to parse JSON responses in JavaScript instead of
  relying on glab's --jq flag (improves compatibility with all glab versions)
- Optimize getGitLabUserInfo to use a single API call instead of two

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Issues with glab-setup-git-identity, and the pain of using glab in docker/server fix: Improve Docker/server support and fix glab --jq compatibility Jan 24, 2026
@konard konard marked this pull request as ready for review January 24, 2026 16:54
@konard
Copy link
Member Author

konard commented Jan 24, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.604323 USD
  • Calculated by Anthropic: $3.182073 USD
  • Difference: $-0.422250 (-11.72%)
    📎 Log file uploaded as Gist (594KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 3e72553 into main Jan 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with glab-setup-git-identity, and the pain of using glab in docker/server

1 participant