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
- installation
pip install naf-chatgpt-cli
# or
git clone https://github.com/nafanius/ChatGptCLI.git
cd chatgptcli
pip install .
# or
poetry install
- 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
openairichreadline(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)
| File | Size | Uploaded | |
|---|---|---|---|
| naf_chatgpt_cli-0.2.1.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|