This is a Go adaptation of the plz-cli tool originally developed by Miguel Piedrafita. This tool is designed to generate and execute shell commands using OpenAI's GPT-3 model.
The program takes a prompt from the command line arguments, sends it to the OpenAI API, and receives a shell command generated by the GPT-3 model. The user is then asked whether they want to execute the generated command. If they confirm, the command is executed and the output is printed to the console.
plz [OPTS] PROMPT...
Options:
-api-base
: API base URL (default: "https://api.openai.com/v1")-api-key
: API key (default: value of theOPENAI_APIKEY
environment variable)-model
: Model to use (default: "gpt-3.5-turbo-instruct")-f
: Run the generated program without asking for confirmation-q
: Minimal output-debug
: Additional debug
The prompt is taken from the command line arguments. For example, if you run plz Hello World
, the prompt will be Hello World
.
go install moul.io/plz@latest
This tool is based on the plz-cli tool developed by Miguel Piedrafita. This version is a personal adaptation by Manfred Touron, tailored to his specific needs.
This project is open source and available under the MIT License.