Closed vhespanha closed 3 months ago
Hey! This is an awesome addition, and would benefit me personally as I use Bitwarden. I can see a few areas with room for improvement:
openai_api_key
method of setting the key. It's confused people in the past, and it currently leads to three conflicting ways to set it. It's also not the safest, as you might accidentally commit it to git. Perhaps it's worth deprecating in favour of this new openai_api_key_cmd
(as well as still allowing the env variable, as per how https://github.com/jackMort/ChatGPT.nvim/ does it).pass
, but with other password managers (such as Bitwarden, Lastpass) the whole Neovim session freezes for a few seconds until the command finishes running. Ideally even the first time it ran, the behaviour could be asynchronous to avoid this. You could emulate this locally by making a simple executable:
#!/bin/bash
sleep 5 echo "$OPENAI_API_KEY"
3. It would be good to handle what happens if the output of the command fails, currently it pastes the error into the buffer itself with Bitwarden.
Thanks for the suggestions! I'll work on these over the next few days.
The ChatGPT plugin I mentioned earlier has an async implementation similar to what you suggested. It was committed by the guy from Dreams of Code. I'll try to create something similar, niw considering the freezing issue with non-local password managers.
I'll improve the error handling, reviewing other password managers to address potential edge cases.
Hey @vhespanha did you run into any issues with this, in case myself or someone else wants to pick it up in the future? I agree it would be cool functionality!
Hey!!
I definitely still want to do this one, I ended up forgetting about it for a while but it's still something I'm willing to work on.
If you or anyone else also want to implement this, then by all means go for it and I'll make sure to collaborate, I'm unemployed right now so it is a good time for me to take another look at it.
That'd be awesome, feel free to reopen the PR. I'd be up for working on it too, I have quite bad Long COVID currently so I only have small windows of opportunity to do open source currently - but happy to collaborate on it now or pick it up in the future.
Hey there,
I added a new feature to my fork and thought I'd open a PR since it's really small.
Main Changes
gpt.lua
pass
(the standard Unix password manager), and this feature is really useful for me.Additional Changes
Thanks!