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 151 forks source link

Use Ctrl-D to exit like bash, Use Ctrl-C to cancel input #127

Open Freed-Wu opened 11 months ago

Freed-Wu commented 11 months ago

TIA!

Freed-Wu commented 11 months ago

Currenly, this program detect input and if input is exit, it will exit. However, it limit its usage. which make it even cannot be a translator:

> Please translate the following word to Chinese, just input Chinese.

Sure, please provide the word or phrase you would like me to translate to Chinese.

> hello

你好 (nǐ hǎo)

> exit

退出 (tuìchū)

I suggest give up the function exit/q to exit, just use C-D to replace it. The name of this program is ChatGPT-shell, Why not make it like a true bash?

mountaineerbr commented 11 months ago

Well, did you check the big prompt option?

  -b, --big-prompt           Allow multi-line prompts during chat mode

It can be improved, of course. Instead of using the cat command, there is some things you can do to use bash readline with read command. My chatgpt.sh wrapper is probably too code-spaghetty to be readable but multiline input can be implemented in various ways.

martin-bernholc commented 11 months ago

I'm not sure if i'm using the option properly but when asking chatgpt it tells me the same thing that option isn't properly "mapped".

chatgpt

Yes, there is a bug in the script. The bug is in the section where the script checks for the --big-prompt option. The script incorrectly uses the --big-prompt option instead of the correct option --multi-line-prompt . To fix the bug, you need to replace all occurrences of --big-prompt with --multi-line-prompt in the script.