A flexible command-line tool for interacting with OpenAI's ChatGPT API
Project description
ChatGPT CLI Tool
A flexible, full-featured command-line tool for interacting with OpenAI's ChatGPT API.
🔧 Features
- Prompt input from command line
- Configurable model and system prompt
- Conversation sessions with persistent context
- Export sessions to text or Markdown (with YAML front matter)
- Logging and log filtering
- Colorized output (optional)
- Packaged as a command-line tool (
chatgpt-cli)
🚀 Installation
pip install .
🛠 Usage Examples
# Basic prompt
chatgpt-cli --prompt "What is bourbon?"
# Start a named session
chatgpt-cli --prompt "Explain Terraform." --session devops.json
# Export session to Markdown
chatgpt-cli --session devops.json --export-session devops.md
# Use a specific model and system prompt
chatgpt-cli --prompt "What's new in Python 3.12?" \
--model gpt-4 \
--system "You are a Python expert."
📄 Configuration
Set your OpenAI API key in a .env file or your environment:
OPENAI_API_KEY=sk-...
📦 Project Structure
chatgpt_cli/
├── __main__.py
├── pyproject.toml
├── README.md
└── requirements.txt
🧾 License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chatcli_gptx-1.0.0.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatcli_gptx-1.0.0.tar.gz.
File metadata
- Download URL: chatcli_gptx-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd9680aa6fdc3ec332e6923123a85d4fed85b1e4dd83222862487bf8d0c5612
|
|
| MD5 |
a3f5ff1897d44f9a6de4671caa48912a
|
|
| BLAKE2b-256 |
0172245543bbebb70181f9dd6d461b644801ad50d697f96b28d1c4bdacef61dc
|
File details
Details for the file chatcli_gptx-1.0.0-py3-none-any.whl.
File metadata
- Download URL: chatcli_gptx-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f978c390fe4ba4edffa4cd01a11ee3aa282d3b62e75859f9f3162417068df1c3
|
|
| MD5 |
2c246cefeb2d98ea3fb364d992045f3e
|
|
| BLAKE2b-256 |
fe4a0212f2a98e28c9df386a6ff578ae1c171105a276299a0a60efbc5d90c3ca
|