-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow OpenAI API key to be loaded via shell command #122
base: main
Are you sure you want to change the base?
Conversation
- Updated README.md with instructions for using GPG-encrypted token files. - Added `g:vim_gpg_ai_token_file_path` to Vim configuration in autoload/vim_ai_config.vim. - Modified `load_api_key` in py/utils.py to handle GPG-encrypted token files.
I suspect this hard GPG dependency is a bit of a bummer. Instead, allow for a command instead of a file, so that, say pass can be called, reading the GPG encrypted file. That's how, for example, isync and msmtp solve it. |
You're right. I'll modify the method of passing the secret key to vim-ai from a hard dependency to a more flexible one, allowing users to pass a command instead. Thanks for your input. |
Good points! I can imagine a new config to allow passing a function that loads the key, e.g.: |
Even more flexible as this function could just |
I would prefer to do it in a vim-way |
- Replaced GPG decryption support with a more flexible approach to load API tokens from any shell command. - Users can now specify a command through `g:vim_ai_load_api_token`, and its output will be used as the API key.
Looking at the PR and the last comment, I wonder if there's a misunderstanding? If we agree that passing the token by a Vim function
is doing it a vim-way, then this function could in particular, there are many (vim-)ways, set |
g:vim_gpg_ai_token_file_path
to Vim configuration in autoload/vim_ai_config.vim.load_api_key
in py/utils.py to handle GPG-encrypted token files.