Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't rely on WORKDIR to run #30

Closed
dst78 opened this issue Jun 16, 2023 · 3 comments
Closed

don't rely on WORKDIR to run #30

dst78 opened this issue Jun 16, 2023 · 3 comments

Comments

@dst78
Copy link

dst78 commented Jun 16, 2023

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.

@marcolardera
Copy link
Owner

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?

@dst78
Copy link
Author

dst78 commented Jun 16, 2023

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.

@marcolardera
Copy link
Owner

This is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants