BuilderIO / ai-shell

A CLI that converts natural language to shell commands.
MIT License
4.08k stars 261 forks source link

Shell option should be set for command execution with multiple processes and pipes to work #8

Closed jpxd closed 1 year ago

jpxd commented 1 year ago

Thanks for this cool tool!

Often I need a combination of multiple commands e.g. with grep / jq etc. For this ChatGPT outputs correct commands with pipes, but they don't work with ai-shell since it just executes one process without the shell support for pipes. Since execa is used this can simply be fixed by using the shell-flag.

See https://github.com/sindresorhus/execa#shell-syntax and https://github.com/sindresorhus/execa#shell for more information.

Here is an example for a perfectly fine command which works when pasted directly into bash or zsh but doesn't work with ai-shell:

Bildschirm­foto 2023-04-07 um 12 22 39
steve8708 commented 1 year ago

Agreed with this, interested in sending a pull request?

jpxd commented 1 year ago

PR sent :)