10000 GitHub - ryanchentw/chatgpt-cli: Simple command line tool for chatting with ChatGPT using the official API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ryanchentw/chatgpt-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT CLI

Screenshot

Overview

Simple script for chatting with ChatGPT from the command line, using the official API (Released March 1st, 2023). It allows, after providing a valid API Key, to use ChatGPT at the maximum speed, at a fraction of the cost of a full ChatGPT Plus subscription (at least for the average user).

How to get an API Key

Go to platform.openai.com and log-in with your OpenAI account (register if you don't have one). Click on your name initial in the top-right corner, then select "View API keys". Finally click on "Create new secret key". That's it.

You may also need to add a payment method, clicking on Billing --> Payment methods. New accounts should have some free credits, but adding a payment method may still be mandatory. For pricing, check this page.

Installation and configuration

You need Python installed on your system.

Clone the repository:

git clone https://github.com/marcolardera/chatgpt-cli.git

Install the dependencies:

pip install -r requirements.txt

After that, edit the config.yaml file, putting your API Key as the value of the api-key parameter. Save the file.

Usage

Launch the chatgpt.py script (depending on your environment you may need to use the python3 command instead of python):

python chatgpt.py

Then just chat! The number next to the prompt is the tokens used in the conversation at that point.

Use the /q command to quit and show the number of total tokens used and an estimate of the expense for that session.

About

Simple command line tool for chatting with ChatGPT using the official API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0