CLI for ChatGPT
FreeInteractive interface for ChatGPT.
FreeFree tier
Inputs: textOutputs: text
About CLI for ChatGPT
ChatGPT CLI is an elegant, interactive command-line interface for OpenAI's ChatGPT, powered by GPT-3.5-turbo and GPT-4 models. It provides a rich terminal experience with keyboard shortcuts, conversation history navigation, multi-line input modes, and clipboard integration. Users can run it in interactive chat mode, use it with a one-shot prompt, or pipe data directly into it for batch processing. The tool is open-source and supports multiple installation methods including Homebrew, Scoop, Nix, and Go. Future updates plan to add support for additional providers like Claude, Gemini, and Ollama.
Key Features
Powered by GPT-3.5-turbo and GPT-4 models
Interactive chat mode with keyboard shortcuts (e.g., Ctrl+T new conversation, Ctrl+Y copy last answer)
Single-line and multi-line input modes
Pipeline support: pipe data into prompts for batch processing
Conversation history navigation (previous/next questions, context management)
Clipboard integration to copy last answer
Cross-platform: macOS, Linux, Windows, and more
Multiple installation methods: Homebrew, Scoop, Nix, Go install, prebuilt binaries
Open source with custom key binding support
Pros & Cons
Pros
- Free and open source (MIT license)
- Rich keyboard shortcuts for efficient terminal use
- Supports piping data directly into prompts
- Multiple installation methods for various platforms
- Conversation management including history and context reset
- Actively maintained with planned support for additional AI providers
Cons
- Requires a paid OpenAI API key to use
- Currently only supports OpenAI models; other providers still in development
- CLI-only interface; no graphical UI
- Limited to text-based interactions without multimodal capabilities
Best For
Quick AI-powered queries from the terminalIntegrating ChatGPT into shell scripts and pipelinesTranslating or converting data formats (e.g., YAML to JSON)Code review, generation, or debugging via command lineEducational demonstrations and prototypingChat-based assistance without leaving the terminal environment
FAQ
How do I install the CLI?
You can install via Homebrew on macOS/Linux (brew install j178/tap/chatgpt), Scoop on Windows, Nix, or by downloading the latest binary from the GitHub releases page. Alternatively, install with Go using 'go install github.com/j178/chatgpt/cmd/chatgpt@latest'.
What models does it support?
It is powered by GPT-3.5-turbo and GPT-4 models. Support for additional providers like Claude, Gemini, and Ollama is under development.
Can I use it in scripts or pipes?
Yes, you can pipe data into the CLI. For example: 'cat config.yaml | chatgpt -p "convert this yaml to json"' or 'echo "Hello, world" | chatgpt -p translator | say'.
Do I need an API key?
Yes, you need an OpenAI API key. Set it as an environment variable (export OPENAI_API_KEY=xxx) or configure it in the tool's settings.