Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement API key reset option #30

Closed
TheR1D opened this issue Feb 19, 2023 · 5 comments · Fixed by #395
Closed

Implement API key reset option #30

TheR1D opened this issue Feb 19, 2023 · 5 comments · Fixed by #395
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TheR1D
Copy link
Owner

TheR1D commented Feb 19, 2023

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 TheR1D added the enhancement New feature or request label Feb 19, 2023
@TheR1D TheR1D self-assigned this Feb 19, 2023
@TheR1D TheR1D closed this as completed Feb 19, 2023
@TheR1D TheR1D reopened this Feb 19, 2023
@highonweb
Copy link

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

@TheR1D
Copy link
Owner Author

TheR1D commented Feb 21, 2023

@highonweb solution for now: #5

@highonweb
Copy link

Thanks bro. Got it

@TheR1D TheR1D added the good first issue Good for newcomers label Mar 2, 2023
@TheR1D TheR1D removed their assignment Mar 4, 2023
@berkott
Copy link

berkott commented Mar 10, 2023

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

@m4l490n
Copy link

m4l490n commented Dec 15, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants