don't rely on WORKDIR to run
dst78 opened this issue · comments
The program won't find its config file (and I assume also the .history file) if it is being executed from anywhere other than the directory where the .py file itself is.
It would be much more convenient if those files would be written to ~/.config/chatgpt-cli or any other known directory so that the program can be executed from anywhere, for example through an alias.
Alternatively or on top of that, you could add a config parameter to supply that path. This would enable use of multiple ChatGPT accounts.
On my system (Linux) I can execute the script from everywhere (I even created an alias in .bashrc in order to just type "chatgpt" from any folder), that's exactly the purpose of the line WORKDIR = Path(__file__).parent
What's your OS? Can you provide a screenshot of the error message?
OS is Linux, Manjaro on ARM64. Shell is zsh
My git clone of the repo is in ~/coding/python/chatgpt-cli. This is where the config.yaml
and all other files are.
I have a symlink to call the program rather than an alias:
ln -s ~/coding/python/chatgpt-cli/chatgpt.py ~/.local/bin/chatgpt
The error thrown is simply "Configuration file not found" when I execute the chatcpt
alias.
To test, I've added an alias to zsh, that does indeed work.
This is solved.