jackMort / jackMort/ChatGPT.nvim
Warning when using `api_key_cmd`
- Dominant language
- Lua
- Stars
- 4k
- Forks
- 317
- PR merge metrics
- No merged PRs in 30d
Description
I'm using the `op` option to set `api_key_cmd`. There are two issues I'm running in to, however.
1. Every time I open nvim, I get a warning that `OPENAI_API_KEY` is not set.
2. I'm immediately asked to authenticate with 1Password, even though I haven't loaded the plugin. I thought since `event = "VeryLazy"`, this should only load when I actually run chatgpt command.
I'm obviously doing something wrong, as no one else has posted about this issue. I'm just not sure what it is.
```lua
return {
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
config = function()
require("chatgpt").setup({
api_key_cmd = "op read op://private/OpenAI/credential --no-newline",
api_model = "gpt-4-turbo",
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
"nvim-telescope/telescope.nvim",
},
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported configuration with require("chatgpt").setup and the VeryLazy event, then trace what runs before a chatgpt command. Check when the OPENAI_API_KEY warning and 1Password authentication are triggered; done means neither occurs at startup and authentication happens only when the relevant command is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100