https://github.com/mleidel/gptcom
A command line AI client for Linux written in C using the OpenAI API
https://github.com/mleidel/gptcom
c command-line curl-library json-api linux-app openai-api
Last synced: about 2 months ago
JSON representation
A command line AI client for Linux written in C using the OpenAI API
- Host: GitHub
- URL: https://github.com/mleidel/gptcom
- Owner: MLeidel
- License: gpl-3.0
- Created: 2023-11-27T19:42:56.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T21:55:01.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T16:23:27.061Z (11 months ago)
- Topics: c, command-line, curl-library, json-api, linux-app, openai-api
- Language: C
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
export GPTMOD="gpt-4"
```
---
__zenity__ must be installed on your system:
```bash
sudo apt install zenity
```
To compile the source:
```bash
gcc -o gptcom gptcom.c -O1 -w JSON/cJSON.c -lm -l curl
```
The curl library for c is also used:
```bash
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 ...`