Open mvpopuk opened 6 months ago
secret.txt
should only have the plain openai api key. Try again after removing $OPENAI_API_KEY=
from your secret.txt file
I have tried that but I got the same error message.
I also have the same error. I am using the security bin from macOS to get the key from keychain.
here is how I install the plugin using packer.
use({
"jackMort/ChatGPT.nvim",
config = function()
require("chatgpt").setup({
api_key_cmd = "security find-generic-password -w -s 'openai' -a 'neovim'"
})
end,
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
})
The command
security find-generic-password -w -s 'openai' -a 'neovim'
prints the key in a fresh session without any further interaction required.
@psteinroe as a workaround, I set OPENAI_API_KEY
in my zshrc:
export OPENAI_API_KEY=$(security find-generic-password -w -s openai)
I love this plugin but I can't make it work.
I use Plug to install it:
I have a
secret.txt.gpg
in my home directory that was encrypted with the following command:gpg --encrypt --recipient [my email] secret.txt
The contents of the
secret.txt
are$OPENAI_API_KEY=xxxxxxxxxxxxxxxx
And I try to get the
OPENAI_API_KEY
like so:The error I'm getting is Config
api_key_cmd
did not return a value when executedWhat am I doing wrong here ?
Thanks!