p-e-w / shin

A shell in every text input on your system
GNU General Public License v3.0
278 stars 12 forks source link

Add support for configuring arbitrary command prefixes via environment variables #13

Open apockill opened 1 year ago

apockill commented 1 year ago

Hey folks, I realized I wanted to be able to run ChatGPT commands from anywhere in my computer. I forked shin, made it configurable via environment variables, then wrote a short project for calling chat GPT (https://github.com/apockill/clai).

Anyways, I figured other folks might benefit from this addition.

p-e-w commented 1 year ago

Thanks for the PR!

Making the command interpreter configurable would indeed be a nice feature (see #7). Unfortunately, this PR isn't quite the right approach for several reasons:

In summary, a more sophisticated implementation is needed, probably in the form of a configuration file where multiple interpreters can be specified, and a UI to switch between them. But this would introduce a lot of complexity, and I'm honestly not convinced that would actually be worth it, to cover the relatively niche use cases I've seen so far.

apockill commented 1 year ago

That's totally fair! My use case was to make this tool possible, which meant I just needed to pass the string to some command and return the value back. This PR enabled that, but isn't great if, say, you wanted to run zsh instead of bash.