jackMort / jackMort/ChatGPT.nvim

Config `api_key_cmd` did not return a value when executed

Open
#355 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
4k
Forks
317
PR merge metrics
No merged PRs in 30d

Description

I love this plugin but I can't make it work.

I use Plug to install it:

```
Plug 'jackMort/ChatGPT.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
```

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:

```
local home = vim.fn.expand("$HOME")
require("chatgpt").setup({
api_key_cmd = "gpg --decrypt " .. home .. "/secret.txt.gpg"
})
```

The error I'm getting is **Config `api_key_cmd` did not return a value when executed**

What am I doing wrong here ?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the api_key_cmd option passed to require('chatgpt').setup and inspect how its command output is read. Reproduce the shown gpg command and verify that it returns a non-empty API-key value, then confirm setup completes without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
Half a day
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.