Skip to content

lukebro/chatgpt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT CLI

Talk to ChatGPT in your terminal.

Features

  • Streams responses like ChatGPT.
  • Maintains context in conversation.
  • Supports piping and redirection.

Getting Started

These instructions are for MacOS/Linux only.

  1. Run ./build-and-install.sh
  2. Make sure /usr/local/bin is inside your $PATH
  3. Run chatgpt to get started

For Windows run cargo build --release and run the binary manually. I'm not really sure how to do the equivalent in Windows.

Uninstalling

  1. chatgpt --clear
  2. rm /usr/local/bin/chatgpt

Help

> chatgpt --help
ChatGPT CLI

Usage: chatgpt [PROMPT] [OPTIONS]

Options:
  -h, --help            Prints help information
  -c, --clear           Clears the API key from the config

Examples:
  chatgpt --help
  chatgpt --clear
  chatgpt "How do I write quick sort in Typescript?"
  chatgpt < prompt.txt
  echo "Hi!" | chatgpt

Why

I made this because most of the CLI apps that intergrated with OpenAI's chat completion did not maintain context in conversation. Each prompt started a new one.

This one will keep the context of the conversation just like https://chat.openai.com does (unless you pipe or redirect in a file).

License

MIT

About

Talk to ChatGPT in your terminal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published