shell_gpt icon indicating copy to clipboard operation
shell_gpt copied to clipboard

Implement API key reset option

Open TheR1D opened this issue 2 years ago • 4 comments

Implement an option to reset an API key using command line argument --reset-key. When user provides this flag delete file located in ~/.config/shell-gpt/api_key.txt and ask for new API key. Additionally impement API key validation. Since OpenAI doesn't have dedicated endpoint just for key validation, call https://api.openai.com/v1/completions with some test prompt, make sure response status code is not 403, if so, ask user for valid API key.

TheR1D avatar Feb 19 '23 22:02 TheR1D

Hey I messed up and I pasted my API key twice, do you need help with this feature

highonweb avatar Feb 21 '23 08:02 highonweb

@highonweb solution for now: https://github.com/TheR1D/shell_gpt/issues/5

TheR1D avatar Feb 21 '23 08:02 TheR1D

Thanks bro. Got it

highonweb avatar Feb 21 '23 09:02 highonweb

I've been working on a PR with this that I'll try to make a PR for within the next week.

berkott avatar Mar 10 '23 14:03 berkott

@highonweb solution for now: #5

That doesn't work. There is no .config/shell-gpt/api_key.txt and reinstalling doesn't work for having shell-gpt ask for the key again. I can't make it ask for the key again.

m4l490n avatar Dec 15 '23 00:12 m4l490n