Where Does glab Store Config and Tokens?
glab CLI config file with hosts and tokens, and the environment variable overrides.
Last updated
glab stores hosts, aliases and tokens in a config.yml inside a glab-cli folder under ~/.config. First run authentication writes it for you, so most users meet the file only when migrating machines or debugging auth.
Tokens in plain text make this file sensitive by nature. Prefer environment variables on shared or ephemeral machines, and keep the file out of version control. Per command host flags override everything for one off calls against unusual instances, leaving the file as the steady default.
Where glab stores this, by platform
~/.config/glab-cli/config.yml
Respects $XDG_CONFIG_HOME when set. Holds config.yml with host entries, tokens and aliases. Migrate by copying the file with glab closed, or re authenticate and let glab rewrite it.
~/.config/glab-cli/config.yml
Same XDG style path as Linux. Tokens and aliases copy cleanly between the two platforms, since the file holds no machine specific absolute paths.
Frequently asked questions
how do i move glab auth to a new computer
Copy config.yml to the same path on the new machine, or better, switch to token environment variables and skip the file entirely. Config files with tokens belong in encrypted backups, never in dotfile repos.
can glab auth without a config file
Yes. GITLAB_TOKEN and friends outrank the config file for the matching host, which suits CI jobs and shared runners. The file remains the comfortable default for interactive use with several hosts.
Notice an outdated path? Let us know.