Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.12k stars 147 forks source link

API Key Flexibility and Duplication #303

Open trueNAHO opened 8 months ago

trueNAHO commented 8 months ago

Issue

Adding codeium.vim to my currently flawless codeium.nvim setup introduces two compatibility issues. Namely, there seems to be no way to modify the location of the configuration file storing the API key, and the API key is duplicated in the configuration file.

My encryption-based setup decrypts the configuration file storing the API key to /run/user/<UID>/<FILE>. In codeium.nvim, I specify the path to this file with its config_path option. However, codeium.vim does not seem to have an equivalent option, decreasing the security level of my setup. My current hacky workaround is to symlink to the /run/user/<UID>/<FILE> file (at some point). Sadly, this is suboptimal because the path is implicitly related instead of logically bound to the (N)VIM configuration file, leading to potential configuration drifts.

Additionally, the API key needs to be duplicated in codeium.nvim's api_key and codeium.vim's apiKey JSON entry. If this is an intentional feature, then I don't mind duplicating one JSON entry, although I cannot think of a use case for using different API keys for codeium.nvim and codeium.vim. Nevertheless, both plugins could use a common api_key entry by default with more specialised nvim_api_key and vim_api_key entries for users intending to use different API keys.

Relevant Implementation Insights

codeium.nvim

The config_path option is documentated as follows:

The config_path defaults to the following:

The api_key is saved with:

The api_key is loaded with:

codeium.vim

The following code snippets demonstrate that codeium.vim's JSON entry is called apiKey:

Related