Where Does the Twitch CLI Store Credentials?
The Twitch CLI keeps client credentials in .twitch-cli.env under $HOME/.twitch-cli, written by twitch configure.
Last updated
The Twitch CLI stores its client id and secret in a single env file under ~/.twitch-cli, managed through twitch configure. Tokens fetched later reuse those credentials without re-prompting.
That file is the whole state: back it up to move machines, delete it to start over. Mock API and event systems read the same credentials, so one configure call unlocks every subcommand.
Where Twitch CLI stores this, by platform
%USERPROFILE%\.twitch-cli\.twitch-cli.env
Client id, secret, tokens in env format. Created by twitch configure; --client-id/--secret flags override per run without rewriting it.
~/.twitch-cli/.twitch-cli.env
Same file. Token refresh (twitch token --refresh) updates it in place; revocation removes tokens but keeps the client pair.
~/.twitch-cli/.twitch-cli.env
Same layout. Point --config elsewhere for isolated identities; mock and event testing share whatever file is active.
Frequently asked questions
How do I set or rotate Twitch CLI credentials?
Run twitch configure (or pass -i/-s flags). It writes client id and secret to the env file; delete the file to deauthorize the machine completely.
Can I use a different config file per project?
Pass --config <path>. The default stays put, which isolates test identities (staging apps, bots) from your main developer credentials.
Notice an outdated path? Let us know.