Use multiple OAuth client credentials (for different Google Cloud projects or brands) without mixing refresh tokens.
- Default client name:
default - Default credentials file:
$(os.UserConfigDir())/gogcli/credentials.json - Named credentials files:
$(os.UserConfigDir())/gogcli/credentials-<client>.json - Tokens are stored per client (
token:<client>:<email>). Default client also writes legacy keys for backwards compatibility. - Default account is stored per client, with a legacy global fallback for the default client.
Use --client (or GOG_CLIENT) to pick which credentials + token bucket to use:
gog --client work auth credentials ~/Downloads/work-client.json
gog --client work auth add you@company.com
gog --client work gmail search "is:unread"
When --client is not set, gog resolves the client in this order:
--client/GOG_CLIENToverrideaccount_clientsmap in configclient_domainsmap in config- Credentials file named after the email domain (e.g.
credentials-example.com.json) default
To auto-select a client for a domain:
gog --client work auth credentials ~/Downloads/work.json --domain example.com
This writes client_domains into config.json so any @example.com account selects the work client.
gog auth credentials list
Shows stored credential files plus any configured domain mappings.
{
keyring_backend: "auto",
account_clients: {
"you@company.com": "work",
},
client_domains: {
"example.com": "work",
},
}
- Legacy
token:<email>entries are copied totoken:default:<email>the first time they are read. - Legacy
default_accountis still respected for the default client.