opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

XDG config location

Open Poshi opened this issue 1 year ago • 6 comments

It would be good if the configuration file could be located somewhere else. In particular, it would be nice to have it located where the XDG specification states (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), so you can have all your files under $XDG_CONFIG_HOME. It should not be a difficult change and will allow us to have a cleaner home and an easier configuration backup.

The ability of setting the config file via environment variable (like OC_CONFIG=~/.opencommit), or using an environment variable to configure the software (like OPENAI_API_KEY=MyKey) would also be welcomed.

Poshi avatar Mar 28 '23 09:03 Poshi

+1

tifandotme avatar Apr 03 '23 12:04 tifandotme

Having the ability to pass the OpenAI API key via an ENV var, and not storing it in plaintext on disk, would boost my confidence in using OC.

*Edit: the ENV var feature allegedly exists per #80, although it's not well documented.

robellegate avatar Apr 14 '23 22:04 robellegate

Stale issue message

github-actions[bot] avatar May 25 '23 21:05 github-actions[bot]

Really? :-(

Poshi avatar Jun 02 '23 21:06 Poshi

Having the ability to pass the OpenAI API key via an ENV var, and not storing it in plaintext on disk, would boost my confidence in using OC.

*Edit: the ENV var feature allegedly exists per #80, although it's not well documented.

Sorry to re-open, but can you tell me how the changes in $80 can be used such that the key can be stored in an environment variable instead of a file?

slacksystem avatar Jul 30 '23 20:07 slacksystem

+1 I'd also love to see the config file being read from $XDG_CONFIG_HOME. I would suggest the implementation as follows:

  1. If present, the $XDG_CONFIG_HOME/.opencommit file is considered
  2. If not, it falls back to the currently hardcoded path ~/.opencommit
  3. exported environment variables always overrule 1. and 2.

schroedermatthias avatar Sep 26 '24 10:09 schroedermatthias