kardolus / chatgpt-cli

ChatGPT CLI is an advanced command-line interface for ChatGPT models via OpenAI and Azure, offering streaming, query mode, and history tracking for seamless, context-aware conversations. Ideal for both users and developers, it provides advanced configuration and easy setup options to ensure a tailored conversational experience with the GPT model.
MIT License
404 stars 28 forks source link

Read `config.yaml` from XDG standard paths #30

Open erhhung opened 4 months ago

erhhung commented 4 months ago

As more CLI apps are adopting the path conventions laid out by the XDG Base Directory Specification, it would be nice if config.yaml and other generated files like thread history are placed in these standard paths—or at least look for them in these paths before using ~/.chatgpt-cli/:

kardolus commented 4 months ago

Hi @erhhung, I think this makes a lot of sense. I did not know about the XDG standard paths concept when I created the CLI.

It will take me a minute to implement this feature: I will need to create a migration script that moves your current config over to the appropriate directory. However, this migration should work from any version of the CLI (there is a migration script that runs already to account for an earlier change). So it's a little tricky :).

There are also some complications around the case in which the config or data directory does not exist. It seems like most other CLIs try to create the directory in that case.