Shell script for OpenAI's ChatGPT/DALL-E via terminal
Top 32.7% on sourcepulse
This project provides a lightweight shell script to interact with OpenAI's ChatGPT and DALL-E APIs directly from the terminal. It's designed for users who prefer command-line interfaces and want to leverage powerful AI models without setting up complex Python or Node.js environments. The script offers features like chat history, context awareness, image generation, and command execution suggestions.
How It Works
The script utilizes curl
for making HTTP requests to OpenAI's API endpoints (/chat/completions
and /images/generations
) and jq
for parsing JSON responses. It supports various OpenAI models, including gpt-3.5-turbo
and gpt-4
, and allows customization of API parameters like temperature and max tokens. A key feature is its built-in chat context management for models that don't natively support conversation history, ensuring continuity in dialogues.
Quick Start & Requirements
curl -sS https://raw.githubusercontent.com/0xacx/chatGPT-shell-cli/main/install.sh | sudo -E bash
(or install via AUR: paru -S chatgpt-shell-cli
).curl
, jq
. An OpenAI API key is required. Optionally, glow
for markdown rendering and imgcat
(for iTerm) for in-terminal image viewing.OPENAI_KEY
environment variable.Highlighted Details
imgcat
).Maintenance & Community
The project has an active Discord server for contributions and support. Several contributors are listed, indicating community involvement.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
The script relies on external tools (curl
, jq
) and requires an OpenAI API key, which may incur costs. Image viewing in the terminal is dependent on specific terminal emulators like iTerm.
1 year ago
1 day