LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

glab-auth

Manage GitLab CLI authentication

TLDR

Login to GitLab
$ glab auth login
copy
Login by piping a token from a file
$ glab auth login --stdin < [token.txt]
copy
Login to a self-hosted instance
$ glab auth login --hostname [gitlab.example.com]
copy
Show auth status
$ glab auth status
copy
Set up git credential helper
$ glab auth git-credential
copy
Logout
$ glab auth logout
copy

SYNOPSIS

glab auth command [options]

DESCRIPTION

glab auth manages GitLab CLI authentication. It handles logging in to GitLab instances with personal access tokens or OAuth, and stores credentials for use by other glab commands.For self-hosted GitLab instances, use the `--hostname` flag to specify the server address. Credentials are stored in the glab configuration file (`~/.config/glab-cli/config.yml` by default), or in the OS keyring with `--use-keyring`.

PARAMETERS

-h, --hostname host

GitLab host to authenticate with (default: gitlab.com).
-t, --token token
An authentication token, provided via prompt, `--stdin`, or `$GITLAB_TOKEN`.
--stdin
Read the token from standard input rather than prompting.
--api-host host
API host, if different from the web host.
--api-protocol http|https
Protocol to use for API requests.
--git-protocol http|ssh
Protocol to use for git operations.
--use-keyring
Store credentials in the system keyring instead of the plain-text config file.

SUBCOMMANDS

login

Authenticate with a GitLab instance, interactively or non-interactively.
logout
Log out of a GitLab instance.
status
Show authentication status for known hosts.
git-credential
Implement a git-credential-helper for GitLab, usually invoked by git itself.
configure-docker
Configure glab as a credential helper for Docker.

INSTALL

sudo apt install glab
copy
sudo dnf install glab
copy
sudo pacman -S glab
copy
sudo apk add glab
copy
sudo zypper install glab
copy
brew install glab
copy
nix profile install nixpkgs#glab
copy

SEE ALSO

glab(1)

RESOURCES

Copied to clipboard
Kai