A GitLab CLI tool bringing GitLab to your command line
Note: Check the official documentation for the latest supported features and commands.
curl -fsSL https://raw.githubusercontent.com/zero-to-prod/glab/main/install.sh | bash
# Pull the image
docker pull davidsmith3/glab:latest
# Authenticate (one-time setup)
docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login
# Run a command (example - requires a git repository)
docker run --rm -v ~/.config/glab-cli:/root/.config/glab-cli -v $(pwd):/workspace -w /workspace davidsmith3/glab issue list
For convenience, create an alias in your shell configuration (.bashrc, .zshrc):
alias glab='docker run --rm -v ~/.config/glab-cli:/root/.config/glab-cli -v $(pwd):/workspace -w /workspace davidsmith3/glab'
Note: The alias omits
-itflags to work in both interactive and non-interactive contexts. Add-itmanually when needed for interactive commands likeauth login.
Before using this Docker image, ensure you have:
Pull the latest image from Docker Hub:
docker pull davidsmith3/glab:latest
Create a docker-compose.yml:
services:
glab:
image: davidsmith3/glab:latest
container_name: glab
volumes:
- ~/.config/glab-cli:/root/.config/glab-cli
environment:
- TZ=UTC
Run with:
docker-compose run --rm glab --help
latest - Current stable release (recommended){X.Y.Z} - Specific versions (e.g., 1.1.3){X.Y} - Major.minor versions (e.g., 1.1)GLAB requires authentication to connect to your instance.
Configure GLAB with your credentials:
docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login
Follow the interactive prompts to complete authentication.
Optional environment variables you can set:
docker run --rm \
-e TZ=UTC \
-v ~/.config/glab-cli:/root/.config/glab-cli \
-v $(pwd):/workspace \
-w /workspace \
davidsmith3/glab [COMMAND]
Note: Add
-itflag for interactive commands likeauth login.
Essential volumes:
| Volume | Purpose | Required |
|---|---|---|
~/.config/glab-cli:/root/.config/glab-cli | Configuration & credentials | Yes |
$(pwd):/workspace | Current directory access | Optional |
Example with workspace mount (recommended for most commands):
docker run --rm \
-v ~/.config/glab-cli:/root/.config/glab-cli \
-v $(pwd):/workspace \
-w /workspace \
davidsmith3/glab [COMMAND]
Most glab commands require git repository context and should use the workspace mount pattern above.
~/.config/glab-cli on your host machine.config/glab-cli to version controlchmod 700 ~/.config/glab-cli# For commands that need git repository context
docker run --rm \
-v ~/.config/glab-cli:/root/.config/glab-cli \
-v $(pwd):/workspace \
-w /workspace \
davidsmith3/glab [COMMAND] [OPTIONS]
# For interactive commands (like auth login)
docker run -it --rm \
-v ~/.config/glab-cli:/root/.config/glab-cli \
davidsmith3/glab [COMMAND] [OPTIONS]
Display help:
# General help
docker run --rm davidsmith3/glab --help
# Command-specific help
docker run --rm davidsmith3/glab [COMMAND] --help
Example commands:
# List issues in current repository
docker run --rm \
-v ~/.config/glab-cli:/root/.config/glab-cli \
-v $(pwd):/workspace \
-w /workspace \
davidsmith3/glab issue list
# View repository information
docker run --rm \
-v ~/.config/glab-cli:/root/.config/glab-cli \
-v $(pwd):/workspace \
-w /workspace \
davidsmith3/glab repo view
After adding the alias (see Creating Shell Aliases), restart your shell or run source ~/.bashrc. Then you can use:
# Use the alias for simpler commands
glab issue list
glab repo view
# For interactive commands, add -it manually
docker run -it --rm -v ~/.config/glab-cli:/root/.config/glab-cli davidsmith3/glab auth login
# Run a command
docker-compose run --rm glab issue list
# Interactive mode
docker-compose run --rm glab
docker pull davidsmith3/glab# Pull the latest version
docker pull davidsmith3/glab:latest
# Verify the update
docker run --rm davidsmith3/glab --version
For development or custom builds, see Image Development.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
Please read our:
git checkout -b feature-branch)git commit -m 'Add some feature')git push origin feature-branch)This project is licensed under the MIT License - see LICENSE.md for details.
Maintained by: zero-to-prod Last Updated: 2025-11-16
Content type
Image
Digest
sha256:71f01d701…
Size
25.2 MB
Last updated
11 months ago
docker pull davidsmith3/glab