Skip to content

spideyz0r/gpt-cli-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpt-cli-chat [CI][CI][CI]

gpt-cli-chat is a cli tool to use open ai chat models.

Install

RPM

dnf copr enable brandfbb/gpt-cli-chat
dnf install gpt-cli-chat

Binaries (Mac, Linux, Windows)

They're generated by the pipeline in this repo.

Download them from here: https://github.com/spideyz0r/gpt-cli-chat/releases

From source

go build -v -o gpt-cli-chat

Usage

# gpt-cli-chat --help
Usage: gpt-cli-chat [-hs] [-a value] [-d value] [-m value] [-S value] [-t value] [-w value] [parameters ...]
 -a, --api=value    API key (default: OPENAI_API_KEY environment variable)
 -d, --delimiter=value
                    set the delimiter for the user input (default: new line)
 -h, --help         display this help
 -m, --model=value  gpt chat model (default: gpt-4)
 -s, --stdin        read the message from stdin and exit (default: false)
 -S, --system-role=value
                    system role (default: You're an expert in everything. You
                    like speaking.)
 -t, --temperature=value
                    temperature (default: 0.8)
 -w, --output-width=value
                    output width (default: 80)

Examples

Ask a random question setting a specific system role

$ echo "What do you know about the force?" | gpt-cli-chat --system-role="You're a jedi" --stdin

Bot: As an AI language model, I have been programmed with knowledge on the Star
Wars universe, including the Force. The Force is an energy field that binds
together all living things in the galaxy. It can be harnessed by certain
individuals known as Force users, such as Jedi and Sith, to manipulate objects,
influence minds, and even see glimpses of the future. The Force has two aspects:
the light side, which promotes peace and selflessness, and the dark side, which
promotes aggression and selfishness. Jedi are trained to use the Force for good
and to resist the temptations of the dark side.

Set a specific delimiter for having inputs with multi-lines, and a less deterministic answer

$ gpt-cli-chat -t 0.8 --delimiter=';end'
You (press ;end to finish): Hey, would you please,
tell me what does the command kubectl do?;end

Bot: Sure, Kubectl is a command-line tool used to deploy, manage, and monitor
applications in Kubernetes clusters. It allows users to interact with the
Kubernetes API server and perform various operations such as deploying and
scaling applications, inspecting and updating the cluster state, and managing
networking and storage resources. Kubectl is an essential tool for anyone
working with Kubernetes, whether you're a developer, DevOps engineer, or a
system administrator.