Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): add functionality to require first token
This commit adds a new function `init_first_token()` which is called only when the user is using cg at the first time and they didn't give it any token. The function requires the user to provide a token for cg by printing instructions on how to obtain one from https://beta.openai.com/account/api-keys. If no tokens are present in the configuration file, this function will be called automatically. The `Config` class has also been updated so that if there are no tokens present in the configuration file, it will append a newly obtained token from `init_first_token()` before writing out to disk. This change improves usability for users who have not yet set up their OpenAI API key with CG.
- Loading branch information