ChatGPT CLI - A minimal assistant in the terminal

Overview

ChatGPT CLI

A lightweight ChatGPT CLI - Chat completion.

Interact with ChatGPT from your terminal and save the conversation in a text file.

CLI Example

Get started

Docker

# Pull the docker container
docker pull imadelh/gli:latest

# Help
docker run --rm -it imadelh/gli ./gli -h

# Run with Openai token - https://platform.openai.com/account/api-keys
export OPENAI_TOKEN=xxx
docker run --rm -it -e OPENAI_TOKEN=$OPENAI_TOKEN imadelh/gli ./gli

# Run with a free endpoint 
docker run --rm -it imadelh/gli ./gli --endpoint 'https://chatgpt-api.shn.hk/v1/'

Binary

# Macos
wget https://github.com/imadelh/Chat-CLI/releases/download/v0.1.21/gli-x86_64-apple-darwin.tar.gz
tar -xvf gli-x86_64-apple-darwin.tar.gz

# Linux
wget https://github.com/imadelh/Chat-CLI/releases/download/v0.1.21/gli-x86_64-unknown-linux-gnu.tar.gz
tar -xvf gli-x86_64-unknown-linux-gnu.tar.gz

Usage

./gli -h 

A simple CLI for ChatGPT.
Requires OPENAI_TOKEN env variable when using OpenAI endpoint.

USAGE:
    gli [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --endpoint <endpoint>          ChatGPT API endpoint URL. [default:
                                       https://api.openai.com/v1/chat/completions]
        --output <output>              Output file path [default: chat_outputs]
        --temperature <temperature>    Temperature (between 0 and 1) [default: 1.0]
  • Using OpenAI endpoint
export OPENAI_TOKEN=<put your key here - https://platform.openai.com/account/api-keys>

./gli --output 'my_chat'
# Token is not required
./gli --endpoint 'https://chatgpt-api.shn.hk/v1/'

Dev

cargo run -- -h
cargo build --release
docker build -t gli -f Dockerfile .

This my first Rust project to learn the basics, contributions are welcome.

TODO:

  • Add more error messages
  • Support multiple models and system prompt
  • Continue from an existing conversation (from a file)
  • Add tests

You might also like...
A minimal CLI framework written in Rust
A minimal CLI framework written in Rust

seahorse A minimal CLI framework written in Rust Features Easy to use No dependencies Typed flags(Bool, String, Int, Float) Documentation Here Usage T

Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package
Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package

Effortlessly build beautiful command-line apps with Rust πŸ¦€ ✨ Beautiful, minimal, opinionated CLI prompts inspired by the @clack/prompts npm package.

chatgpt from the command line πŸ€–πŸ’¬

Talk to ChatGPT from your terminal. Quickstart First you'll need to install the CLI: cargo install chatgpt-cli Then, you'll need to make sure your ca

This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure.

HeyGPT This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure. You can use it to: Chat with ChatGP

Koi is a simple tool built to let you use ChatGPT through the command line

Koi is a simple tool built to let you use ChatGPT through the command line. It adds the ability to let ChatGPT run commands on your computer in order to help you out, or to help you out with complicated tasks.

A command-line interface for interacting with the ChatGPT API from OpenAI
A command-line interface for interacting with the ChatGPT API from OpenAI

cligpt cligpt is a command-line interface for interacting with the ChatGPT API from OpenAI. With cligpt, you can quickly and easily generate text by s

A simple common-line interface for ChatGPT API.
A simple common-line interface for ChatGPT API.

heygpt A simple common-line interface for ChatGPT API. 🌟 Streaming output! πŸ’‘ One-shot mode to get a quick answer πŸ€– Interactive mode to have a conve

ChatGPT powered Rust proc macro that generates code at compile-time.

gpt-macro ChatGPT powered Rust proc macro that generates code at compile-time. Implemented Macros auto_impl!{} #[auto_test(...)] Usage Get ChatGPT API

Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models
Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models

Striving to create a great Application with full functions of learning languages by ChatGPT, TTS, STT and other awesome AI models, supports talking, speaking assessment, memorizing words with contexts, Listening test, so on.

Owner
Imad E.
Sr. Software Engineer @ NVIDIA - Prev. Sr. Engineer @ Tesla ; ML Engineer @ KPMG Ignition Tokyo - MSc in Data Science & MEng in Applied Mathematics
Imad E.
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
ChatGPT-rs is a lightweight ChatGPT client with a graphical user interface, written in Rust

ChatGPT-rs is a lightweight ChatGPT client with a graphical user interface, written in Rust. It allows you to chat with OpenAI's GPT models through a simple and intuitive interface.

null 7 Apr 2, 2023
a command-line tool that transforms a Git repository into a minimal format for ChatGPT queries

gprepo /dΚ’iːpiːˈɹi:pi:oʊ/ a command-line tool that transforms a Git repository into a minimal format for ChatGPT queries. Features Excludes LICENSE an

null 6 Apr 20, 2023
Using ChatGPT/GPT-3.5/GPT-4 in the terminal.

AIChat Using ChatGPT/GPT-3.5/GPT-4 in the terminal. AIChat in chat mode: AIChat in command mode: Install With cargo cargo install --force aichat Bina

null 1.1k Apr 17, 2023
Ask ChatGPT for a shell script, code, or anything, directly from your terminal πŸ€–πŸ§ πŸ‘¨β€πŸ’»

ShellGPT Ask ChatGPT for a shell script, code, or anything, directly from your terminal ?? ?? ??‍?? Demo Install The binary is named gpt when installe

null 4 May 15, 2023
Rust-based CLI library for OpenAI ChatGPT API

This is a Rust library that provides a CLI (command-line interface) for easy and convenient access to the OpenAI ChatGPT API. The library offers a simple and straightforward way to integrate the ChatGPT API into your Rust-based applications.

bigduu 10 Mar 9, 2023
A tool for chatting using the ChatGPT API, written in Rust CLI.

ChatGPT CLI A tool for chatting using the ChatGPT API, written in Rust CLI. You can use this tool to chat, just by setting your API Key. You can modif

null 6 Apr 5, 2023
Rust-powered CLI tool designed to simplify and streamline the release process with help of ChatGPT

$ releasecraftsman ????‍♂️?? Automate Your Release Process with Precision and Ease. ?? Features Generate well-crafted release notes using GPT-3.5 and

Tornike Gomareli 7 Sep 21, 2023
A CLI tool that uses ChatGPT to automatically generate commit messages.

Auto Git Commit This project is a tool that uses the OpenAI GPT model to automatically generate commit messages for Git commits based on the changes m

XIAO YU 16 Mar 5, 2024
Style terminal outputs in a minimal, macro-based, and dead simple way.

sty ?? $\mathbb{\color{red}{Style \ } \color{lightblue}{terminal}\ \color{black}{outputs \ }\color{gray}{\ in\ a} \color{magenta}{\ minimal}\color{gra

ζ–―δΊΊ 5 Apr 18, 2024