Skip to content

ChatGPT CLI is an advanced command-line interface for ChatGPT models via OpenAI and Azure, offering streaming, query mode, and history tracking for seamless, context-aware conversations. Ideal for both users and developers, it provides advanced configuration and easy setup options to ensure a tailored conversational experience with the GPT model.

License

Notifications You must be signed in to change notification settings

catskull/chatgpt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT CLI

This project showcases an implementation of ChatGPT clients with streaming support in a Command-Line Interface (CLI) environment, demonstrating its practicality and effectiveness.

a screenshot

Features

  • Interactive streaming mode for real-time interaction with the GPT model.
  • Query mode for single input-output interactions with the GPT model.
  • Context management across CLI calls, enabling seamless conversations with the GPT model by maintaining message history.
  • Viper integration for robust configuration management.

Development

To start developing, set the OPENAI_API_KEY environment variable to your ChatGPT secret key. Follow these steps for running tests and building the application:

  1. Run the unit tests using the following script:
./scripts/unit.sh
  1. Build the app using the installation script:
./scripts/install.sh
  1. After a successful build, test the application with the following command:
./bin/chatgpt what type of dog is a Jack Russel?
  1. To enable history tracking across CLI calls, create a ~/.chatgpt-cli directory using the command:
mkdir ~/.chatgpt-cli

With this directory in place, the CLI will automatically manage message history for seamless conversations with the GPT model. The history acts as a sliding window, maintaining a maximum of 4096 tokens to ensure optimal performance and interaction quality.

For more options, see:

./bin/chatgpt --help

Useful Links

About

ChatGPT CLI is an advanced command-line interface for ChatGPT models via OpenAI and Azure, offering streaming, query mode, and history tracking for seamless, context-aware conversations. Ideal for both users and developers, it provides advanced configuration and easy setup options to ensure a tailored conversational experience with the GPT model.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.9%
  • Shell 3.1%