Skip to content
/ gptcom Public

A command line AI client for Linux written in C using the OpenAI API

License

Notifications You must be signed in to change notification settings

MLeidel/gptcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gptcom

A command line AI client for Linux written C using the OpenAI API

gptcom is a small, one file, command-line executable that accepts Gpt prompts and prints text responses to in the terminal.

All arguments typed after the command are input as the one prompt.

When executed with no arguments a GUI text input box opens to accept your prompt.

A running text log is kept: /$HOME/gptcom.log


gptcom uses three environment variables:

  • GPTKEY=your OpenAI API key
  • GPTMOD=the OpenAI Gpt model name to use
  • HOME=your Linux user home directory

example:

export GPTMOD="gpt-4"

zenity must be installed on your system:

sudo apt install zenity

To compile the source:

gcc -o gptcom gptcom.c -O1 -w JSON/cJSON.c -lm -l curl

The curl library for c is also used:

sudo apt-get install libcurl4-openssl-dev

or download the library files from the cURL website.


bash file:

gptcom "$@"

Save as '$'

Execute at command line:

$ hello gpt ...

About

A command line AI client for Linux written in C using the OpenAI API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages