Main
Start with history: creating
~/.chatgpt-clienables per-thread message history and a sliding context window (README).Use MCP for tool-augmented questions: inject tool results into the thread first, then ask follow-ups while the context stays local to the CLI.
Let the CLI manage MCP sessions: README explains it auto-handles servers that require
mcp-session-idheaders.Prefer direct-download binaries for CI or locked-down machines: README shows
curl -L -o chatgpt ... && chmod +xone-liners by OS/arch.
Source-backed notes
- README documents MCP flags (
--mcp,--mcp-tool,--mcp-params) and that results are injected as[MCP: <tool-name>] ...messages. - README includes Homebrew installation plus direct-download commands for multiple platforms/architectures.
- README says creating
~/.chatgpt-clienables history tracking stored under~/.chatgpt-cli/history/.
FAQ
- Do I need an API key?: Yes — README instructs setting
OPENAI_API_KEYbefore running the CLI. - How do I keep conversation history?: Create
~/.chatgpt-cli; the CLI stores thread history under~/.chatgpt-cli/history/(README). - Does MCP work with servers requiring a session header?: README says the CLI automatically manages
mcp-session-idfor HTTP(S) MCP servers.