Closed sedlund closed 8 months ago
same here +1
Solution:
Put your command in a script file and call the script file instead.
ex:
get_api_key.sh
#!/bin/bash
rbw get -f OPENAI_API_KEY chat.openai.com | awk '{print $2}
in config file
api_key_cmd = "get_api_key.sh"
It works for me.
https://github.com/jackMort/ChatGPT.nvim/blob/8191b4a1faea28483aa3a495d01ade3eb86409fe/lua/chatgpt/api.lua#L174
Is there a way this can be changed so I can use a pipe in my command?
I'd like to use:
Using only
rbw get -f OPENAI_API_KEY chat.openai.com
gets a custom field from the entry but its output format is:so I need to pipe to awk, sed, cut, jq or something. I wrote a wrapper script which works, but this is not ideal for having my config files be portable.
Thanks