CLI tool for interacting with ChatGPT via the official API
Top 65.5% on sourcepulse
This project provides a command-line interface (CLI) for interacting with OpenAI's ChatGPT API. It's designed for developers and power users who want to leverage ChatGPT's capabilities directly from their terminal, offering cost-effectiveness and speed compared to web interfaces, with features for managing conversations, context, and output formatting.
How It Works
The CLI utilizes Python and the official OpenAI API. Users authenticate via an API key, which can be provided through a configuration file (config.yaml
), environment variables, or command-line arguments. It supports various ChatGPT models, including different versions of GPT-3.5 and GPT-4, allowing users to select models based on performance and cost. The tool handles conversation history, context management via file input, and renders Markdown responses with syntax highlighting.
Quick Start & Requirements
pip install git+https://github.com/marcolardera/chatgpt-cli
config.yaml
, via OPENAI_API_KEY
environment variable, or with the -k
/ --key
flag.chatgpt-cli
to start an interactive session.Highlighted Details
-ml
), context from files (-c
), session restoration (-r
), and non-interactive piping (-n
).-j
).Maintenance & Community
The project was last updated on February 16, 2024. Information on community channels or specific maintainers is not detailed in the README.
Licensing & Compatibility
The project's license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would require clarification.
Limitations & Caveats
The JSON mode feature is currently limited to gpt-3.5-turbo-0125
and gpt-4-turbo-preview
models. The README notes that some user accounts may require advance credit balance charging to use OpenAI APIs.
1 week ago
1 week