Skip to main content

ChatGPT CLI

ChatGPT CLI is a Python-based command-line interface for interacting with ChatGPT using the OpenAI API.

Features

  • 🌐 Multilingual support (English, Russian, Polish)
  • 💾 Save and load conversation history
  • ⚡ Quick-access commands (e.g. q, n, e, r)
  • 🖋️ Formatted output using rich

Installation

  1. installation
pip install naf-chatgpt-cli
# or
git clone https://github.com/nafanius/ChatGptCLI.git
cd chatgptcli
pip install .
# or
poetry install
  1. Set up your OpenAI API key
export GPT_API_KEY=sk_your_key
export SAVE_PATH_GPT_HISTORY=/path/to/your/history # optional, default is saved in user's home directory

Usage

Launch the CLI with:

chatgpt_cli

How it use:

After launching the application, you can start typing your questions or commands. Here are some examples:

Welcome to ChatGPT!
q - exit
n - new topic
0 - reset prefix
00 - reset prefix and start new topic
e - translate to English
p - translate to Polish
rv - translate to Russian and provide usage examples
r - translate to Russian
s - save history conversation
l - load istory conversation
c - clear
h - display help
You:
What is the capital of France?
<tap double enter>

ChatGPT:
The capital of France is Paris.

You:

Available Commands

Command Description
q Quit the application
n Start a new topic
0 Reset prefix (exit translation mode)
00 Reset prefix and start a new topic
e Translate input to English
p Translate input to Polish
r Translate input to Russian
rv Translate to Russian and explain usage with examples in English
s Save conversation history to history.json
l Load conversation history from history.json
c Clear the screen
h Show help message

Dependencies

  • openai
  • rich
  • readline (usually included in Unix-based systems)
  • prompt-toolkit (optional, for enhanced input handling)

License

MIT License

Metadata

Release files for naf_chatgpt_cli 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for naf_chatgpt_cli 0.2.1
File Size Uploaded
naf_chatgpt_cli-0.2.1.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for naf_chatgpt_cli 0.2.1
File Interpreter ABI Platform
naf_chatgpt_cli-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / naf_chatgpt_cli-0.2.1.tar.gz

Download URL naf_chatgpt_cli-0.2.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ffbd3026f4aaf1d447809e8cca26a8deb160fa336ed2e01a4db87e1c6879ae95
BLAKE2b-256 checksum
How to use checksums
bdaeeb1e0cadf0d938a443c988112d84a040950bde7ef1b507f3be785bf23377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-36-generic

Release files / naf_chatgpt_cli-0.2.1-py3-none-any.whl

Download URL naf_chatgpt_cli-0.2.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c097e0cf207f102407a186c50c1ae8f30488a644a755df42a19a3bdd4beecc8
BLAKE2b-256 checksum
How to use checksums
4799a5b0c4c4570402fc5ad81a6200cccd9aaba810af1e08e0c2ee78fad8d96a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.12.3 Linux/6.14.0-36-generic

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page