0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.05k stars 150 forks source link

AUR package needed #47

Closed Zeioth closed 1 year ago

Zeioth commented 1 year ago

A similar project (gpt-chatbot-cli) is on the AUR. But not this one.

Zeioth commented 1 year ago

I've created the AUR package myself: https://aur.archlinux.org/packages/chatgpt-shell-cli-git If anyone want to test it, please write here any issue you may find.

I'm only copying the file chatgpt.sh to /usr/local/bin/chatgpt, which seems to be the bare minimum to have it working.

Zeioth commented 1 year ago

I've also created an stable AUR package, pointing to main's current head, so we can keep experimenting safely on -git package.

se7en-x230 commented 1 year ago

Installed the git version and it doesn't change open to xdg-open for images

Zeioth commented 1 year ago

@se7en-x230 yeah atm it only installs chatgpt.sh. It doesn't use install.sh.

I undersand that what install.sh does here

# Replace open image command with xdg-open for linux systems
if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
  sed -i 's/open "\${image_url}"/xdg-open "\${image_url}"/g' '/usr/local/bin/chatgpt'
fi

Is to say xdg-open to open images with chatgpt by default? If that is the case I don't thing we should do that. We should avoid changing user defaults or important files unless strictly necessary.

Zeioth commented 1 year ago

Also I don't currently own gpt4 so I cannot test is we have sixel support, which is the standard for displaying graphics on terminal (supported by foot, and other modern terminals)

0xacx commented 1 year ago

@Zeioth Thank you very much for submitting the AUR package! πŸ™ Do you think there's a way to perform the substitution of open to xdg-open in the PKGBUILD file?

Zeioth commented 1 year ago

@0xacx after double checking it I understand that sed command is actually making a substitution in the chatgpt script. Ok I just added the change, you can check it out here.

0xacx commented 1 year ago

@Zeioth That is awesome! πŸ”₯
I think you can remove the if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then and closing fi because AUR packages would only run on Linux. What do you think? I can't test it on my mac, but does it run correctly on your machine? @se7en-x230 could you please re-install and confirm that it works as expected?

Thank you both very much! This is greatly appreciated πŸ™

Zeioth commented 1 year ago

That's a good point. I removed the if condition. Also now we install the LICENSE file in the right directory.

I just reinstalled it after clearing cache and still works fine. Please feel free to double check!

EDIT: Also if you or someone else wants to be added as co-maintainer of the AUR package, please let me know your AUR nickname.

Zeioth commented 1 year ago

Consider adding the arch linux installation method to the README

paru -S chatgpt-shell-cli
0xacx commented 1 year ago

Great! πŸ‘
One last thing, the license file wouldn't need execute permissions since it's not an executable file. So just read and write for the owner and read for anyone else I think would be a bit better (replace with -Dm644).

Does installation work with pacman package manager as well?

Zeioth commented 1 year ago

Ok I gave LICENSE a permission level of 644.

0xacx commented 1 year ago

Ok, right! Thanks for the work on PKGBUILD! πŸ™ I think we can call this done now and close this issue! πŸŽ‰ ✌️

se7en-x230 commented 1 year ago

@Zeioth That is awesome! πŸ”₯ I think you can remove the if [[ "$OSTYPE" == "linux-gnu"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then and closing fi because AUR packages would only run on Linux. What do you think? I can't test it on my mac, but does it run correctly on your machine? @se7en-x230 could you please re-install and confirm that it works as expected?

Thank you both very much! This is greatly appreciated πŸ™

shop-2023-03-21-11-49

works