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
🔗 Links
- Homepage: hamiltonhaus.tech
- PyPI: pypi.org/project/chatcli-gptx
- GitHub Repo: github.com/hamiltonhaustech/chatgpt_cli
🧾 License
MIT License
Metadata
Release files for chatcli-gptx 1.0.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 | |
|---|---|---|---|
| chatcli_gptx-1.0.1.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatcli_gptx-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / chatcli_gptx-1.0.1.tar.gz
| Download URL | chatcli_gptx-1.0.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3be467f5281e45d991ffd73e899c6411c153a67658e60777a9a2c6e29f550498
|
|
BLAKE2b-256 checksum How to use checksums |
d855f1f72a8173c71916d63f85d726ab3f26c90ace13cc6f750f7f02e52630c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.17
|
Release files / chatcli_gptx-1.0.1-py3-none-any.whl
| Download URL | chatcli_gptx-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd428eebb473c70b57c8dc8504c332f0300e1c930324ad46de9129cd4dff43a9
|
|
BLAKE2b-256 checksum How to use checksums |
09c65de30a9fe41bc5679ca3fec211b2ef59ceb63a977f0a5bf445af09f99d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.17
|