Exafunction / codeium.el

Free, ultrafast Copilot alternative for Emacs
https://www.codeium.com
MIT License
412 stars 13 forks source link

Codeium with auth-source and password-store (aka pass) #84

Open abcdw opened 7 months ago

abcdw commented 7 months ago

To obtain a token from password store, you can use the following snippet of code:

(with-eval-after-load 'codeium
  (require 'auth-source)
  (setq-default
   codeium/metadata/api_key
   (funcall (plist-get
             (nth 0 (auth-source-search :host "codeium.ai"))
             :secret))))

Probably it should be a better implementation or support on codeium side.

bbigras commented 4 months ago

Yeah it would be nice if codeium had something like gptel where you can set gptel-api-key to the key string and the default is to use a function to fetch the key from the auth-source.

https://github.com/karthink/gptel/blob/8ba07d042c11cb65ebce69fc1dc069905ec00e5e/gptel.el#L156-L166

https://github.com/karthink/gptel/blob/8ba07d042c11cb65ebce69fc1dc069905ec00e5e/gptel.el#L498-L512