gog auth remove does not clean up config.json entries
Describe the bug
When running gog auth remove <email>, only the token is removed from ~/.config/gogcli/keyring/. However, related entries in ~/.config/gogcli/config.json (such as account_aliases, account_clients) that reference the removed account are left behind.
Steps to reproduce
- Add an account with an alias:
gog auth add you@gmail.com
gog auth alias set myalias you@gmail.com
- Remove the account:
gog auth remove you@gmail.com
- Inspect
config.json:
Expected behavior
gog auth remove <email> should also remove any references to that email from config.json, including:
account_aliases entries pointing to the removed email
account_clients entries for the removed email
Actual behavior
Stale entries remain in config.json after the token has been removed. This causes gog config list to show references to accounts that no longer exist.
Notes
credentials.json / credentials-<client>.json intentionally should not be removed, as it is shared across accounts (OAuth client credentials from Google Cloud). This is expected behavior.
- The leftover config entries don't cause errors currently, but they are confusing and could potentially cause unexpected behavior with alias resolution.
Environment
- OS: Linux
- Keyring backend: file (
~/.config/gogcli/keyring/)
- gogcli version: 0.12.0 (Homebrew 2026-03-09T05:52:34Z)
gog auth removedoes not clean up config.json entriesDescribe the bug
When running
gog auth remove <email>, only the token is removed from~/.config/gogcli/keyring/. However, related entries in~/.config/gogcli/config.json(such asaccount_aliases,account_clients) that reference the removed account are left behind.Steps to reproduce
config.json:Expected behavior
gog auth remove <email>should also remove any references to that email fromconfig.json, including:account_aliasesentries pointing to the removed emailaccount_clientsentries for the removed emailActual behavior
Stale entries remain in
config.jsonafter the token has been removed. This causesgog config listto show references to accounts that no longer exist.Notes
credentials.json/credentials-<client>.jsonintentionally should not be removed, as it is shared across accounts (OAuth client credentials from Google Cloud). This is expected behavior.Environment
~/.config/gogcli/keyring/)