TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
9.28k stars 724 forks source link

sgpt -s does not use my functions #306

Closed agarrubio closed 9 months ago

agarrubio commented 1 year ago

I work in zsh. The folowing request offers to execute a command but fails:

sgpt -s "print filename, then apply 'head -1 |nh' to all '.tsv' in current dir"

It proposes the right answer:

for file in *.tsv; do echo $file; head -1 $file | nh; done

If I run it myself, every thing is OK! But if sgpt runs it (option 'E'), I get this error:

zsh:1: command not found: nh
head: write error: Broken pipe

Of course, nh is a zsh function I had defined.

maelp commented 10 months ago

Could it be because the exec command should use shell=True somewhere in the code?

TheR1D commented 9 months ago

Should be fixed in one of previous releases.