di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.98k stars 318 forks source link

[Bug]: Unable to config API_KEY #198

Closed yonatan-rotem closed 1 year ago

yonatan-rotem commented 1 year ago

Opencommit Version

2.2.10

Node Version

16.14.0

NPM Version

9.6.5

What OS are you seeing the problem on?

Windows

What happened?

every command is outputting the same error:

—  'OPENAI_API_KEY' name is invalid, it should be either 'OCO_OPENAI_API_KEY' or it doesn't exist.
—  Manually fix the '.env' file or global '~/.opencommit' config file.

can't set the API KEY, even when i execute the command

 config set OCO_OPENAI_API_KEY=<API_KEY>

I'm getting the same error.

Expected Behavior

Set the APIkey

Current Behavior

Unable to Set the APIkey

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

Tuanpluss02 commented 1 year ago

Just open the file path C:\Users\<username>\.opencommit and replace OPENAI_API_KEY with OCO_OPENAI_API_KEY, and emoji with OCO_EMOJI. This worked for me.

yonatan-rotem commented 1 year ago

works thanks