rj1
log | files | refs
commit 0436fd0063fc379788b79f7c37c25204718cf4e8
parent 02dd0214bb2d99e7979277b9ecc3e96bfa00c91e
author: rj1 <[email protected]>
date:   Wed, 22 May 2024 18:06:12 -0600

nvim: generic pass getter for api key(s)

Diffstat:
M.config/nvim/lua/rj1/ai.lua | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.config/nvim/lua/rj1/ai.lua b/.config/nvim/lua/rj1/ai.lua @@ -27,6 +27,9 @@ end vim.api.nvim_set_keymap('n', '<leader>ai', ':lua Toggle_codeium()<cr>', { noremap = true, silent = true }) + +local function fetch_pass_entry(entry) + local handle = io.popen(entry) if handle ~= nil then local key = string.gsub(handle:read("*a"), "\n", "") handle:close() @@ -38,7 +41,7 @@ require("gp").setup({ providers = { openai = { endpoint = "https://api.groq.com/openai/v1/chat/completions", - secret = fetch_groq_key(), + secret = fetch_pass_entry("pass dev/groq.com/nvim_key"), }, }, agents = {