.nh .TH "glab" "1" "Jan 2025" "Auto generated by spf13/cobra" "" .SH NAME .PP glab-auth-login - Authenticate with a GitLab instance. .SH SYNOPSIS .PP \fBglab auth login [flags]\fP .SH DESCRIPTION .PP Authenticate with a GitLab instance. You can pass in a token on standard input by using \fB--stdin\fR\&. The minimum required scopes for the token are: \fBapi\fR, \fBwrite_repository\fR\&. Configuration and credentials are stored in the global configuration file (Default: \fB~/.config/glab-cli/config.yml\fR) .SH OPTIONS .PP \fB-a\fP, \fB--api-host\fP="" API host url. .PP \fB-p\fP, \fB--api-protocol\fP="" API protocol: https, http .PP \fB-g\fP, \fB--git-protocol\fP="" Git protocol: ssh, https, http .PP \fB-h\fP, \fB--hostname\fP="" The hostname of the GitLab instance to authenticate with. .PP \fB-j\fP, \fB--job-token\fP="" CI job token. .PP \fB--stdin\fP[=false] Read token from standard input. .PP \fB-t\fP, \fB--token\fP="" Your GitLab access token. .PP \fB--use-keyring\fP[=false] Store token in your operating system's keyring. .SH OPTIONS INHERITED FROM PARENT COMMANDS .PP \fB--help\fP[=false] Show help for this command. .SH EXAMPLE .EX # Start interactive setup $ glab auth login # Authenticate against `gitlab.com` by reading the token from a file $ glab auth login --stdin < myaccesstoken.txt # Authenticate with a self-hosted GitLab instance $ glab auth login --hostname salsa.debian.org # Non-interactive setup $ glab auth login --hostname gitlab.example.org --token glpat-xxx --api-host gitlab.example.org:3443 --api-protocol https --git-protocol ssh # Non-interactive setup reading token from a file $ glab auth login --hostname gitlab.example.org --api-host gitlab.example.org:3443 --api-protocol https --git-protocol ssh --stdin < myaccesstoken.txt # non-interactive job token setup $ glab auth login --hostname gitlab.example.org --job-token $CI_JOB_TOKEN .EE .SH SEE ALSO .PP \fBglab-auth(1)\fP