https://github.com/msoup/cli-assistant
A CLI tool: send a prompt to a model of your choice. Currently supports GPT 3.5 turbo and 4 turbo. Support for other LLMs coming
https://github.com/msoup/cli-assistant
bash cli generative-ai openai openai-api python3
Last synced: 2 months ago
JSON representation
A CLI tool: send a prompt to a model of your choice. Currently supports GPT 3.5 turbo and 4 turbo. Support for other LLMs coming
- Host: GitHub
- URL: https://github.com/msoup/cli-assistant
- Owner: MSoup
- Created: 2023-12-09T01:40:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T14:04:34.000Z (almost 2 years ago)
- Last Synced: 2025-10-04T08:38:05.566Z (9 months ago)
- Topics: bash, cli, generative-ai, openai, openai-api, python3
- Language: Python
- Homepage:
- Size: 407 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# GPT CLI
This command-line interface (CLI) tool enables the use of LLM models directly from your terminal. It is designed to be cost-effective by utilizing the latest "turbo" versions of the GPT models, including GPT 4 turbo, and Anthropic Claude as well.
Edit Dec 2023: I made a terrible mistake; the original way to invoke this cli tool was `gpt `, but it never occured to me that `gpt` is an existing tool--[GUID partition table maintenance utulity](https://www.unix.com/man-page/OSX/8/gpt/). Silly me.
## Table of Contents
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
- [Installation](#installation)
## Usage
```bash
% prompt "Hello, GPT3.5-turbo!"
Hello! How can I assist you today?
==================================
Model: gpt-3.5-turbo-1106 | Token usage: 27 | Cost: 0.0001 USD
% prompt -v 4 "Hello, GPT4-turbo!"
Hello! How can I assist you today?
==================================
Model: gpt-4-1106-preview | Token usage: 27 | Cost: 0.0011 USD
```
### Images speak louder than words.

## Prerequisites
- Python 3.9 or higher (needed to create a virtual environment)
- Python Pip
## Installation
```bash
cd install_scripts
chmod +x install.sh
source ./install.sh .bashrc (or .zshrc)
```
## Changing the invocation alias
To change the alias, go to `invoke_gpt.sh` and locate the function:
```bash
prompt() {
source $GPT_APP_PATH/venv/bin/activate
python3 $GPT_APP_PATH/src/app.py "$@"
deactivate
}
```
Change this function name (`prompt`) to whatever you'd like.
Lastly, re-`source` your `.zshrc` or `.bashrc` to activate the invocation alias