Gish: A GPT CLI focused on coding

Hi Folks,

gish is a shell command that I now use every day all day. It simplifies my worklow by performing various tasks with just a simple command, and it’s better than github copilot for many tasks.


  • gish tell me a joke will just send the request
  • gish -e puts you in your editor and sends the content when you’re done.
  • gish -i foo sends the content of foo. Equivalent to cat foo | gish
  • gish -m gpt-4 specify the model
  • gish -s foo.ts will save the output to foo.ts.

screencast: to view it in action
github page with more details and installation instruction.

GPT as a better collaborator
This is a real world example of a request that generated the exact code I wanted.

#import ~/work/gish/tasks/coding.txt
Change the following so that it looks for the open AI key in the following fashion:
1. env variable
2. os.home()/.openai
3. Throws an exception telling the user to put it in one of the above, and then exits
#diff ~/work/gish/src/LLM.ts

Gish does the following.

  1. Incorporates the coding prompt using #import into the request, telling GPT to just provide code.
  2. Describes the request.
  3. #diff like #import brings the code into the request, but also tells gish to run the diff program, in my case vimdiff, on the result. I can then pick and choose what to incorporate into my code.

This approach can of course be used for:

  • code reviews,
  • code documentation
  • unit tests