A terminal CLI for chatting with OpenAI's GPT-3.5 and GPT-4 models, with interactive chat mode and pipeline support.
kardolus/chatgpt-cli
A multi-provider command-line client for ChatGPT-style LLMs, supporting OpenAI, Azure, Perplexity and LLaMA endpoints with streaming, interactive chat and agent mode.
Open-source alternative to:ChatGPT
- Stars
- 965
- Forks
- 72
- Open issues
- 4
- Last commit
- last month
What is it?
ChatGPT CLI is a command-line client for talking to large language models from the terminal. It works with OpenAI and Azure, as well as Perplexity, LLaMA and other OpenAI-compatible endpoints, and lets you switch providers through named config files. Users can run one-shot queries, stream responses, or start an interactive chat where each named thread keeps its own history within a sliding context window.
Beyond text chat, the tool handles image input and generation, audio input, transcription and text-to-speech, and can pipe arbitrary local content or program output into a prompt. It supports reusable prompt files, structured JSON output, web search for compatible models, and calling tools exposed by Model Context Protocol servers over HTTP(S) or STDIO.
An experimental agent mode runs multi-step tasks using shell, file and LLM tools, in either a ReAct loop or a plan-then-execute workflow. Budget limits on steps, time and tokens, along with policy rules such as denied shell commands and a working-directory sandbox, constrain what the agent can do. Execution logs are written to the cache directory.
Key features
- 01Works with OpenAI, Azure, Perplexity and LLaMA-style endpoints via per-provider config files.
- 02Streaming output and interactive chat with separate history per thread.
- 03Image, audio and transcription support, plus text-to-speech and image generation.
- 04MCP tool calls over HTTP(S) or STDIO, with automatic session handling.
- 05Agent mode with ReAct and plan/execute strategies, budget limits and policy rules.
Use cases
- Querying different LLM providers from the terminal without leaving the shell.
- Piping logs, diffs or files into a model to summarize or review them.
- Running multi-step automation with tool access under explicit budget and directory limits.
- Connecting a model to MCP servers to pull external data into a conversation.
Quick start
- 1
Install via Homebrew on macOS
brew install chatgpt-cli - 2
Set your OpenAI API key in the environment
- 3
Ask a question
chatgpt why is my test failing?
Things to know
- Needs an API key from a supported provider such as OpenAI, Azure or Perplexity.
- Agent mode is described as experimental.
In collections
Topics
FAQ
- What is chatgpt-cli?
- A multi-provider command-line client for ChatGPT-style LLMs, supporting OpenAI, Azure, Perplexity and LLaMA endpoints with streaming, interactive chat and agent mode. ChatGPT CLI is a command-line client for talking to large language models from the terminal. It works with OpenAI and Azure, as well as Perplexity, LLaMA and other OpenAI-compatible endpoints, and lets you switch providers through named config files. Users can run one-shot queries, stream responses, or start an interactive chat where each named thread keeps its own history within a sliding context window.
- Is chatgpt-cli free to use? What license does it have?
- chatgpt-cli is open source under the MIT license. Check the license terms before using it in commercial products.
- Is chatgpt-cli still maintained?
- Updated within 6 months. The last commit to chatgpt-cli was on Sep 30, 2026.
- What can I use chatgpt-cli for?
- Querying different LLM providers from the terminal without leaving the shell. Piping logs, diffs or files into a model to summarize or review them. Running multi-step automation with tool access under explicit budget and directory limits. Connecting a model to MCP servers to pull external data into a conversation.
- How do I install chatgpt-cli?
- Install via Homebrew on macOS: brew install chatgpt-cli Set your OpenAI API key in the environment Ask a question: chatgpt why is my test failing?
- Where can I get chatgpt-cli?
- The source code and installation instructions are on GitHub: https://github.com/kardolus/chatgpt-cli
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Python command-line tool and workflow manager for interacting with LLMs such as ChatGPT/GPT-4 from the terminal.
Self-hostable personal AI assistant as a single Go binary, combining LLM chat, RAG knowledge bases, and agent loops for browsing, shell, and MCP tools.
A personal AI assistant that runs on macOS, Windows, iOS, Telegram, Slack and more, with persistent memory and proactive follow-ups.
A self-hostable web app that unifies chat and AI-powered search across multiple AI providers in one simple interface.
Open-source AI creation platform in Go and Vue3 that bundles chat, image, music, and video generation with an admin backend and billing.