Ask ChatGPT without leaving your terminal
No thing special here! It's the OpenAI's Chat Completion that supports context.
The code is taken from https://github.com/sashabaranov/go-openai examples with a litle bit tweak in displaying the messages in a beautiful format - thanks to glamour.
You need to have OPENAI_API_KEY
environemnt variable configured.
export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
go install github.com/tatthien/cmdgpt@latest
- cmdgpt - CLI tool that using ChatGPT to generate linux commands from your natural language