Token generation stuck on opening browser

For anyone looking in the future:
I dug through the code and found that the twitch CLI uses viper to store its config.

Looking through viper, I found on windows it stores “environment” variables in:
%APPDATA%/AppName
In this case:
%APPDATA%/twitch-cli
e.g. C:\Users\YourUsername\AppData\Roaming\twitch-cli

You can edit the needed variables there and the CLI starts working perfectly. You will definitely want the refresh token.

I’d recommend setting your token expiration to the past, so it refreshes automatically
TOKENEXPIRATION=2022-01-01T20:00:00.000000Z