chatgpt from the command line 🤖💬

Overview

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 cargo bin directory is in your path. You can do this by adding the following to your ~/.bashrc or ~/.zshrc:

export PATH="$PATH:$HOME/.cargo/bin"

Finally, you'll need a OPENAI API key (you can get one here), and you'll need to export your API Key as an environment variable:

export OPENAI_API_KEY=<your api key>

Then you can start a conversation with ChatGPT:

chatgpt what is 2 + 2

You can also send multiline messages:

chatgpt '''
    Make this sentence more sophisticated:

    I like to eat pizza
    '''

Your messages in each terminal window are saved to ~/.chatgpt/{terminal pid}/chatlog.json. This means you can ask follow-up questions in a terminal window and start a new conversation by opening a new window.

You might also like...
Rust-based CLI library for OpenAI ChatGPT API
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.

ChatGPT CLI - A minimal assistant in the terminal
ChatGPT CLI - A minimal assistant in the terminal

ChatGPT CLI A lightweight ChatGPT CLI - Chat completion. Interact with ChatGPT from your terminal and save the conversation in a text file. Get starte

A tool for chatting using the ChatGPT API, written in Rust CLI.
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

Using ChatGPT/GPT-3.5/GPT-4 in the terminal.
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

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.

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Ask ChatGPT for a shell script, code, or anything, directly from your terminal 🤖🧠👨‍💻
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

A programming and system administration assistant, powered by chatGPT

TermGPT Interact with ChatGPT from your terminal! 🚀 🤖 Install Cargo cargo install termgpt termgpt --help From source git clone [email protected]:bahdot

Comments
  • times out on long replies

    times out on long replies

    On very long replies the reqwest client times out with source: TimedOut. As openai api requests take longer if they are more complex, this will only affect big replies, and not short ones.

    $ chatgpt write a 10 minute episode of monty python
    
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.openai.com")), port: None, path: "/v1/chat/completions", query: None, fragment: None }, source: TimedOut }', /home/oatman/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chatgpt-cli-0.1
    

    I think this could be fixed easily with finding out what kind of timeout it is and setting it to a large (over 1 minute) value https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.timeout

    thanks!

    opened by 0atman 0
Owner
Juan Gonzalez
Senior Software Engineer @ :octocat:
Juan Gonzalez
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

Juan Gonzalez 9 Mar 23, 2023
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

Philip 5 Mar 28, 2023
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.

Shivam Sharma 9 Mar 28, 2023
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

Felipe S. S. Schneider 6 Apr 4, 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
A simple command-line tool for conversing with ChatGPT

daberu A simple command-line tool for conversing with ChatGPT. "daberu" is a Japanese translation of "chatting". $ daberu -h ChatGPT client tool that

Takeru Ohta 4 Jun 4, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
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

Eric Fu 88 Apr 17, 2023
Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Vitaly Shukela 3 Jan 3, 2023
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023